node-code-ide-configs
node-code-ide-configs copied to clipboard
Add config toturial for CLion and WebStorm
I'm looking at this a little bit at the moment, this is how far I've got with the Jetbrains suite (version 2021.2)...
I tried:
- IntelliJ IDEA Ultimate (which is 'supposed' to be the equivalent of Webstorm or Clion)
- Webstorm + Clion
First I tried opening the overall node project in IDEA Ultimate. I had assumed this would be the better option for a polyglot project since IDEA Ultimate has some support for all the languages:
- It indexes the project (although it's chunky - you may have to increase IDEA's max heap size + restart to get indexing to complete)
- It notices executable targets in the Makefile (you might have to run
./configurefirst to make them work though) - It can run those targets - but building Node produces so much output that it may overwhelm the embedded terminal. You're probably better off doing at least the first
makeout in the OS terminal instead.
Unfortunately after that point, IDEA doesn't seem to know what to do with the C++ bit of node in src/. It can syntax highlight the files, but is not deeply aware of the contents like Clion is, so for example you can't Cmd-Click to jump to method definitions, or use 'go to super method' or 'go to definition' to jump from .cc to .h declaration. So it's not really much more than an editor at this point.
I then tried opening the src/ directory specifically in IDEA, thinking this might prompt it to treat it as a C++ project. There was no difference.
Then I tried opening the whole node project with CLion.
(CLion comes with Javascript support bundled, I assume this is meant to make it as functional as Webstorm for any secondary Javascript in a primarily C/C++ project.)
Same steps as before - increase CLion max heap size for indexing, run ./configure manually, then make in the OS terminal.
Opening up an arbitrary .cc or .h file under src/, CLion does at least seem to have full awareness of the C++ code like an IDE is supposed to, so it'll warn about variables being unused, collapse sections enclosed by macros, let you Cmd-Click to jump to functions etc. Not all of the warnings are correct though - it warned about unused variables that were clearly in use within the same function. I'm thinking this is probably something going wrong in the project setup rather than a bug in CLion.
CLion prefers to use CMake when available, so it may show its banner that says "CMake project is not loaded". This might be because some of node's dependencies in the deps folder, like uv, do use CMake and CLion has somehow detected them. As far as I can tell node is just a plain-old Make project, not CMake, so I'm not sure what to do about that yet.
That's as far as I've got for now. I notice a lot of the tests are split up like this: [1 .js file, 1 .c file, 1 binding.gyp]. So those will be... 'interesting' to get running.
An important consideration for the Jetbrains stack is that they are Java-based, so they don't have an embedded Node interpreter for analysing the JS part of the Node codebase. You have to set the path for node and the path for a package manager (either npm, yarn, or pnpm) in the settings dialog (see attached screenshot).
One way is to make CLion use a self-hosted approach: use the project's compiled node executable as the project's Node interpreter.
This can be done by setting the node path to the built node executable in the Release directory:
(The node project doesn't say anything about an NPM executable so I've had to leave that part blank.)
Although convenient, the self-hosted approach is fragile because:
- if you run
make cleanthenodeexecutable will disappear - if you make significant changes to Node, this could break the parts that CLion uses
Therefore the self-hosted approach would need more thought if it is indeed the way to go (for example, building a stable copy of node source that CLion can depend on, before the developer goes changing node source and recompiling it).
Did anybody successfully have auto-completion and proper type checking with C++ on Clion, Webstorm, or VSCode?
Clion is really bad at the moment.
Did anybody successfully have auto-completion and proper type checking with C++ on Clion, Webstorm, or VSCode?
Clion is really bad at the moment.
![]()
https://blog.actorsfit.com/a?ID=00001-6eb92d18-01ad-4a2e-aa98-68b61795ceb2
https://youtrack.jetbrains.com/articles/CPP-A-179994647?_gl=1uhjxka_gaNTA4MjYzMDA4LjE2NTgyOTE3MDQ._ga_9J976DJZ68*MTY2MjQwNjQ2NS44LjEuMTY2MjQwNjk5NS40OS4wLjA.&_ga=2.2602740.519455494.1662406465-508263008.1658291704
I ran successfully about two years ago on my old ubuntu machine. Let me record the whole process today to let people know how-to
I ran ./configure && make -j32 before enter CLion. then make out as root dir in makefile configure panel

https://youtu.be/0YCDRS0AdXM