mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-06-22 23:19:25 -04:00
Add GtkComboBoxText items
This commit is contained in:
parent
f1e1811e1f
commit
aa447466c0
12 changed files with 137 additions and 17 deletions
|
@ -40,9 +40,16 @@ def applies_to(*ast_types):
|
|||
return func
|
||||
return decorator
|
||||
|
||||
def completer(applies_in: T.List, matches: T.List=[]):
|
||||
def completer(applies_in: T.List, matches: T.List=[], applies_in_subclass=None):
|
||||
def decorator(func):
|
||||
def inner(prev_tokens: T.List[Token], ast_node: ast.AstNode):
|
||||
# For completers that apply in ObjectContent nodes, we can further
|
||||
# check that the object is the right class
|
||||
if applies_in_subclass is not None:
|
||||
type = ast_node.root.gir.get_type(applies_in_subclass[1], applies_in_subclass[0])
|
||||
if ast_node.gir_class and not ast_node.gir_class.assignable_to(type):
|
||||
return
|
||||
|
||||
any_match = len(matches) == 0
|
||||
match_variables: T.List[str] = []
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue