mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Add document outline
This commit is contained in:
parent
950b141d26
commit
e087aeb44f
24 changed files with 469 additions and 28 deletions
|
@ -20,9 +20,10 @@
|
|||
|
||||
import enum
|
||||
import typing as T
|
||||
from dataclasses import dataclass
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
from .errors import *
|
||||
from .tokenizer import Range
|
||||
from .utils import *
|
||||
|
||||
|
||||
|
@ -129,3 +130,42 @@ class SemanticToken:
|
|||
start: int
|
||||
end: int
|
||||
type: SemanticTokenType
|
||||
|
||||
|
||||
class SymbolKind(enum.IntEnum):
|
||||
File = 1
|
||||
Module = 2
|
||||
Namespace = 3
|
||||
Package = 4
|
||||
Class = 5
|
||||
Method = 6
|
||||
Property = 7
|
||||
Field = 8
|
||||
Constructor = 9
|
||||
Enum = 10
|
||||
Interface = 11
|
||||
Function = 12
|
||||
Variable = 13
|
||||
Constant = 14
|
||||
String = 15
|
||||
Number = 16
|
||||
Boolean = 17
|
||||
Array = 18
|
||||
Object = 19
|
||||
Key = 20
|
||||
Null = 21
|
||||
EnumMember = 22
|
||||
Struct = 23
|
||||
Event = 24
|
||||
Operator = 25
|
||||
TypeParameter = 26
|
||||
|
||||
|
||||
@dataclass
|
||||
class DocumentSymbol:
|
||||
name: str
|
||||
kind: SymbolKind
|
||||
range: Range
|
||||
selection_range: Range
|
||||
detail: T.Optional[str] = None
|
||||
children: T.List["DocumentSymbol"] = field(default_factory=list)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue