mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-07-07 01:29:26 -04:00
signal: Add object signature on hover
This commit is contained in:
parent
8c19561636
commit
6bef9a39dd
1 changed files with 12 additions and 1 deletions
|
@ -21,7 +21,7 @@ import typing as T
|
|||
|
||||
from .common import *
|
||||
from .contexts import ScopeCtx
|
||||
from .gtkbuilder_template import Template
|
||||
from .gobject_object import Object
|
||||
|
||||
|
||||
class SignalFlag(AstNode):
|
||||
|
@ -110,6 +110,10 @@ class Signal(AstNode):
|
|||
def object_id(self) -> T.Optional[str]:
|
||||
return self.tokens["object"]
|
||||
|
||||
@property
|
||||
def object(self) -> T.Optional[Object]:
|
||||
return self.context[ScopeCtx].objects.get(self.object_id)
|
||||
|
||||
@property
|
||||
def flags(self) -> T.List[SignalFlag]:
|
||||
return self.children[SignalFlag]
|
||||
|
@ -162,6 +166,13 @@ class Signal(AstNode):
|
|||
|
||||
return None
|
||||
|
||||
@docs("object")
|
||||
def object_docs(self):
|
||||
if self.object is not None:
|
||||
return f"```\n{self.object.signature}\n```"
|
||||
else:
|
||||
return None
|
||||
|
||||
@validate("handler")
|
||||
def old_extern(self):
|
||||
if not self.tokens["extern"]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue