mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Change template syntax
Templates now use a TypeName instead of an identifier, which makes it clearer that it's an extern symbol (or that it's a Gtk.ListItem).
This commit is contained in:
parent
aebf8be278
commit
04509e4b2e
31 changed files with 175 additions and 55 deletions
|
@ -70,6 +70,8 @@ class PropertyBinding(AstNode):
|
|||
|
||||
@property
|
||||
def source_obj(self) -> T.Optional[Object]:
|
||||
if self.root.is_legacy_template(self.source):
|
||||
return self.root.template
|
||||
return self.context[ScopeCtx].objects.get(self.source)
|
||||
|
||||
@property
|
||||
|
@ -127,3 +129,11 @@ class PropertyBinding(AstNode):
|
|||
"Use 'bind-property', introduced in blueprint 0.8.0, to use binding flags",
|
||||
actions=[CodeAction("Use 'bind-property'", "bind-property")],
|
||||
)
|
||||
|
||||
@validate("source")
|
||||
def legacy_template(self):
|
||||
if self.root.is_legacy_template(self.source):
|
||||
raise UpgradeWarning(
|
||||
"Use 'template' instead of the class name (introduced in 0.8.0)",
|
||||
actions=[CodeAction("Use 'template'", "template")],
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue