How can I read line from terminal with vscode ext api - vscode-extensions

I am developing vscode extension.
This is an example of js code that runs command in vscode terminal:
commandsTerminal.sendText("some command");
And it works.
Now I want to read the result of this command into a variable.
How can I do it?

Related

Pipe console output of IntelliJ to a script

It is possible to pipe the console output of an intellij application to a bash command so I can pretty-print it on the console directly?
I know I can save the log output to a file, but I still want to keep it on the stout window only, but just parse it through a script.
Piping output is a feature of the terminal shell.
IntelliJ IDEA is not using a terminal to run your app, therefore it's not possible with the default Run/Debug configurations.
You could use an external tool that will open a command line shell and run your app there, but the shell has to be open in a separate window and it will not be possible to get the formatted output directly in the IDE.
There is a related feature request in YouTrack, but it's unlikely to be implemented soon.

How to run a karate script using power-shell command prompt

In power-shell window command prompt how to run a karate script. can you briefly explain the process on this.
Download the standalone JAR file: https://github.com/intuit/karate/tree/master/karate-netty#standalone-jar
Assuming you have the JAR and feature file in the same directory, you can trigger the script from the command prompt using the following command:
> karate.jar testscript.feature
Since you are new to stack overflow, please do read the following to best get help:
https://stackoverflow.com/help/how-to-ask
https://stackoverflow.com/help/someone-answers

MSys2 bash in VS Code starts separate window

I am able to set up in Workspace Settings for VS Code that my internal terminal should be a MSys2 bash shell. However the shell is started as an external shell, not internal. This does not happen for ex with git shell or ubuntu sub system shell
I have tried different settings found here:
How do I integrate MSYS2 shell into Visual studio code on Window?
No code to show, look at examples provided in the link to the other stackoverflow post.
I would expect the shell to be started as an internal shell to VS code
Append the user settings with the following JSON code:
// MSYS2
"terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["--login", "-i"],
"terminal.integrated.env.windows": {
"CHERE_INVOKING": "1"
},

Run IntelliJ code formatter from the command line

I am trying to run IntelliJ code formatter from command line.
I know that inspections can be run from CLI, however, they didn't provide the same for the source formatting (lame!).
Now, I started with CE edition of IntelliJ. Source code is on github.
However, since the code base is not small, I am having problems encapsulating the formatter.
Is there anyone who can point me in right direction and showing which classes to start with?
You can run the formatter from the terminal now. Like the code inspection.
https://confluence.jetbrains.com/display/IDEADEV/Command-Line+Source+Code+Formatter
/bin/format.sh [-h] [-r|-R] [-s|-settings settingsPath] [-m|-mask masks] [path1 [path2]...]
On Windows it's /bin/format.bat
To do this in the new versions of Intellij
You need to make sure the command line launcher is installed via the Jetbrain Toolbox.
Toolbox App Announcement
And run the following command from your shell:
idea format -s /path/to/your/style.xml /path/to/your/folder
I would recommend that you set the shell script location to /usr/local/bin/

Debugging individual protractor files with WebStorm

I want to be able to right click on an individual protractor test, click debug or run and have it execute. I can do this from the command line but I want to be able to debug with WebStorm to leverage the debugger.
By default when right clicking and debugging a file webstorm runs:
runnerw.exe "C:\Program Files\nodejs\node.exe"
--debug-brk=57698 --nolazy myspec.js
Can I have it run the following substituting the filename which I've selected:
node node_modules\protractor\bin\protractor protractor.dev.conf.js
--specs "/specs/myspec.js"
As a crappy work around I have the following:
This runs a single file but I need to edit the configuration each time to change the spec i'm testing.
protractor.dev.conf.js --specs "myproject/specs/test0043.js"
Does WebStorm allow you to dynamically substitute the test file?
Thanks
Can I do have it run the following substituting the file I've selected:
node node_modules\protractor\bin\protractor protractor.dev.conf.js
--specs "/specs/myspec.js"
and can you run the same not using WebStorm (in command line)? If you can, it's not a problem to do the same in webstorm
try ddescribe and iit
iit('should ...')
Will run only those tests marked with iit.
ddescribe will only run the tests under that suite(s)
Try the ddescriber plugin http://plugins.jetbrains.com/plugin/7233?pr=phpStorm