@@ -332,6 +332,10 @@ def visit_Var(self, node: Statement) -> None: # noqa: N802
332
332
if not is_variable (var_name ):
333
333
return
334
334
335
+ stripped_variable = strip_variable_token (
336
+ Token (variable .type , var_name , variable .lineno , variable .col_offset , variable .error )
337
+ )
338
+
335
339
scope = cast (Var , node ).scope
336
340
if scope :
337
341
scope = scope .upper ()
@@ -347,11 +351,11 @@ def visit_Var(self, node: Statement) -> None: # noqa: N802
347
351
348
352
var = var_type (
349
353
name = var_name ,
350
- name_token = strip_variable_token (variable ),
351
- line_no = variable .lineno ,
352
- col_offset = variable .col_offset ,
353
- end_line_no = variable .lineno ,
354
- end_col_offset = variable .end_col_offset ,
354
+ name_token = strip_variable_token (stripped_variable ),
355
+ line_no = stripped_variable .lineno ,
356
+ col_offset = stripped_variable .col_offset ,
357
+ end_line_no = stripped_variable .lineno ,
358
+ end_col_offset = stripped_variable .end_col_offset ,
355
359
source = self ._namespace .source ,
356
360
)
357
361
@@ -361,7 +365,9 @@ def visit_Var(self, node: Statement) -> None: # noqa: N802
361
365
else :
362
366
existing_var = self ._variables [var .matcher ]
363
367
364
- location = Location (self ._namespace .document_uri , range_from_token (strip_variable_token (variable )))
368
+ location = Location (
369
+ self ._namespace .document_uri , range_from_token (strip_variable_token (stripped_variable ))
370
+ )
365
371
self ._variable_references [existing_var ].add (location )
366
372
if existing_var in self ._overridden_variables :
367
373
self ._variable_references [self ._overridden_variables [existing_var ]].add (location )
0 commit comments