Prevent included js from showing up in Photoshop's Script menu - scripting

I'm writing a .jsx that will live in Photoshop's script folder. I'm including an external file:
#include "scripts/json2.js"
For some reason, this is appearing in the script menu also! How can I prevent this from happening? The docs are atrocious.

Related

How to stop files inside moved directories (and newly created files) from automatically opening in editor (PyCharm 2020.1)

I am using PyCharm 2020.1. When I create a new file, PyCharm automatically opens it in the editor. Also when I move a directory, PyCharm opens all the files inside the directory in the editor.
Sometimes it's tens of files opened at once. This behavior is frustrating and I would like to turn it off, but have not been able to find where in Preferences to do so.
Someone please help me figure out how to stop newly created files and files inside moved folders from automatically opening in editor. Thanks.
I don't think you can't open a new file via PyCharm, unless you create it via the Terminal tab on the bottom, for example:
touch test.py
When you move a directory into a new directory, there should be a checkmark on a popup saying "Open moved files in editor", so you probably have that checked.

PhpStorm excluding folders from test source

I'm using PHPUnit to run tests in PhpStorm. The tests source folder has been set that when right clicking the folder, PhpStorm runs all the tests in that folder. However there is one folder of tests that I don't want to run when right clicking "run tests".
I've removed that folder from the testsuite in the phpunit.xml so that it doesn't run specific tests from the terminal, however they still run when right clicking on the folder.
Is there any way to exclude a folder from the test sources in PhpStorm or is it simply not possible?
If you don't need specific files, but you don't want to completely remove them, you can temporarily exclude these files from the project. Excluded files are ignored by code completion, navigation and inspections.
To exclude a file, you need to mark it as a plain text file. You can always return excluded files to their original state.
Right-click the necessary file in the directory tree of the
Project tool window.
Select Mark as Plain Text from the menu. Plain text files are
marked with the plain text icon icon in the directory tree.
To revert the changes, right-click the file and select Mark as from the menu.
Here is the source : https://www.jetbrains.com/help/idea/creating-and-managing-modules.html
Peace !

How to automatically synchronize/refresh SCSS/CSS file on change?

Recently my client switched from Eclipse to Intellij. In both IDEs I was editing SCSS files externally and running "compass watch" in terminal. This worked great in Eclipse. immediately after compiling SCSS file I was able to simply refresh browser and see the changes.
In Intellij it takes up to 30 seconds to see the changes, or if I enable "synchronize files on frame activation" I have to switch to browser first, then back to Intellij, and then back again to browser in order to force refresh. Third option is to manually sync "css" folder, which is not convenient. I had a same issue when I was editing and compiling SCSS files in Intellij.
How can I force Intellij to detect CSS file change faster?
I've found the solution.
Open "Settings / File Watchers" and go to SCSS. Make sure that field "Output paths to refresh" has the same value for the output as "Arguments" field.
For example, this is my setup:
Arguments:
--no-cache --update $FileName$:$FileParentDir$\css\$FileNameWithoutExtension$.css
Output paths to refresh:
$FileParentDir$\css\$FileNameWithoutExtension$.css

How to use variables in different less files?

Let's say I separate a less files into many less files to be easy to organize.
Here is my repository:
/reset.less
/variables.less
/mixins.less
/main.less
/styles.less
The styles.less is just importing the other files:
#import "reset.less";
#import "mixins.less";
#import "variables.less";
#import "main.less";
However, when I add some codes into main.less and use the #line-color which is defined in the variables.less. It shows Name Error: variable #line-color is undefined and I cannot compile it- I use PHPStorm with less plugin.
Could you pleas suggest me?
You have to import your variables.less to all files which use your variables.
Edit:
You have to compile only your style.less. You cannot compile the main.less because it doesn't know the variables.less but you don't want a main.CSS anyway, do you?
You should get the correct style.css which is (I guess) the only css file you'll need.
I could solve it by doing the following in PHPstorm:
Open Preferences…
In Tools > File Watchers > Less (configure)
Check "track only root files"
Change the "Output paths to refresh" to ../css/$FileNameWithoutExtension$.css (added "../css/" in front - depending on what folder you'd like to write the css files into)
(At this point you may want to check if this already does the job to your liking. If it doesn't, carry on to the next step…)
In Other Settings > LESS Profiles > (Your profile) (configure)
Define "LESS source directory": /Users/macuser/htdocs/MySite/sites/all/themes/mytheme/less (depending on which folder contains the .less files)
Define "Include file by path": /Users/macuser/htdocs/MySite/sites/all/themes/mytheme/less/style.less (file name depending on which .less file compiles the other .less files)
Add "CSS output directory" by selecting the folder you wish to write the (minified) CSS files
Enable Compress CSS output if desired
Notice: If Compress CSS output is enabled, this means that the code will be compressed everytime you right-click a .less-file and hit "Compile to CSS". By default the output will not be compressed with every modification you make to the .less-file. If you do want to compress the CSS straight away,
Install less-plugin-clean-css using the following command in
Terminal: sudo npm install -g less-plugin-clean-css
Next, go to Tools > File Watchers > Less (configure), and change the "Arguments" to --clean-css --no-color $FileName$ (added "--clean-css" in front).
Now it will compile your CSS automatically while you're coding. You'll no longer need to compile manually.

How to run .html File from WebStorm

We do unit tests via .html files so that we can interact in a web form also. We also just run the dojo test runner.
I have been able to run the .hml file from Aptana but when I try webstorm for the first time, never tried it, love this IDE, I see that when in my .html file the run button at the top is disabled.
So how do I run an .html file that's got markup and javascript from WebStorm and have it come back and hit my debug points inside Webstorm? Does webstorm scrape in what you see in FireFox also or do you have to keep toggling back and fourth such as when you step to the next debug point, tab back to the browser to see the results...or is there a nice way in webstorm to see the markup in runtime at the same time?
All in all I am just trying to get this .html file to run that's got javascript in it and some Dojo runner, etc. in it since I'm using Dojo in this .html file.
Either just open it manually or allow debug from localhost port.
So appearnetly it's not obvious to open a file in WebStorm there is a row of icons that appear in the top right corner of the text editor pane.
You have to hold SHIFT down when clicking the supported/installed browsers icons hidden there, or it will open in the deployment's location (via FTP server settings etc).
Try ALT-F2 for Preview file in... from "View" menu.