vscode-ghc-simple
vscode-ghc-simple copied to clipboard
Support for "Go to Symbol in Workspace" (Ctrl+T) possible?
Status
- [ ] A workaround is available
- [ ] A fix is written
- [ ] A fix is released
- [ ] The fixed verison is on the marketplace.
- Version of vscode-ghc-simple: 0.0.10
- Version of VSCode: 1.31.1
- Version of Haskell-related tools: GHC 8.6.4, stack 1.9.3
Steps to reproduce
Once you've got an active Haskell workspace, you should be able to type Ctrl+T
and then begin entering the name of a function. A list of possible locations for that string should appear. You can select one, and jump there. It'd be awesome.
Ideally, the plugin would populate whatever index provider is in Code so that this (and lookup within current file, Ctrl+Shift+O
) would work.
Since vscode-ghc-simple is about being a wrapper over ghci, the first question would seem to be "can we extract/build a symbol list from ghci?". In so far as you were able to build a list for Ctrl+Space
completions it seems likely! Then we need to figure out how to inject that to $wherever that Code wants it so that the "Go to Symbol in Workspace..." functionality works.
AfC
Sorry for the lack of response. I honestly don't know how I managed to leave this issue without a reply for so long.
In so far as you were able to build a list for
Ctrl+Space
completions it seems likely!
I just used the :complete
command and fed it the (with some processing to try to improve the quality a bit) which is literally what you get pressing Tab at the prompt.
The closest thing to a symbol list is :ctags
or :etags
, which generates a tags
or TAGS
file for all the modules. I'll probably need to figure it out a way to generate these, since I apparently need to load every module in the workspace interpreted. Then I'll direct the output to some temporary directory and read from there.
I'll see what I can do.