tptee / FlowIDE

IDE-caliber support for Flow in Sublime Text
MIT License
38 stars 6 forks source link

Needs way to configure Flow binary #1

Closed wldcordeiro closed 8 years ago

wldcordeiro commented 8 years ago

I use flow-bin within my projects and have Node installed via nvm and when I try using this plugin I get the following error output.

Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 320, in on_selection_modified_async
    callback.on_selection_modified_async(v)
  File "flow-ide in /home/wldcordeiro/.config/sublime-text-3/Installed Packages/FlowIDE.sublime-package", line 179, in on_selection_modified_async
  File "flow-ide in /home/wldcordeiro/.config/sublime-text-3/Installed Packages/FlowIDE.sublime-package", line 45, in parse_cli_dependencies
  File "flow-ide in /home/wldcordeiro/.config/sublime-text-3/Installed Packages/FlowIDE.sublime-package", line 17, in find_flow_config
  File "./python3.3/posixpath.py", line 151, in dirname
AttributeError: 'NoneType' object has no attribute 'rfind'

I haven't looked into your plugin source too much yet but I'm assuming it's not finding my configuration file or Flow. I have a .flowconfig in my project though. So I'm at a loss for what the issue may be.

tptee commented 8 years ago

Sorry about that! The previous (undocumented) requirement was for the flow binary to be in your PATH. I just released v1.1.0 which adds some new settings to deal with this:

flow_path (string): the path to your flow binary. use_npm_flow (boolean): if true, uses the binary from the npm flow-bin package in the node_modules of your current file's root directory. Using flow-bin's binary will slow down editing features because it is wrapped in a Node script and starts an interpreter on each run.

use_npm_flow will let you use the binary provided in your project's flow-bin package, and it should work automatically. I'd recommend against using this, since flow-bin wraps a Node script around the binary, starting an interpreter on each run and therefore slowing down editing features. I'd suggest installing a normal flow binary and dropping it in your PATH for the best performance.

glenjamin commented 8 years ago

I've just tried to start using this, but weirdly the plugins settings option isn't showing up in the menu.

Is there some other way to configure this?

tptee commented 8 years ago

Hi @glenjamin! I'm seeing the same issue. I'll figure out what I'm missing and cut a release as soon as I can!

tptee commented 8 years ago

v1.1.2 adds FlowIDE's plugin settings to the Package Settings menu, so you should be set! It'll take about an hour for Package Control to pick up the release.