Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script Editor: Highlighting custom classes stops working when statement is continued to the next line #88808

Open
Torguen opened this issue Feb 25, 2024 · 8 comments

Comments

@Torguen
Copy link

Torguen commented Feb 25, 2024

Tested versions

v4.3.dev3.official [36e943b]

System information

w10 64

Issue description

Highlighting an custom object type does not work when what can be seen in the video occurs.
It doesn't matter if there are spaces after the function parentheses.
If you switch to a new line immediately after the function parenthesis, custom object types are not highlighted.

2024-02-25.11-47-45.mp4

Steps to reproduce

See the video

Minimal reproduction project (MRP)

...

@AThousandShips
Copy link
Member

Please add descriptions of the issue along with videos of you add a video, it makes things much easier to evaluate

It looks like the issue is that highlighting doesn't work for method arguments if there are trailing spaces after the opening parentheses, but it's hard to tell from just the video

@Torguen
Copy link
Author

Torguen commented Feb 25, 2024

Ok, sorry.
It doesn't matter if there are spaces after the parentheses.
If you switch to a new line immediately after the function parenthesis, custom object types are not highlighted.

@AThousandShips
Copy link
Member

Does it work with two tabs of indentation?

@Torguen
Copy link
Author

Torguen commented Feb 25, 2024

You mean this?
No, it does not work.

Captura5

@dalexeev
Copy link
Member

This is a known bug (though not explicitly reported before). It is due to the way the highlighter works: the context is lost for each new line (except for code regions like string literals).

We could try to work around this by adding a way to detect line continuations. But I think that in any case we will need a major refactoring of the highlighter (for example, to fix the highlighting of inner classes). I think we will need a simplified GDScript parser that is more performant and more tolerant to syntax errors than the full GDScript parser.

@Mickeon
Copy link
Contributor

Mickeon commented Feb 25, 2024

(though not explicitly reported before)

Are we sure this is not a duplicate of #88552 ?

@dalexeev
Copy link
Member

dalexeev commented Feb 25, 2024

I mean, there are several issues about different manifestations of the problem (for example, the % operator is treated as the beginning of a scene unique node shorthand after a newline), but they all have a common fundamental cause. We can try to fix some issues without a major refactoring, but I think not in this case.

@Mickeon Mickeon changed the title Highlighting does not work in certain circumstances. Script Editor: Highlighting custom classes stops working when statement is continued to the next line Feb 25, 2024
@Mickeon
Copy link
Contributor

Mickeon commented Feb 25, 2024

I modified the title of the issue in an attempt to be more explicit.

Next time please, try coming up with a more specific title and description of the issue. With an extremely generic title, it becomes very hard to trace back and actually address the issue in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants