flow-for-vscode

Flow for Visual Studio Code

Github星跟蹤圖

Flow for Visual Studio Code

Backers on Open Collective
Sponsors on Open Collective

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 false or completely disable the built-in TypeScript extension for your project (see gif below):

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 affect.

  • flow.useNPMPackagedFlow (default: true) allows using flow from your node_modules for VSCode. Warning: Setting to true is a security risk. When you open a project we will immediately run code contained within it.

    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.

    Note: Only supported when useLSP: true.

  • flow.lazyMode (default: null): to support flow lazyMode

    Note: Only supported when useLSP: true.

  • flow.stopFlowOnExit (default: true) stop flow server on exit from Project.

  • flow.useCodeSnippetOnFunctionSuggest (default: true) Complete functions with their parameter signature.

  • flow.runOnEdit (default: true) If true will run flow on every edit, otherwise will run only when changes are saved.

    Note: Partial support when useLSP: true will only show syntax errors.

  • flow.showStatus (default: true) If true will display a spinner in the status-bar while flow is type checking.

    Note: Not supported when useLSP: true. In lsp mode you can use status-bar widget to view status.

  • flow.runOnAllFiles (default: false) Run Flow on all files, No need to put //@flow comment on top of files.

    Note: Not supported when useLSP: true. You can use flowconfig option all.

  • flow.useLSP (default: true) Turn off to switch from the official Flow Language Server implementation to talking directly to flow.

    Note: useLSP: true requires flow >= 0.75

  • flow.enabled (default: true) you can disable flow for some Project for example.

Features

  • Supports multiple flowconfig and vscode multi-root workspaces (required useLSP: true)
  • IntelliSense
  • Go to Definition / Peek Definition
  • Diagnostics (Errors, Warnings)
  • Hover type information
  • Rename (required useLSP: true)
  • 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

Debugger configuration

First, follow the instructions to setup your launch configuration file, launch.json.

To use flow-remove-types:

  • Follow the flow-remove-type Quick Start.
  • In launch.json, add "runtimeArgs": ["-r", "flow-remove-types/register"] to the "launch" configuration.

To use Babel:

  • Follow the Babel Quick Start.
  • Install babel-register.
  • In .babelrc, add "retainLines": true.
  • In launch.json, add "runtimeArgs": ["-r", "babel-register"] to the "launch" configuration.

About

  • Lsp mode is built using flow lsp (flow official language-server-protocol implementation)
  • Non lsp mode is built on top of Nuclide's Flow support.

Contributing

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! ? [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]










License

See here

主要指標

概覽
名稱與所有者EYHN/hexo-theme-one
主編程語言TypeScript
編程語言JavaScript (語言數: 4)
平台
許可證GNU General Public License v2.0
所有者活动
創建於2017-02-01 07:07:46
推送於2017-05-26 08:08:40
最后一次提交2017-04-26 22:19:15
發布數5
最新版本名稱1.1.3 (發布於 )
第一版名稱1.0.0 (發布於 )
用户参与
星數519
關注者數24
派生數56
提交數148
已啟用問題?
問題數32
打開的問題數15
拉請求數22
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?