File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
robotcode/language_server/robotframework/diagnostics Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,32 @@ async def visit_Arguments(self, node: ast.AST) -> None: # noqa: N802
195195 except VariableError :
196196 pass
197197
198+ async def visit_ExceptHeader (self , node : ast .AST ) -> None : # noqa: N802
199+ from robot .errors import VariableError
200+ from robot .parsing .lexer .tokens import Token as RobotToken
201+ from robot .parsing .model .statements import ExceptHeader
202+ from robot .variables import is_scalar_assign
203+
204+ n = cast (ExceptHeader , node )
205+ variables = n .get_tokens (RobotToken .VARIABLE )[:1 ]
206+ if variables and is_scalar_assign (variables [0 ].value ):
207+ try :
208+ variable = self .get_variable_token (variables [0 ])
209+
210+ if variable is not None :
211+ self ._results [variable .value ] = LocalVariableDefinition (
212+ name = variable .value ,
213+ name_token = variable ,
214+ line_no = variable .lineno ,
215+ col_offset = variable .col_offset ,
216+ end_line_no = variable .lineno ,
217+ end_col_offset = variable .end_col_offset ,
218+ source = self .source ,
219+ )
220+
221+ except VariableError :
222+ pass
223+
198224 async def visit_KeywordCall (self , node : ast .AST ) -> None : # noqa: N802
199225 from robot .errors import VariableError
200226 from robot .parsing .lexer .tokens import Token as RobotToken
You can’t perform that action at this time.
0 commit comments