Implement LSP `textDocument/definition`
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 144
Description
Implement the `textDocument/definition` endpoint for the F# LSP server. This endpoint will provide the "go to definition" functionality.
The LSP specification for this endpoint can be found under [this link](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_definition).
The implementation should use the F# Compiler Service API: `src/Compiler/Service/service.fsi`
The current implementation of this feature can serve as a reference point. It is primarily implemented in the VS integration layer, specifically in this file `vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs`. The main idea is to parse and check the source file and then use the GetDefinitionLocation method of the checker's result.
Other LSP endpoints in the F# LSP server can be found here for reference: `src/FSharp.Compiler.LanguageServer/Handlers/LanguageFeaturesHandler.fs`. F# LSP server is using Common Language Server Protocol Framework which contains useful types and methods for handling LSP requests. It's implementation can be found in the Roslyn repo, specifically https://github.com/dotnet/roslyn/tree/main/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework
Contributor guide
Assessment
This issue has not been assessed yet.