Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Summary] Flowtype / VSCode pain points and potential improvements #7918

Open
3 of 7 tasks
vicapow opened this issue Jul 10, 2019 · 4 comments
Open
3 of 7 tasks

[Summary] Flowtype / VSCode pain points and potential improvements #7918

vicapow opened this issue Jul 10, 2019 · 4 comments

Comments

@vicapow
Copy link
Contributor

vicapow commented Jul 10, 2019

Flowtype VSCode pain points and potential improvements

A lot of engineers have started using VSCode for day to day development. A good portion of these engineers are coming from a background of TypeScript which has very good built in support within VSCode. This is the case for a few reasons:

  • VSCode comes with a TypeScript extension built into and bundled with the editor. Users do not have to configure or update this plugin. It “just works”.
  • TypeScript’s VSCode editor support is implemented with tsserver and the TypeScript built in extension instead of using the open Language Server Protocol developed by Microsoft. This means some features TypeScript supports today just aren’t possible without also updating the Language Server Protocol.
  • TypeScript’s API is more stable than Flow’s. Flow is still a minor version (0.x) and the project has historically not been shy about that fact.
  • Facebook (as far as I know) mostly only supports the Nuclide IDE internally through the Language Server Protocol. This may mean in some cases Flow + VSCode issues might not always be high priority or visible to the Flow team, especially if they're unique LSP + VSCode behavior.
  • It’s not always easy or straightforward to configure Flow in VSCode. For example, it may be that the local node_modules Flow server (flow-bin) isn’t found and the VSCode plugin falls back to using its own version of Flow. We've had one issue in the past for example were a project was not configured to point to the local flow-bin server. When the Flow-for-vscode plugin auto updated, the user started to get errors in VSCode they weren't seeing from the command line. This is easily fixed when you know the cause but otherwise, you loose confidence in the tooling.

Collecting ideas for IDE improvements (will continue to update this)

- [] Add “codelens” support #7890

  • Decided against this for now. The output ended up being too verbose to be helpful. Could consider adding this behind a config flag?
@vicapow vicapow changed the title [Summary] Flowtype / VSCode pain points and potential improvements summary [Summary] Flowtype / VSCode pain points and potential improvements Jul 10, 2019
@Xiot
Copy link

Xiot commented Jul 12, 2019

A couple more improvements
image
Better syntax highlighting when using generics (currently using the Babel JavaScript "language")

Cmd + clicking on the import path, should jump to the file. Currently only cmd + click on the imported names works

@mroch
Copy link
Contributor

mroch commented Jul 15, 2019

Awesome, thanks for starting this list! This is an area that we're going to be investing in over the next couple of months, so the list of issues (please tag them with LSP!) and their relative priority will help me out a lot.

We don't use flow-for-vscode internally but vscode is still very important to us. You are correct that we've made Nuclide communicate with Flow solely over the LSP. All of our other editor integration is deprecated in favor of the LSP, and I hope we remove the legacy stuff ASAP so that we can focus (what were you saying about an unstable api? 😂).

Accurately implementing the LSP is our priority. In my experience so far, there aren't many LSP + vscode bugs as it's the reference LSP implementation. So it's a matter of us returning poor LSP responses, which so far have impacted Nuclide and VSCode equally -- e.g. returning bad ranges made them both filter out autocomplete results.

@goodmind
Copy link
Contributor

@mroch maybe also check autocomplete and type-at-pos labels

@goodmind
Copy link
Contributor

goodmind commented Aug 4, 2019

@mroch do you have any news about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants