The editor gives a button/link [Ignore] preceding warnings to insert a suppression annotation for the developer on the line above. However, this insertion doesn't take code syntax into account and will blindly insert the annotation above the detected line, only giving it correct indentation. Multi-line expressions are unable to handle this, and the entire area of code lights up with errors. Code sample provided in reproduction steps. Manually moving the warning above the full expression successfully suppresses the warning.
I expect one of two things:
The editor insert the suppression mechanism in a safe place
The suppression mechanism not interrupt expressions
I imagine 1 is the easiest solution to take, as annotations are code and they need to be placed in valid locations according to their function. But I'd like to take a moment to state that something like 2 would be amazing. Many languages implement arbitrary warning suppression via directives. E.g. a lot of the C family of languages uses #pragma to instruct the compiler to hold off on specific warnings in the file until otherwise stated. I don't know how possible that is for an interpreted language vs a compiled one, it's really not my domain, but it would be amazing if it were possible.
Side-note, I found myself trying to suppress this warning after running into #74397 on a nameless script
Godot version
4.0.3
System information
Windows 11
Issue description
The editor gives a button/link
[Ignore]
preceding warnings to insert a suppression annotation for the developer on the line above. However, this insertion doesn't take code syntax into account and will blindly insert the annotation above the detected line, only giving it correct indentation. Multi-line expressions are unable to handle this, and the entire area of code lights up with errors. Code sample provided in reproduction steps. Manually moving the warning above the full expression successfully suppresses the warning.I expect one of two things:
I imagine 1 is the easiest solution to take, as annotations are code and they need to be placed in valid locations according to their function. But I'd like to take a moment to state that something like 2 would be amazing. Many languages implement arbitrary warning suppression via directives. E.g. a lot of the C family of languages uses
#pragma
to instruct the compiler to hold off on specific warnings in the file until otherwise stated. I don't know how possible that is for an interpreted language vs a compiled one, it's really not my domain, but it would be amazing if it were possible.Side-note, I found myself trying to suppress this warning after running into #74397 on a nameless script
Steps to reproduce
Sample code to reproduce:
Paste this in a script and click the
[Ignore]
text in the warnings list beneath the text editorMinimal reproduction project
N/A. Reproduction just takes the given snippet in a fresh project.