How to configure WebStorm to point to VM node interpreter - node.js

The JetBrains Vagrant plugin applied to WebStorm handles the starting and stopping of the VM just fine. My project node interpreter is configured on the VM. When configuring the project settings in WebStorm only local node interpreters are available.
I am able to ssh into the VM and work with the node project from the command line, like always, but I would really like to integrate the IDE, as otherwise it is just a test editor / terminal multiplexer, and I actually don't need it.
Is there something I am missing? On other Jetbrains products, ie PyCharm, the user is able to select the python interpreter from a vagrant vm, but it appears this is lacking on WebStorm.

Remote Node interpreters are not currently supported, please vote for WEB-1974 and linked tickets

It does not seem to be supported by WebStorm yet, but there is a workaround described a comment to the official documentation.

There is a way to do this now:
In your Run/Debug configuration, you can choose the Node interpreter, and more importantly, add one: press the ... button. Then you can add a remote interpreter, either
Then you can choose which you want to use:
However, I noticed a bug. This interpreter always uploads node_modules (could be gigabytes) to the remote interpreter. There is no way to turn it off, even if you do exclude it in the settings:

Related

How can I jump to function definitions using VS Code in SSH remote development

Okay I am new to Embedded Linux development.
Right now, I am trying to setup the development environment as efficiently as possible.
I have a python code running on a lightweight Linux based device, that is located remotely
So far I was able to setup my VS Code on my Windows system, in such a way that I can edit the files directly on the remote Linux device.
I followed the instructions below
https://code.visualstudio.com/docs/remote/ssh
https://code.visualstudio.com/docs/remote/ssh-tutorial
Now that I am able to edit my files directly, I face only one obstacle.
I find it hard to traverse to a function/method definition.
In my windows system, I could just Ctrl+LeftClick on a method/function, and it would take me there.
But here when I opened VS Code with the terminal running remotely, I have to do a Ctrl+F and search in the VS Code editor, which is like working on a notepad.
Does anyone know how to get around this?
On my main windows system, I am able to jump to method definitions quickly by Ctrl+LefClick-ing them.
Hope the question is clear enough.
Install the Python extension on the remote server and select the Python interpreter on the Linux device in VS code:
Press Ctrl+Shift+P to bring up the command palette and run the command Python: Select Interpreter.

How to setup Mac OS X terminal as VScode?

I develop for D365 Business Central, I use VSCode which has an extension to develop apps for it.
https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al
Having installed the above VSCode extension, connecting to a SaaS sandbox, which is simply writing the config flags of in a Launch.json file which is part of the app's file structure, I develop for D365 Business Central.
Recently I have been wanting to write/edit, deploy and debug in Mac OS X terminal itself. Avoiding using VScode. I have no idea where to begin to eventually have a complete setup in the terminal itself of developing apps for D365 Business Central not touching VSCode.
I need guidance, please share how do I start this. I do know first I have to choose an editor, VIM maybe? and then figure out how to place files that get downloaded from https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al somewhere accessible in Terminal? Because that is what will give me autosuggests of functions etc like it does in VScode?
you can only use VSCode, the compiler and the build tools are not standalone
(I feel your pain, I'm coming from vim)
Cheers

Vagrant + external editor that actually connects to vagrant?

I’m new to Vagrant and currently I’m using WebStorm.
The suggested workflow should be to use your editor while compiling stuff in vagrant. My question is: at what point should I stop and use my own compilers?
WebStorm is cool because it connects to your stuff and do things like REPL and autocompletion based on your code etc.
How does that works if my nodejs interpreter is on the VM? Should I install my own nodejs? If so, what’s the point of having a virtual machine?
Maybe there is a way to tell Webstorm to use the VM interpreter but how?

How can I debug my Meteor app using the WebStorm IDE?

Can anyone provide a short list of steps on how to connect a Meteor app to the WebStorm debugger please?
WebStorm is the only IDE with native support for debugging Meteor server code - check this video. Even on Windows, debugging is very simple:
WebStorm 9+
Go to Run --> Debug --> Edit configurations... , click the plus sign, click "Meteor". You can add environment variable like ROOT_URL if you need to.
WebStorm older than 9
This answer is kept only for historical purposes. You should upgrade WebStorm.
On older WebStorms, you used to have to create a Node.js debugging configuration.
on the server, export the environment variable NODE_OPTIONS=--debug=47977. For instance,
NODE_OPTIONS=--debug=47977 meteor # Linux/Mac
set NODE_OPTIONS=--debug=47977 & meteor` # Windows
create a WebStorm/PhpStorm Run/Debug configuration using the port above (47977) and the server host. Leave 127.0.0.1 if you're debugging locally.
in WebStorm, Run -> Debug <myapp>, or press Shift+F9. Make sure that you see "Connected to <your host> in the Debug panel
Now you can set breakpoints, have access to local variables etc.
For client debugging, just use the Chrome debugger, or Firebug.
Troubleshooting
Process disconnected unexpectedly - this happens when meteor restarts automatically because of lack of specific support for Meteor. Just Run -> Debug <myapp>, or press Shift+F9 again.
you can't connect to the server - make sure the firewall rules allow incoming connections to whatever port you chose for the Node.js debugger (47977 here).
The other answers are now out of date. Don't add a Node.js debug configuration as described above, or bother with spyjs.
If you're using Webstorm 9.0, it's as simple as going to Run --> Debug --> Edit configurations... , click the plus, click "Meteor".
WebStorm may also ask you to install a browser add-on, but that's just for client-side debugging; just add a breakpoint in the server-side code and you'll see it works out of the box.
JetBrains have updated the video which was linked to in Dan Dascalescu's answer above, and it shows you the process I just described.
For applications using webpack:webpack, using WebStorm's Meteor debug profile did not seem to work.
My setup uses webpack:webpack v1.0.12, Meteor v1.3.0 and WebStorm 2016.1, but is likely to work with later versions (note that a fix for just this issue was released in v1.0.12, so earlier versions are likely not to work with this procedure).
Here is what I did in order to get it working:
Create a webpack.json file at the project root.
It should include the devtool config, which generates source maps that assist in debugging. The rest may be changed according to your specific setup.
{
"root": "src",
"devServer": {
"host": "localhost"
},
"devtool": "source-map"
}
Create a debug setup:
Node.js Remote Debug, port 5858 (the port is configurable).
Run meteor debug
You may specify a port using --debug-port <port number>.
See meteor help debug for the full details.
Connect WebStorm to the debugger
start the debugger
the status message should indicate that it is connected. Scripts should available in the Scripts tab.
the server should be running in the console
Hit your breakpoints and rejoice.
WebStorm 9 will have Meteor support. While WS 9 isn't released yet (as of Oct 7, 2014), there is an early access program for WS 9.
Read the JetBrains WebStorm blog which describes some of the Meteor support features and includes a brief video.
I'm new to Meteor, WebStorm (and JavaScript for that matter) and have been using the WS 9 EAP build 138.2406 for a couple of weeks. I can launch my project from within the IDE, set breakpoints, walk though code, inspect values, jump to definitions, and issue completions. It's quite helpful.
You can try spyjs plugin for Webstorm: http://blog.jetbrains.com/webstorm/2014/04/spy-js-webstorm-secret-service/
There is a bug with old versions of Webstorm to debug server-side of Meteor 1.2.x. The latest version of Webstorm (11.0.3) released on Dec 24th, 2015 fixed it. Release notes can be found here: https://confluence.jetbrains.com/display/WI/WebStorm+143.1559.5+Release+Notes
I am now able to debug without any problem from Webstorm :)

Is it possible to run Magento TAF (Test Automation Framework) on Linux?

I'm trying to configure Magento TAF on Ubuntu, following the Installation Guide pdf.
I read on it...
Current version limitations:
Remote tests executing
UNIX running Usage
Firefox profile through configuration file
...but I feel skeptical :)
There is a main shell script prepared (runtests.sh)
if I configure everything and I execute selenium RC and runtests.sh, firefox browser opens... (but stands on empty page).
Furthermore: there are several inconsistences on the Installation Guide, that's why I suspect that Linux restrictions perhaps are deprecated. For example: on page 2 says...
At the base level, Magento Test Automation Framework will require the
following software: (...)Selenium RC 2.0.3
... but on page 4...
Download and install Selenium RC 1.0.3 (...).The latest available
version is 2.x, Download Selenium RC (Now available NEW 2.0b), but
automated test cases will probably not work with it.
The question: Is it possible to run Magento TAF on Linux?
Thanks!
Yes, it is possible.
I had the same problem using Selenium Grid in version 1.x.
Download Selenium Driver (Selenium 2). I got the tests running in Debian without modifying runtests.sh.
If you plan to test with several OS / browsers you can find a quick start tutorial for Selenium Grid 2. This may be helpful if you host your Magento code on a linux webserver. It's much easier now to set up the grid than it was with Selenium 1, fortunately.
Launch the server with
java -jar selenium-server-standalone-2.15.0.jar -role hub
By default, the server will run on port 4444. You can start the server on a Linux box without a desktop environment (e.g. a development web server).
Then you set up boxes with desktop environment (e.g. a Windows machine and a Linux machine). Now you download the server standalone library for every machine and start the client:
java -jar selenium-server-standalone-2.15.0.jar -role node -hub http://192.168.1.2:4444/grid/register
You have to change the IP to the IP of your Selenium server (and change the port if you did so in the first command). By default, the client will run on port 5555. If you want to use another port for the client or if you wish to start several client instances, you can define custom ports using the -port switch.
Note: don't care too much about the software versions mentioned in the document at all. It seems to be a bit outdated.
The latest public release works fine on Ubuntu/Debian pretty much out of the box, but the documentation is Windows-orientated.
We got the tests running on a headless Selenium installation using Google Chrome on Ubuntu server 11.04 64bit. Screen-shots are only possible when using Firefox, but Selenium requires version 3.6 of Firefox, so we'll need to downgrade the Mozilla browser to enable that.
[Update: March 27th 2012] We tried again with Firefox 10 after upgrading our packages and to our biggest surprise, it worked! We've now got screen-shots!
I wrote a tutorial (updated March 27th 2012) that outlines installing a fresh headless Selenium environment with Magento TAF on Ubuntu Server. Hope that helps.
Yes, this is possible.
I made a init script selenium-headless that simplifies running the TAF on a server.
The TAF project is under development, this is just a preview was published. The team wanted to share ideas and give valuable benefits (automatic tests) for everyone, who is developing for Magento. TAF will have changes, it will be restructured and polished before the official release.
The docs are outdated a little, they give general overview of the tests usage. Currently TAF can be run on both Windows and Linux, and both Selenium 1 and 2 can be used to run them.
Summary
Yes, TAF can be run on Linux.
Do not mind documentation inconsistences
If tests do not run - re-check your configuration and Selenium installation.
P.S. And sorry for issues - this version is just a working draft. It will be improved, documentation will be proof-read and informative messages will be provided.
Thanks for using TAF, anyway :)

Resources