mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Implement "go to definition"
This commit is contained in:
parent
e087aeb44f
commit
62f74178f7
7 changed files with 64 additions and 4 deletions
|
@ -169,3 +169,18 @@ class DocumentSymbol:
|
|||
selection_range: Range
|
||||
detail: T.Optional[str] = None
|
||||
children: T.List["DocumentSymbol"] = field(default_factory=list)
|
||||
|
||||
|
||||
@dataclass
|
||||
class LocationLink:
|
||||
origin_selection_range: Range
|
||||
target_range: Range
|
||||
target_selection_range: Range
|
||||
|
||||
def to_json(self, target_uri: str):
|
||||
return {
|
||||
"originSelectionRange": self.origin_selection_range.to_json(),
|
||||
"targetUri": target_uri,
|
||||
"targetRange": self.target_range.to_json(),
|
||||
"targetSelectionRange": self.target_selection_range.to_json(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue