@@ -67,6 +67,15 @@ async def visit(self, node: ast.AST) -> None:
67
67
68
68
self .node_stack .append (node )
69
69
try :
70
+ severity = (
71
+ DiagnosticSeverity .HINT if isinstance (node , DocumentationOrMetadata ) else DiagnosticSeverity .ERROR
72
+ )
73
+
74
+ if isinstance (node , Statement ) and isinstance (node , KeywordCall ) and node .keyword :
75
+ kw_doc = await self .namespace .find_keyword (node .keyword )
76
+ if kw_doc is not None and kw_doc .longname in ["BuiltIn.Comment" ]:
77
+ severity = DiagnosticSeverity .HINT
78
+
70
79
if isinstance (node , HasTokens ) and not isinstance (node , (TestTemplate , Template )):
71
80
for token in (
72
81
t
@@ -87,10 +96,8 @@ async def visit(self, node: ast.AST) -> None:
87
96
if isinstance (var , VariableNotFoundDefinition ):
88
97
await self .append_diagnostics (
89
98
range = range_from_token (var_token ),
90
- message = f"Variable '{ var .name } ' not found" ,
91
- severity = DiagnosticSeverity .HINT
92
- if isinstance (node , DocumentationOrMetadata )
93
- else DiagnosticSeverity .ERROR ,
99
+ message = f"Variable '{ var .name } ' not found." ,
100
+ severity = severity ,
94
101
source = DIAGNOSTICS_SOURCE_NAME ,
95
102
)
96
103
if (
@@ -109,7 +116,7 @@ async def visit(self, node: ast.AST) -> None:
109
116
if isinstance (var , VariableNotFoundDefinition ):
110
117
await self .append_diagnostics (
111
118
range = range_from_token (var_token ),
112
- message = f"Variable '{ var .name } ' not found" ,
119
+ message = f"Variable '{ var .name } ' not found. " ,
113
120
severity = DiagnosticSeverity .ERROR ,
114
121
source = DIAGNOSTICS_SOURCE_NAME ,
115
122
)
@@ -141,7 +148,7 @@ async def visit(self, node: ast.AST) -> None:
141
148
if isinstance (var , VariableNotFoundDefinition ):
142
149
await self .append_diagnostics (
143
150
range = range_from_token (var_token ),
144
- message = f"Variable '{ var .name } ' not found" ,
151
+ message = f"Variable '{ var .name } ' not found. " ,
145
152
severity = DiagnosticSeverity .ERROR ,
146
153
source = DIAGNOSTICS_SOURCE_NAME ,
147
154
)
@@ -360,7 +367,7 @@ async def _analyse_run_keyword(
360
367
if t .value == "AND" :
361
368
await self .append_diagnostics (
362
369
range = range_from_token (t ),
363
- message = f"Incorrect use of { t .value } " ,
370
+ message = f"Incorrect use of { t .value } . " ,
364
371
severity = DiagnosticSeverity .ERROR ,
365
372
source = DIAGNOSTICS_SOURCE_NAME ,
366
373
)
0 commit comments