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
|
@ -1,5 +1,9 @@
|
|||
import typing as T
|
||||
|
||||
from blueprintcompiler.errors import T
|
||||
from blueprintcompiler.lsp_utils import DocumentSymbol
|
||||
|
||||
from ..ast_utils import AstNode, validate
|
||||
from ..parse_tree import Keyword
|
||||
from .common import *
|
||||
from .contexts import ScopeCtx
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
|
@ -17,6 +21,15 @@ class ExtListItemFactory(AstNode):
|
|||
def signature(self) -> str:
|
||||
return f"template {self.gir_class.full_name}"
|
||||
|
||||
@property
|
||||
def document_symbol(self) -> DocumentSymbol:
|
||||
return DocumentSymbol(
|
||||
self.signature,
|
||||
SymbolKind.Object,
|
||||
self.range,
|
||||
self.group.tokens["id"].range,
|
||||
)
|
||||
|
||||
@property
|
||||
def type_name(self) -> T.Optional[TypeName]:
|
||||
if len(self.children[TypeName]) == 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue