Skip to content
This repository has been archived by the owner on Jul 16, 2019. It is now read-only.

Autocomplete/IntelliSense works only under very specific circumstances #74

Open
lukebarton opened this issue Apr 4, 2018 · 9 comments

Comments

@lukebarton
Copy link

Originally posted in flow-for-vscode but I imagine the issue actually lies with the language server since the behaviour is identical in Atom, so raising here retrospectively.

flow-autocomplete-issue

Maybe I'm doing something completely wrong but I've been trying to get flow working nicely in VSCode for several hours. I've concluded that IntelliSense with flow has some real issues and recorded this gif showing two ways I believe it's broken:

  1. Chaining causes IntelliSense to stop working.
  2. Trying to use it preceding an anonymous function without a semicolon somewhere between causes IntelliSense to stop working.

These issues may be related. Needless to say, it's making Flow pretty difficult to work with.

flow 0.69.0
flow-for-vscode 0.8.0

@namuol
Copy link

namuol commented Apr 28, 2018

@lukebarton
Copy link
Author

lukebarton commented Apr 29, 2018 via email

@namuol
Copy link

namuol commented Apr 30, 2018

@lukebarton Hmm -- technically flow-language-server does implement autocompletion, as far as I can tell:

https://github.com/flowtype/flow-language-server/blob/daa83c3bc5d6323f0e1ce17bfd38c04ad43f52b9/packages/flow-language-server/src/Completion.js#L43-L46

Try disabling @builtin typescript in VSCode and enabling useLSP, like so.

After doing that, give it another try -- sometimes the issue is just that Flow itself doesn't know enough about the type 🤞 Good luck!

@lukebarton
Copy link
Author

lukebarton commented May 1, 2018 via email

@namuol
Copy link

namuol commented May 1, 2018

@lukebarton If you're using LSP and autocomplete isn't working, my guess would be that Flow actually doesn't know enough about the type of the symbol you're interacting with to provide you with completion features -- try hovering over the symbol to see what Flow reports its type as.

Otherwise, it may indeed be a bug with the LSP implementation -- without more detailed information it'll be hard for us to know; @wbinnssmith any recommendations on how to provide debugging information to bug reports like this one?

@lukebarton
Copy link
Author

lukebarton commented May 1, 2018

  1. It works, just in limited situations.
  2. I posted a gif in the original post showing what happens.
  3. You can see all of the code.
  4. It was the first project I started in VS Code. (Clean install) I disabled the TypeScript plugin.
  5. I also tried it in Atom. Exactly the same behaviour.

If that's just how flow works then that's okay with me

@namuol
Copy link

namuol commented May 1, 2018

I posted a gif in the original post showing what happens.

Yeah I just wasn't sure if that gif was still the exact behavior, as you mentioned you may have posted that while not using useLSP:

I think I jumped the gun a bit - I didn't realise that the language server wasn't the default implementation yet.

Didn't mean to belittle your experience! The behavior in the gif is really confusing/frustrating, for sure. I'm just trying to clarify so we can track down the issue with precision -- Thanks! 🙇

@lukebarton
Copy link
Author

lukebarton commented May 1, 2018

So I tried with LSP on and off, no difference. On/Off/VS Code/Atom all the same. It's probably a flow core thing.

Sorry for replying with a numbered list. It's been a long day and I didn't want to write the fluffy nice stuff you usually have to - there's no beef/ill feeling 👍

@namuol
Copy link

namuol commented May 2, 2018

Sorry for replying with a numbered list.

No worries 😂 Thanks for replying 👍

So I tried with LSP on and off, no difference. On/Off/VS Code/Atom all the same.

It's probably a flow core thing.

Maybe, but the behavior in that gif still looks really odd. When you find the time, would you mind recording the same sequences of behaviors with LSP on in VSCode? It may be some combination of both Flow's core "type of symbol" reporting that can be addressed in the LSP integration 🤔

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

2 participants