Skip to content

Commit 0d09b74

Browse files
committed
correct handling of invalid variables in variables section
1 parent b2b5424 commit 0d09b74

File tree

1 file changed

+3
-1
lines changed
  • robotcode/language_server/robotframework/diagnostics

1 file changed

+3
-1
lines changed

robotcode/language_server/robotframework/diagnostics/namespace.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,12 @@ async def visit_Section(self, node: ast.AST) -> None: # noqa: N802
9393
async def visit_Variable(self, node: ast.AST) -> None: # noqa: N802
9494
from robot.parsing.lexer.tokens import Token
9595
from robot.parsing.model.statements import Variable
96+
from robot.variables import is_variable
9697

9798
n = cast(Variable, node)
9899
name = n.get_token(Token.VARIABLE)
99-
if name is not None:
100+
101+
if name is not None and is_variable(name.value):
100102
self._results.append(
101103
VariableDefinition(
102104
name=n.name,

0 commit comments

Comments
 (0)