For any given symbol usage, we want to be able to jump to the point in our code where the symbol was defined.
LSP API Methods
there is also potential overlap with the textDocument/declaration method to be explored as part of the implementation of this feature.
Variations of Definition Lookups
Variables
x: uint256
@external
def foo() -> uint256:
return self.x
Running Go To Definition on the usage of self.x within foo() should jump the cursor to the first line, where x is declared/defined.
Functions
x: uint256
@external
def foo() -> uint256:
return self.bar()
@internal
def bar() -> uint256:
return self.x
Running Go To Definition on the usage of self.bar() within foo() should jump the cursor to the line where the function bar() is declared
For any given symbol usage, we want to be able to jump to the point in our code where the symbol was defined.
LSP API Methods
textDocument/definitionthere is also potential overlap with the
textDocument/declarationmethod to be explored as part of the implementation of this feature.Variations of Definition Lookups
Variables
Running
Go To Definitionon the usage ofself.xwithinfoo()should jump the cursor to the first line, wherexis declared/defined.Functions
Running
Go To Definitionon the usage ofself.bar()withinfoo()should jump the cursor to the line where the functionbar()is declared