How to use SASS with Netbeans 8.0.1 - netbeans

I'm trying to use SASS in Netbeans 8.0.1. I have Ruby and SASS set up correctly based upon the feedback from ruby -v.
I have a web application set up with css and scss folders under Project\Web Pages\resources.
My input and output are set to /scss and /css respectively and I have checked 'Compile Sass File on Save'. I have created a styles.scss file and added some SASS/CSS.
When I save the styles.scss file, is it supposed to generate a styles.css? Nothing happens when I save or compile the project.
Has anyone run into any similar problems or have suggestions on how to debug this problem?
Thanks in advance!

Installing SASS on Windows10, Ruby2.2.3, Netbeans8
Download SASS for Windows - RubyInstaller.org
Install Ruby like:
Search windows for CMD (Command Prompt) and start it.
Access Ruby's bin folder using cd \Ruby\bin (Hit Enter)
Install sass using the command gem install sass (Hit Enter to install)
Wait for the installation to finish
In Netbeans open
Options → Tools → Miscellaneous (HTML/JS in v8.1+) → CSS Preprocessors tab
Enter the path to the installed sass.bat C:\Ruby\bin\sass.bat than click Install Sass.
Confirm your changes with Apply / OK
Use an existing one or Create a New Project (HTML5, PHP, whatever...).
After the project is created open the Projects window.
Right-Click your project and choose > Properties.
From the Project Properties popup select CSS Preprocessors.
Select the Compile SASS Files on Save.
(If you want the compiler to automatically minimize your .css result file, use --style compressed under the Compiler Options)
You can see from the image above that the compiler uses two default Input(watchable)/Output(compiled destionation) folders paths.
Create the scss folder (an optionally the css folder) in your project as well.
You're done!
As soon you create a new .scss file or you save it Netbeans will automatically compile the file to .css in the /css folder.

Yes, when you save the file, the css should be created/updated. I think you have wrong mapping for the input/output directories. The paths need to be relative to site root/web root. I don't know for sure what your project is (HTML5 or PHP or Java Web or other?), but if you have Java Web project, then the paths need to be
resources/scss -> resources/css

Salam guys, the below image form my (Command Prompt with Ruby) says that:
"Ruby Sass has reached end-of-life and should no longer be used"

For modern SASS and Netbeans we can just use https://github.com/sass/dart-sass/releases/tag/1.56.1 and install it in our PATH.
The release has the sass.bat file we need (as Roko C. Buljan pointed in his tutorial for Ruby).
There's not need to install Ruby and any other environment.
I applied this on Netbeans 15

Related

CoffeeScript For NetBeans 8.0 Plugin: Set Target Folder For Compiles JS

I am using this Plugin for NetBeans CoffeeScript For NetBeans to compile my CoffeeScript File to JS.
For the project I have this folder.
http://prntscr.com/7euyfe
The coffee file will go to the app/coffee and the compiled goes to app/js.
What I want is, when I compile the File, it will go to the /app/js folder. But as it stands, it only dumps the file on the same folder where the coffee file is.
There is a setting in the Tools > Options, where I can set the target directory as seen in the screenshot.
http://prntscr.com/7euyur
But when I set it, the compiled result became like this.
Is there anyone who use NetBeans know how to do set this up?
You can use Grunt/Gulp to compile coffescript instead of the plugin. Set watcher (grunt-contrib-watch) to watch your coffee scripts files and set the watcher to execute grunt-contrib-coffee task upon file save.

PhpStorm PhpUnit via phar autocomplete not working

I have PHPStorm 8.0.1.
PHPUnit is installed via PHAR archive like:
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/bin/phpunit
PHPUnit works via cli:
user#pc:/usr/bin$ cd ~
user#pc:~$ phpunit --version
PHPUnit 4.3.5 by Sebastian Bergmann.
I followed the instructions from JetBrains website https://www.jetbrains.com/phpstorm/webhelp/enabling-phpunit-support.html#d298258e897
In PHPStorm File->Settings tab PHP/PHPUnit
the radio button Path to phpunit.phar is checked
and value is set to /usr/bin/phpunit
I have a file with a test defined like:
class MyTest extends PHPUnit_Framework_TestCase {
...
At this point PHPStorm marks Undefined class PHPUnit_Framework_TestCase
I've restarted PHPStorm and Computer, but still have the same problem.
I've also tried adding /usr/bin to include path (right click on external libraries in project view, and choose option Configure PHP include paths) without success.
Here's the config for PHPStorm Settings, tab PHP (if it matters):
PHP Language level: 5.5 (finally, generators, etc.)
Interpreter: PHP 5.5 (5.5.9-1ubuntu4.5)
Include path is empty
In order to have a PHAR archive indexed by the IDE it has to have a .phar extension (that's a requirement).
The easiest solution is to place phpunit.phar somewhere in your project (usually it would be PROJECT_ROOT/vendor/ folder).
If having local copy inside the project folder is not desired (for whatever reason; although Composer and other similar kind of tools (bower/npm/etc) are primarily aimed at keeping dependency stuff/packages locally), you may use symbolic links:
either create a symbolic link to that file locally (e.g. PROJECT_ROOT/phpunit.phar --> /usr/bin/phpunit)
or place a full copy (or such symbolic link) in a separate folder outside of the project and then reference it via PhpStorm's Settings | PHP | Include Paths functionality.
The above fix by Calin worked for me too on PhpStorm 2019.1.1, so I'll post it as an answer for easier visibility:
Try right clicking on the .phar and clicking "Exclude phar from project", then clicking "Include phar into project" to refresh it.
In my case, both the .phar file and my .idea folder were pulled from a git commit. I guess PhpStorm didnt realise that the file needed reimporting.
I noticed even though PHP itself can find and run phar that is in its include path, PHPStorm having trouble finding and parsing them.
LazyOne's explanation is correct, however, I didn't need to put it in project folder to be recognized, you can put them in any path as long as its path is introduced to IDE. In my case, I put all phar files in PHP folder, so I just needed to add PHP folder to Include Path list in IDE
Include Path for PHP is under Settings -> Language & Frameworks -> PHP screen (that tiny + at the bottom of screen).

Code completion for PHPUnit and Selenium in NetBeans

How can I get NetBeans to provide code-completion for PHPUnit classes and methods?
I have already tried downloading from the PHPUnit GitHub project, but I didn't understand why the directory is different from what's mentioned on the Selenium documentation. I am looking example for the /test/PHPUnit/Extensions/SeleniumTestCase.php file.
I have already installed PHPUnit from PEAR, but what I need now is the complete PHPUnit file so I can include it in my IDE (in this case NetBeans).
Add the PHPUnit directory to NetBeans's PHP global include path. This will provide code completion in NetBeans for all projects.
Open Tools : Options
Switch to the PHP tab
Click Add Folder... next to the Global Include Path box
Enter /usr/share/php/PHPUnit or navigate to where PEAR installed PHPUnit's source files
Click Open
Click OK
Update: The file defining PHPUnit_Extensions_SeleniumTestCase is placed in the same directory as PHPUnit when you install PHPUnit Selenium.
For example, PHPUnit_Framework_TestCase is stored in
/usr/share/php/PHPUnit/Framework/TestCase.php
The Selenium test case is stored in
/usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php
So by placing /usr/share/php/PHPUnit into the NetBeans include path, you pick up both. You have to install the extension first, of course.
pear install phpunit/PHPUnit_Selenium
Moving away from PEAR...(I'd even uninstall the PEAR version to avoid conflicts first).
Download PHPUnit with sources
https://github.com/sebastianbergmann/phpunit and extract somewhere
semi-permanent /your-install-path
Add /your-install-path/phpunit to your PATHs
In Netbeans options (Tools > Options on Windows, Netbeans > Preferences on OS X), go to PHP tab..
a. Under the General tab, Add Folder... and select the /your-install-path/src/ folder - this will make the auto complete work
b. Go to Frameworks & Tools tab, PHPUnit, select the /your-install-path/phpunit and /your-install-path/phpunit-skelgen respectively - this will make PHPUnit tool work within Netbeans
In your project settings, right click project name > Settings, Testing category, enable PHPUnit. Optionally go to the Testing > PHPUnit settings panel and make adjustments for your project.
Edit:
When I followed the instructions above, the output window told me I needed to install dependencies using "composer install." These additional steps were needed on my machine (running Netbeans 8.2 on Windows 7).
Download Composer and install: https://getcomposer.org/doc/00-intro.md
Modify your-install-path/composer.json by adding the version number between the "description" and "type" keywords like so:
"description": "The PHP Unit Testing framework.",
"version": "5.7.8",
"type": "library",
Using the command line, type the following (this is a windows machine, for mac or lunix, it should be a little different):
cd your-install-path
composer install

Json Editor Plugin installation?

I feel really stupid by asking this question, but how can I install Json Editor Plugin in my Eclipse Helios? I looked at the Forum in sourceforge, but I can't install it neither through .zip or by adding a web site. And will I need to change the execution environment to Java 1.6?
Here is what I did to get the Json Editor Plugin to show up in the Install Dialog.
By doing a little Google-ing, I found this page which describes the steps to install JsonEditorPlugin on 3.4.
After you have followed the first 6 steps, make sure that Group items by category is un-ticked. After that, you can then choose Json Editor Plugin to be installed from the local Zip archive that you have downloaded from the net.
Edit: as a side note, you must not have the unzipped contents of the zip archive in the dropins/ folder, otherwise it will appear as if the plugin is already installed.
Simply dropping the zip contents into the dropins folder however did work also.
Note: You must right click your .json file and choose 'Open with' -> 'Json Editor'
You can install plugins by just unzipping them into the dropins folder.
It does not matter if the zip file contains the parent folders "plugins" and/or "eclipse".
I would recommend Java 1.6 as it brings a better performance and the plugin might require Java 1.6. On your desktop shortcut you use following execution arguments:
eclipse -vm <path to jre 1.6 installation folder>\bin\javaw
Download jsonedit-repository-0.9.7.zip (or whatever) and put it in a folder you like.
In Eclipse Help --> Install New Software
Add --> Archive button and select the zip file.
Name it and press OK
Press button Next and Follow master of installation.
Then after opening json file possibly needed right click mouse on the file --> open with --> JSON editor

Is it possible to add external command line tools to Netbeans?

Is it possible to use external command line tools in Netbeans?
Thank you.
After searching and searching and searching, this feature is just missing in netbeans although it would absolutely straightforward to implement and has been ask by user for 2 more than years...
Regards,
Stéphane
There is a Terminal window in NetBeans 7:
Open the menu, Window -> Output -> Terminal
What about using an Ant target? Ant files are quite comfortable to run from Netbeans.
<exec executable="${executable-full-path}" ...
The best option I've found is to use jmarsault's plugin that he calls NetBeans Command Shortcuts. This give you an icon in the command line where you can add command and terminal scripts to run. The display shows in the output window.
Installation files are available here and he has kept it up to date with the newest versions of NetBeans.
NetBeans Command Shortcut plugin
Installation:
Download the .nbm file for your version of NetBeans
Open Tools / Plugins / Downloaded / Add Plugins...
Select the .nbm file and allow the installation of the plugin.
In since at least version 9.0, there are two decent options:
Just create a script file. (I think you need the C++ plugin for this. Otherwise you have to create it outside NetBeans or as a text file.) In my case I created a JLinkGDBServer.sh that just executes JLinkGDBServer as a prerequisite to start an embedded debug session. This automatically sends the executable's output to a NetBeans terminal.
Add a tool to Tools/Options/Miscellaneous/SendTo. SendTo is a pop-up menu item for certain project entities, for example files but not the project. In my case, I could add a SendTo running the executable and use it by right-clicking on for example the .elf file (although for the GDB server I don't need any file name as an argument).