Flow in JetBrains/IntelliJ IDEA - intellij-idea

It seems like JetBrains supports Flow type checker but I'm not seeing the flow error in the IDE.
Is there a way to enable it?

Flow Type Checker is not yet supported, please follow WEB-14254 for updates.
Idea just supports Flow syntax (static typing). See http://blog.jetbrains.com/webstorm/2015/09/webstorm-11-eap-142-5255/

I've put together an experimental plugin integrating Flow error reports into IDEA/WebStorm as error annotations:
https://github.com/dsilva/webstorm-plugin-flow-typecheck/releases

#lena is correct.
As an aside, I run flow through the npm panel. As long as flow is a script in your package.json, I run in by right-clicking on package.json and Show npm scripts. Then just double click on flow or re-run it as needed in the Run panel.

As of Nov 2016 Jetbrains Webstorm / IntelliJ IDEA now supports Flow:
https://blog.jetbrains.com/webstorm/2016/11/using-flow-in-webstorm/
In Settings -> Languages & Frameworks -> Javascript select Flow

Running Flow Server in WebStorm
check the version of your flow-bin, only 0.59.0 works with WebStorm.
run this command to install flow-bin globally:
npm i -g flow-bin#0.59.0
Adding flow config file to your project
npm flow init
finding node-modules global path : copy this path , We will use it in WebStorm settings.
npm list -g
WebStorm Setting :
Go to here :
File > Settings > languages and Frameworks > Javascript
Select flow in drop-down menu.
In Flow executable paste global path of flow-bin (local path doesn't work). and with three dots button select the proper folder for your operating system.
In Use-Flow-server-for section tick Type checking box and then hit Apply button.
Find this section in settings :
Editor > Inspections > Javascript > Flow Type Checker
ensure Flow errors check box is active
Hit Apply and Ok
After that flow server should be started when you open project in Webstorm.
Don't forget to put
// #flow
at top of your files.

Related

Sigasi in Eclipse

I have just installed the Sigasi Studio pluginin Eclipse (version: Eclipse IDE 2018-12). When I try to launch it,to make a new VHDL file, I get the following:
The selected wizard could not be started. org/eclipse/lsp4j/Range
(occurred in com.sigasi.hdt.vhdl.ui.VhdlExecutableExtensionFactory)
org/eclipse/lsp4j/Range
How I could solve it, please?
Thank you in advance.
Thanks to the Sigasi support, I was able to solve the problem. They wrote me:
The lsp4j plugin version is to recent for the xtext version that ships
with Sigasi Studio 4.2. This issue has been resolved in the preview
channel of release 4.3. Therefore - if you wish to use the plugin
version of Sigasi Studio - I recommend to install the 4.3 preview
following the steps explained on
http://insights.sigasi.com/tech/preview.html.
That's all. Now, I would like to configure Sigasi with GHDL (as a compiler, when I run the project) and GTKWAVE (ad a waves viewer). How can I do that?
Thanks in advance.
SIGASI + GHDL + GTKWAVE (all in one)
It is very powerful combo that you can set up. ATTENTION i use macOS 10.13.6:
Step 1
Make sure you have both installed GHDL and GTKWAVE typing
$ which gtkwave
/usr/local/bin/gtkwave
$ which ghdl
/usr/local/bin/ghdl
Step 2
Open Sigasi an make new Project and create an additional compile.sh file with:
#!/bin/sh
PROJECT_NAME="PWM_Generator"
PROJECT_NAME_TB="PWM_Generator_tb"
WORKING_DIR="/Users/imeksbank/Dropbox/UMHDL"
/usr/local/bin/ghdl -a --workdir=$WORKING_DIR/work.ghdl $WORKING_DIR/$PROJECT_NAME/$PROJECT_NAME.vhd;
/usr/local/bin/ghdl -a --workdir=$WORKING_DIR/work.ghdl $WORKING_DIR/$PROJECT_NAME/$PROJECT_NAME_TB.vhd;
/usr/local/bin/ghdl -e --workdir=$WORKING_DIR/work.ghdl $PROJECT_NAME_TB;
/usr/local/bin/ghdl -r --workdir=$WORKING_DIR/work.ghdl $PROJECT_NAME_TB --vcd=$WORKING_DIR/$PROJECT_NAME/simulation.vcd;
now, be aware, for each project you create your own variables like
PROJECT_NAME
PROJECT_NAME_TB
WORKING_DIR
I use always Dropbox for such approach because then i can access via Windows as well.
And of course, there is a possibility to create custom variables in Sigasi -> External Tool Configurator -> Program -> compile_sh -> environment to pass them to make compile.sh independent. Here you have to deal with it by yourself =)
Step 3 .
Set up you External Tools Configurations to let shell script be executed by Sigasi Studio and create the .vcd file for gtkwave:
Click on currently created Project (in my case it is the PWM_Generator).
After that click on Run -> External Tools -> External Tools Configurations ....
Then go to the left sidebar and under Program create your own anchor like compile_sh.
Finally you have your route :
Program
--compile_sh
And now extend this anchor by a custom created shell script :
Main->Location gets ${workspace_loc:/PWM_Generator/compile.sh}
Main->Working Directory gets ${workspace_loc:/PWM_Generator}
Click Apply and Run and that's it !!! After this you can program VHDL / Verilog and compile via Run -> External Tools -> compile_sh having created .vcd. In your project appears the gtkwave file and there just double click and it starts. =)

What text editors does --dev reload with work

I'm following Odoo's documentation to use the --dev all parameter when I run odoo-bin, in order to have Python models get updated when I change the source code without me having to restart the server. According to the documentation, the reload flag (which is part of all) doesn't work with some text editors. I've been using Sublime Text, and that doesn't seem to work because my model changes don't take effect until I restart the server. Is there a good, commonly used text editor which does work with the reload parameter, or is there a list of text editors which work with it?
If you're running Odoo from the command line via a standard ./odoo-bin --dev reload command then you should not have any issues as long as you have the lib dependencies setup.
Make sure to monitor your log for errors. It requires the watchdog library to be installed via pip install watchdog. Take a look at (currently line 943) of the core files https://github.com/odoo/odoo/blob/10.0/odoo/service/server.py to see how dev reload works:
def start(preload=None, stop=False):
...
watcher = None
if 'reload' in config['dev_mode']:
if watchdog:
watcher = FSWatcher()
watcher.start()
else:
_logger.warning("'watchdog' module not installed. Code autoreload feature is disabled")
if 'werkzeug' in config['dev_mode']:
server.app = DebuggedApplication(server.app, evalex=True)
I am not completely sure, but after doing a quick search on the text editor that I have been primarily using (Atom developed by GitHub), I believe it may have what you're looking for.
Have fun with your future endeavors. I hope my answer helps.
Since odoo uses werkzeug server,you can just use the command line argument to start the server, and everything will be taken care by the server.
./openerp-server --auto-reload
this will restart the server whenever .py file is modified.

how can I install "elm-light" on windows?

elm-light looks like a great plugin for elm in the LightTable editor, but I can't make it work properly on Windows. When I try to establish a connection, I get this error : Path must be a string. Received null.
Please help...
"Path must be a string" should already be fixed in elm-light-0.42
AST
Auto-completions only starts working once you have connected to an Elm project. You can force "suto.connection", through various commands (Lint, toggle docs etc). So if you hit "ctrl-d" on a symbol when you aren't connected, it will connect for you. Another option is to add the Lint command to the save operation in Light Table. Again see Useful configurations
-- https://rundis.gitbooks.io/elm-light-guide/content/chapter1.html
After opening elm file in Light Table, you can see at the status: AST not connected. That means elm-light doesn't run yet.
You have to connect manually either by running ctrl+space > ELM: Load/reload project AST or better by mapping this action to save.
To do this, run ctrl-space > Settings: User keymap. Add line [:editor.elm "ctrl-s" :save :elm-format :elm.lint] before last ] so it looks like this:
[
;; ...
[:editor.elm "ctrl-s" :save :elm-format :elm.lint]
]
Above mapping to ctrl-s will also format and lint your file.
One more thing. If you type for example import Dict as Dict exposing (, AST will report error. For that we need to automatic brackets close. To do that, run ctrl-space > Settings: User behaviors and add line [:editor :lt.objs.editor/autoclose-brackets], so that the file looks like that:
[
;; ...
[:editor :lt.objs.editor/autoclose-brackets]
]
Avoid spaces in the path to the elm-platform
type echo %path% in a Windows command prompt to check the Elm path
uninstall and reinstall elm in another folder if necessary
Avoid spaces in the path to LightTable
move the LightTable folder if necessary
uninstall and reinstall the elm plugin in the new location
Install elm-oracle
execute npm install elm-oracle in a Windows command prompt to get auto-complete to work.
Install elm-format
Configure keymaps
use ctrl- (Windows) instead of cmd (iOS) in the keychords

Ionic is not recognized in `command prompt`

I have installed Ionic v2 using npm install -g ionic#alpha.
Then it has successfully installed. But i cannot use the ionic command.
The install progress may not add the path to the System environment.
Try the following step:
Navigate to : C:\Users\[User]\AppData\Roaming\npm\ionic.cmd Check if the file ionic.cmd is existed.
Open up the System Environment from:
Control Panel -> System -> Advanced system settings -> Select Advance tab
Click on Environment Variables...
Seek for Path variable in the System variables section.
Double click and add the path C:\Users\[User]\AppData\Roaming\npm\ionic.cmd at the end of that string.
OK -> OK -> OK
Restart the command line and try again with ionic command.

pub serve not updating web unless I restart it

In IntelliJ there's a tab that says "Pub Serve", when I hit Ctrl + Shift + R, I can see plenty of output on the Pub Serve output terminal and it launches the Chromium that came with the Dart Editor displaying my web application.
Now if I make a change to any of the dart files or html files or even index.html and refresh in Chromium, I don't see the changes until I click the stop button on Pub Serve.
I've installed the JetBrains plugin in Chromium to see if it makes a difference, non whatsoever.
Running pub serve from command line does exactly the same, until you kill it and re-run pub serve, your changes doesn't become visible.
Any idea on how I can have pub serve automatically reload upon code changes?
Update:
I think this could be related: https://code.google.com/p/dart/issues/detail?id=21402
It seems the problem is caused by Safe Write, there's a temp workaround:
WEB-13739 Pub Serve on Mac OS doesn't notice that file contents
changed, so refresh in browser shows old cached contents In DartEditor
you can work like this:
Start debug (this will start pub serve which takes a while).
Edit template in polymer element
Save (Now DartEditor does something to recompile the polymer template, AFAIK it does not do a full restart of pub serve because it
is faster).
Refresh browser, you see the change in the template.
But in Webstorm 9 EAP October 8 version, this workflow is not
possible. I have to kill pub serve and restart in order to see my
change in the polymer component's template. I would like Webstorm to
work the same as DartEdtior so I can have the same save/refresh
development cycle.
Workaround: uncheck 'safe write' mode in Preferences | Appearance &
Behavior | System Settings and vote for the corresponding issue in the
Google issue tracker.
https://youtrack.jetbrains.com/issue/WEB-13739
This workaround is relevant to IntelliJ Ultimate as well.
Vote for bug fix here:
https://code.google.com/p/dart/issues/detail?id=21402
Update
Bug was fixed:
This should be working now. The underlying issue was in the watcher
package, fixed here:
https://codereview.chromium.org/861313006/
Then pulled into the repo for pub and tested here:
https://codereview.chromium.org/801943005/
https://codereview.chromium.org/870703003/
Thanks Bob!