I don't know why, but when installing the vs code Flow Language Support extension, doesn't work the vs code behavior to 'go to definition' when I do 'command + click'. Instead, it does the 'peek definition'.
Likely because VS Code got two results for it, and the peek is so you can pick. You'd need to disable the JS/TS one.
What do you mean by disabling the JS/TS one? Sorry but I don't know what it is.
That's a duplicate of #204.
I can confirm this is happening. I don't think there is any settings in VSCode to "disable the JS/TS one" so I'm not sure to understand what's the suggested solution for this.
It鈥檚 in the readme, something like JavaScript.validate = false
Ah, yeah I understand what you meant. Well, this is with it already set to false.
Actually after further tests, I don't think this issue is related to flow-for-vscode but more to vscode it self.
@christiandebarrio can you confirm this is working when you have the plugin disabled and not working when it's enabled?
From my tests the plugin doesn't actually really affect the Go to definition.
@orta, I have the setup "javascript.validate.enable": false, and it doesn't fix the problem.
And I can confirm that it works fine when I disable the vs code plugin Flow Language Support extension and doesn't when it's enabled. I've just tested again @Grsmto.
You could try the vscode insider's build and see if https://github.com/flowtype/flow-for-vscode/issues/211 fixes this
Disabling the built in TypeScript plugin as per #211 fixed this problem for me.
VSCode config:
"javascript.validate.enable": false
In my case disable JS validate wasn't enough.
CMD+ click was pointing to Typescript definition files.
I realized that VSCode was redirecting to definition files at this location.
~/Library/caches/typescript
I opted for delete the cache folder, and flow types started to work perfectly with CMD+Click
Cheers
With flow extension disabled:
With flow extension enabled & typescript builtin enabled:
With flow extension enabled & typescript builtin disabled:
i think that confirms that the problem is the flow plugin, right?
@diegolaciar I am having the exact same issue, and as you say say deleting the typescript cache fixes the problem.
HOWEVER typescript keeps re-creating the cache, so the problem comes back.
Do you know a way to disable the cache?
@fredemmott
You are right, keeps re-creating the cache. I couldn't find a solution to this issue.
Now I' m on other project without flow.
Disabling Typescript Language Features is not an acceptable solution.
With TS Features disbaled, the peek view does not pop up anymore, but the "navigate to" feature is severly weakened.
With TS features disabled:
import {individualImport} from './module'.flow-for-vscode isn't really great because it forces you to compromise between two different broken nagivation behaviors: annoying peek popup versus poor navigation.
Are most people using flow just accepting the broken behavior or are they not using vscode?
I use WebStorm, but it's not great for making your own plugins, and it would be great if I could use vscode for that, but the user experience is just really poor.
I only understand a little, but it sounds like flow is providing vscode a destination for "navigate to" but typescript is also providing another destination, so the peek view pops up because of multiple destinations. Is it possible to prevent flow from providing a destination and only use typescript?
Is it possible to prevent flow from providing a destination and only use typescript?
That's an interesting approach, I don't think anyone has tried that. You're welcome to give it a shot in a PR. FWIW, there isn't really anyone actively working on improving flow + vscode support (I make sure this extension continues to work, but I moved to typescript ~2 years ago) - maybe for more folks this is good enough.
I think flow is great and I like it better than typescript for general typing because it has a more intuitive toolset and produces code which IMO is easier to read than TS. However, I think part of the reason for lack of adoption is vscode's bias toward typescript and vscode's popularity.
I've moved to atom instead for it's hackability and working flowtype support via the flow-ide plugin. However, I would like to come back to vscode since it does seem more lightweight than atom.
I'm unfamiliar with how language features work with vscode, so it might take me some time to look at it, but I'll try when I have time.
I've just disabled Typescript Language Features and "Go to definition" start working fine,
but looks like VSCode used TS features for things like "Rename Symbol" (renames also all usages in project scope). So now when I disabled ts I cannot use that renaming feature, and I only have option to "Change All Occurrences" which is not the same as it renames locally (in file scope):

Is there any possibility to provide similar functionality like 'Rename Symbol' by flow-for-vscode extension?
@AVykhrystyuk : I think they still didn't find the solution for this.
My temporary solution is Ctrl/Cmd + Click, then select the 2nd definition in the popup
Still no accurate solution for this ?
Most helpful comment
With flow extension disabled:
With flow extension enabled & typescript builtin enabled:
With flow extension enabled & typescript builtin disabled:
i think that confirms that the problem is the flow plugin, right?