Support the "Find references" LSP request #2320
Labels
kind: enhancement
Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny
part: language server
Support for LSP in Dafny (server part; client is in ide-vscode repo)
status: planned
The team is planning to work on this in the near future
Milestone
Support this LSP request type: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_references
Prerequisites
Implementation hints
AST Nodes can implement
IHasUsages
which allow them to report which declarations their references resolved to. For example abreak;
statement reports a usage to the loop which it is breaking out of, and as such you can ctrl+click on a break to jump to the loop.An
IdentifierExpr
reports a usage to the variable which it points to.The IHasUsages ASTNodes are used to create a
SymbolTable
which already has methodsLocation? GetDeclaration(Position position)
andISet<Location> GetUsages(Position position)
, that can be and is available fromIdeState
. GetUsages can be used to implement "Find references"The text was updated successfully, but these errors were encountered: