Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Don't show 'Cannot find flow in PATH' error if there is no .flowconfig file in the project #195

Closed
ianwalter opened this issue Dec 22, 2017 · 5 comments

Comments

@ianwalter
Copy link

ianwalter commented Dec 22, 2017

Error:

[Flow] Cannot find flow in PATH. Try to install it by npm install flow-bin -g

I know most core users probably have flow installed on all of their devices, but if you are a casual user like me (I only use flow when I'm contributing to open source projects that use it) it's pretty annoying to see this error on a device in which I don't have or want flow installed. Since this error only seems to appear when I open a JavaScript file, I think a good compromise would be to only show this error if the project/workspace has a .flowconfig file.

@orta
Copy link
Contributor

orta commented Dec 22, 2017

There's discussion about why this won't work in #95 alas, if you can think of a good answer, I'm happy to get that in.

@ianwalter
Copy link
Author

ianwalter commented Dec 22, 2017

@orta I would move the conditional you added to checkFlow() so that window.showErrorMessage is only called if both conditions are true:

  1. A .flowconfig is not found in root
  2. Flow is not found

The users who have .flowconfig in a subdirectory are then not going to care about this change since this only affects whether the error message is displayed and they probably have flow installed globally anyway.

@jquense
Copy link

jquense commented Mar 20, 2018

There at least needs to be the option to turn this error off. It's so unhelpful to see this everytime i open vsCode regardless of language or project

@orta
Copy link
Contributor

orta commented Mar 20, 2018

Happy to take PRs on this 👍

@eyalch
Copy link

eyalch commented Sep 22, 2018

Not really a solution but if you really jump between a lot of project in VS Code than you probably should set flow.enabled to false in the global settings and enable it (set to true) in each relevant project's workspace settings.

Mayank1791989 added a commit to Mayank1791989/flow-for-vscode that referenced this issue Feb 16, 2019
Client (closes flow#302, flow#304, flow#253, flow#228, flow#201, flow#195, flow#189, flow#184, flow#165, flow#81)
- add multi flowconfig support
- add vscode multi-root workspace support
- client is now lazily created if flowconfig found
- fix document selector.

New implementation will handle following cases
- Single workspace with multiple flowconfig
- Multiple workspace with multiple flowconfig

Get Flow-Bin
- improve|fix logic to find flow-bin (fixes flow#282, flow#240, flow#209)
- fix flow bundled with plugin not working
  issue: we are using .bin/flow but vscode never includes .bin in plugin package
- add logs while finding flow-bin to debug issues
- plugin now doesn't check for node (closes flow#290)
- pathToFlow: value is normalized and .cmd is added so same value can
be used for linux, osx & win

Error handling (closes flow#200)
- [feat] improve error handling.
- [feat] Show action in errors so that user can recover from error
  without restarting vscode

Commands
- [feat] Add commands
  - Toggle coverage
  - Show client status
  - Restart Client
  - Log Client Debug Info
  - Show output channel

Status Widget
Include more info in status widget to help user know what this plugin is using
- [feat] include flow version
- [feat] add flow info section in widget tooltip which includes
  - path to .flowconfig
  - flow version
  - path to "flow" binary

Settings
- flow.coverageSeverity to control type coverage diagnostic severity
- flow.useBundledFlow control use of flow bundled with this plugin
- flow.trace.server log communication between vscode and flow lsp
- flow.logLevel control log level of plugin logs
Mayank1791989 added a commit to Mayank1791989/flow-for-vscode that referenced this issue Feb 18, 2019
Client (closes flow#302, flow#308, flow#253, flow#228, flow#201, flow#195, flow#189, flow#184, flow#165, flow#81)
- add multi flowconfig support
- add vscode multi-root workspace support
- client is now lazily created if flowconfig found
- fix document selector.

New implementation will handle following cases
- Single workspace with multiple flowconfig
- Multiple workspace with multiple flowconfig

Get Flow-Bin
- improve|fix logic to find flow-bin (fixes flow#282, flow#240, flow#209)
- fix flow bundled with plugin not working
  issue: we are using .bin/flow but vscode never includes .bin in plugin package
- add logs while finding flow-bin to debug issues
- plugin now doesn't check for node (closes flow#290)
- pathToFlow: value is normalized and .cmd is added so same value can
be used for linux, osx & win

Error handling (closes flow#200)
- [feat] improve error handling.
- [feat] Show action in errors so that user can recover from error
  without restarting vscode

Commands
- [feat] Add commands
  - Toggle coverage
  - Show client status
  - Restart Client
  - Log Client Debug Info
  - Show output channel

Status Widget
Include more info in status widget to help user know what this plugin is using
- [feat] include flow version
- [feat] add flow info section in widget tooltip which includes
  - path to .flowconfig
  - flow version
  - path to "flow" binary

Settings
- flow.coverageSeverity to control type coverage diagnostic severity
- flow.useBundledFlow control use of flow bundled with this plugin
- flow.trace.server log communication between vscode and flow lsp
- flow.logLevel control log level of plugin logs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants