grain icon indicating copy to clipboard operation
grain copied to clipboard

LSP: Support for go to definition navigation

Open sanathusk opened this issue 1 year ago • 3 comments

Currently cmd clicking on function invocation does not go to function definition, similarly for module name as well. We could implement go to defination functionality for better developer experience

sanathusk avatar Jul 15 '22 19:07 sanathusk

Yes! This is definitely something we need.

Most of these features are defined in the Language Server Protocol specification, such as https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_definition - so we should open them on the main Grain repo. This plugins repo doesn't do much anymore (other than defer to the CLI command). I'll move this over to the main repo

phated avatar Jul 15 '22 19:07 phated

This is definitely planned, and I had a proof of concept built, but we need to make some tweaks to the compiler output to make the locations available to jump to without bloating the output for normal compilation.

marcusroberts avatar Jul 15 '22 19:07 marcusroberts

Will remember to open the issue on main repo next time.Thank you 🙏

sanathusk avatar Jul 16 '22 02:07 sanathusk