PhantomJS/CasperJS IDE Helper - ide

Is there any way to get IDE support for CasperJS functions? I am currently using PhpStorm, but also tried in netbeans, it won't know which functions are defined. It is quite irritating that I get Unresolved variable / undefined function IDE warnings for all the functions.

I tried to copy \casperjs\modules\*.js files to the project, most of the functions got "defined".
PhpStorm: Download the casperjs.zip from casperjs.org, it will contain a modules folder, copy every .js file to your project. (I put them in an IDE_HELPER folder)
An IDE helper javascript file would still be much better, but it is working.
Alternatively: You can also attach these files as external libraries, so it won't bother you while browsing your own files.
It should work in other IDEs too.

Disclaimer: I'm talking about JetBrains products.
I encountered this problem myself. The easiest way to solve it is to click on a bottom right icon (Finally, I understand that is this for!).
It will show you which libraries are associated with an open file. The only thing you have to do is to click on «Libraries in scope» and add your library by clicking «Download»

I know it's an old post, but after not finding any IDE Helper too I managed to write a script that creates one by scraping the content off of the official docs. You can find out more about the IDE Helper on my website:
http://christophersax.com/2016/casperjs-ide-helper/
(It's free of course)
I hope it helps!

You can add casperjs as a Resource in your Preferences.
Go to Project > Directories > + Add Content Root > Add casperjs folder then > Mark as Resource Root.

Related

How to proper integrate PrismJS into a Eleventy project?

I'm building a site using eleventy and want to include code examples with code-highlighting. Prism looks like a great choice for this. How would I add it proper to the build process (not as CDN)?
Use the download option. This gives you the JS/CSS you need. Copy it to your site and ensure you are using the "Passthrough File Copy" (https://www.11ty.dev/docs/copy/) option to copy CSS and JS files over.

IntelliJ IDEA - Directories appearing in Project Files but not in Project

So I created an empty project, but when I create a new directory in the Project window, it does not show up. The directory is actually created, and if I navigate to the Project Files list I can see it there, but as far as I can tell there is no way to make even my src folder part of the actual project. This creates all kinds of problems when I have to move/refactor files, and I'm amazed that something so common and simple is so difficult.
You've created a folder, not a package. If ur using maven or grade, can I suggest u use them to generate an intelij project for you. The command escapes me but a quick Google should tell you
You can manually mark your directory as a sources root:

How to add resource files in intellij from src/main/java directory(intellij 2016)

I am trying to get this very small project working in intellij(it already works in eclipse). https://github.com/deanhiller/webpiecesExample which is generated from the webpieces webserver project. When booting the server, it can't find the html files in src/main/java(ie. the html files are there rather than src/main/resources to keep locality with their controllers).
I tried adding java:.html and java:.tag as I thought that would work according to this document
https://www.jetbrains.com/help/idea/2016.2/compiler.html
but that doesn't seem to work. I then also found cmd-; opens a window with resources and you can click on directories to mark them as resource directories. I tried doing that but it won't let me do that on a source directory.
Both gradle and eclipse are all working with this project, but I can't seem to get intellij working. It would be very nice to be able to use intellij on this project.
EDIT: Why put some resources in src/main/java instead of src/main/resources...
It can be very annoying to have to create the same package heirarchy in two directories(and slower as you are doing double the work). Also, you miss the view of controller's relationships to html files. Lastly, some files are referenced like ../example/index.html from the controller and literally it makes more sense to the user then if they are in the same tree. If you did ../../../../src/main/resource/com/buffalo/example/index.html, it actually would not even work as it is a relative classpath reference. After working in both environments, we found the one to be more efficient so even though it flies in the face of best practices, it makes developers faster(so best practices vs. developer speed.....I choose speed personally). BUT NOTE: This is not true on all projects. Most project should stick to src/main/java and src/main/resources.
thanks,
Dean

IntelliJ set "Use Javascript Library" for one project and all projects

I am having a hard time trying to set the javascript libraries used for IntelliJ's auto detect features (so require() for NodeJS is not detected as an error, for example). I know how to do it for a single file, but I want to set some libraries globally, and some I want to be set for all projects. Is there a way to do this? Below is a screenshot of the option I want to set.
Well, I just met this problem few days ago. There is such a function in Settings -> Languages&Frameworks -> JavaScript -> Libraries page. Click the Manage Scope button and then you can set libraries usage for the whole project or any specified directories.
Besides, just putting the js files of the library into project folder seems to have the same effect.

open same project in both webstorm and intellij and prevent asking "project file changed" window

I want to get rid of the annoying popup window when opening the same project in both webstorm and intellij. This window constains
Project components were changed externally and cannot be reloaded:
RunManager
editorHistoryManager
ToolWindowManager
ProjectRootManager
ChangeListManager
FileEditorManager
Would you like to reload project?
Is there a way to do that?
Thank you.
The problem is that WebStorm and Idea use the same project format (https://www.jetbrains.com/webstorm/help/project.html#d1374457e109), but have different module types, settings, etc. So, it's strongly recommended to avoid sharing the project settings (.idea) between WebStorm and Idea.
If you like to proceed with working on your project in both IDEs, I can suggest creating a separate project to be used in WebStorm: create a new empty WebStorm project anywhere and then add a folder where your javascript, HTML, etc. files are stored as an additional content root to it using Settings/Project/Directories, Add content root.