You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a function body is missing, you get the following error message:
From the user's perspective the line displayed as an error line is totally wrong. I know that that is the line where the error is detected, but for the user it is a wrong line. At Godot subreddit it is quite often that users are stuck with these errors.
Another example where line 39 would be the most logical error location for the user. This is a little bit easier for the user as the error message tells that "for" block is missing something.
In my opinion the best fix would be to move the error location to the line that the error message refers to, in these examples function declaration line and for line. A small improvement would be to display the function name in the first example: Error at (41, 1): Expected inteded block after function declaration 'foo()'
Steps to reproduce
funcfoo():
funcbar():
pass
funcfoo():
foriinrange(2):
funcbar():
pass
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered:
This is probably because empty lines are valid indentation, so the first like that actually violates the indentation is the line indicated, though confusing it isn't wrong as such
It could be improved by backtracking over these empty lines though
Godot version
v4.1.1.stable.official [bd6af8e]
System information
Godot v4.1.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 31.0.15.3640) - Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 Threads)
Issue description
When a function body is missing, you get the following error message:
From the user's perspective the line displayed as an error line is totally wrong. I know that that is the line where the error is detected, but for the user it is a wrong line. At Godot subreddit it is quite often that users are stuck with these errors.
Another example where line 39 would be the most logical error location for the user. This is a little bit easier for the user as the error message tells that "for" block is missing something.
In my opinion the best fix would be to move the error location to the line that the error message refers to, in these examples function declaration line and for line. A small improvement would be to display the function name in the first example:
Error at (41, 1): Expected inteded block after function declaration 'foo()'
Steps to reproduce
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: