From 7e20983b44c9f917dc8ecfe0c83d520b1d9fb39f Mon Sep 17 00:00:00 2001 From: Cameron Dehning Date: Fri, 24 Mar 2023 16:27:22 +0000 Subject: [PATCH] Lsp hotfix --- blueprintcompiler/language/values.py | 3 ++- blueprintcompiler/tokenizer.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/blueprintcompiler/language/values.py b/blueprintcompiler/language/values.py index 83de28e..e446b29 100644 --- a/blueprintcompiler/language/values.py +++ b/blueprintcompiler/language/values.py @@ -297,7 +297,8 @@ class IdentLiteral(AstNode): return None def get_semantic_tokens(self) -> T.Iterator[SemanticToken]: - if isinstance(self.parent.value_type, gir.Enumeration): + type = self.context[ValueTypeCtx].value_type + if isinstance(type, gir.Enumeration): token = self.group.tokens["value"] yield SemanticToken(token.start, token.end, SemanticTokenType.EnumMember) diff --git a/blueprintcompiler/tokenizer.py b/blueprintcompiler/tokenizer.py index 5a40803..f68f5a7 100644 --- a/blueprintcompiler/tokenizer.py +++ b/blueprintcompiler/tokenizer.py @@ -82,7 +82,7 @@ def _tokenize(ui_ml: str): i = 0 while i < len(ui_ml): matched = False - for (type, regex) in _TOKENS: + for type, regex in _TOKENS: match = regex.match(ui_ml, i) if match is not None: