You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 19, 2024. It is now read-only.
Development of the extension has been moved into the main Flow repo here. As a result, this repo will be archived. All issues about the extension should be made in https://github.com/facebook/flow/issues.
This extension adds Flow support for VS Code. Flow is a static type checker, designed to find type errors in JavaScript programs. Follow the official guide to get started.
Want to help make Flow in VS Code really shine? If this is you, you can get set up for development easily.
Installation
Search for "Flow Language Support" in the VS Code extensions panel or install through the marketplace.
Setup
Make sure you have a .flowconfig file somewhere in your project.
Make sure you are able to run the flow command from the command line (or see Configuration to customize the command or use NPM packaged flow).
Set javascript.validate.enable option to falseor completely disable the built-in TypeScript extension for your project (see gif below):
If you install Flow via flow-bin (recommended), then we will by default try to use this installation of flow by looking for it in node_modules. This behavior can be disabled by setting the flow.useNPMPackagedFlow setting to false.
If you install Flow globally (for example, npm install -g flow-bin), make sure flow is available on your PATH. If neither are true, then a version bundled with this extension will be used, but this is discouraged as it may change over time.
Configuration
You can specify a configuration by amending the VS Code settings.json file. Access this through Preferences โ Settings. You must reload VS Code after installing this extension for these settings to take effect.
flow.useNPMPackagedFlow (default: true) allows using flow from your node_modules for VSCode.
Note: Plugin will look for node_modules in flowconfigDir and root of workspaceFolder
flow.pathToFlow (default: 'flow') Absolute path to flow binary.
{// You can use ${workspaceFolder} it will be replaced by workspaceFolder path"flow.pathToFlow": "${workspaceFolder}/node_modules/.bin/flow"// You can also use var ${flowconfigDir} it will be replaced by flowconfigDir path"flow.pathToFlow": "${flowconfigDir}/node_modules/.bin/flow"// or use some absolute path"flow.pathToFlow": "/home/test/some_path/flow"}
Note: Path is normalized and ".cmd" is added if needed.
flow.useBundledFlow (default: true) fallback to flow bundled with this plugin if nothing else works.
flow.showUncovered (default: false) If true will show uncovered code by default. You can also toggle it later by using command or clicking on status bar widget.
flow.coverageSeverity (default: 'info'): Type coverage diagnostic severity.
flow.lazyMode (default: null): to override the lazy mode. Prefer to set this in .flowconfig instead.
flow.stopFlowOnExit (default: true) stop flow server on exit from Project.
flow.useCodeSnippetOnFunctionSuggest (default: true) Complete functions with their parameter signature.
flow.enabled (default: true) you can disable flow for some Project for example.
Features
Supports multiple flowconfig and vscode multi-root workspaces
IntelliSense
Go to Definition / Peek Definition
Diagnostics (Errors, Warnings)
Hover type information
Toggle-able Code Coverage reports
Commands
Toggle display of uncovered areas: Show|hide coverage uncovered areas.
Restart Client: Restarts flow client.
Show Client Status: Show current status of client.
Log Client Debug Info: Log client debug info in output panel.
Show Output Channel: Opens plugin output pannel.
Known Issues
If you're having problems with syntax highlighting try Babel Javascript.
Debugger configuration
First, follow the instructions to setup your launch configuration file, launch.json.