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

Syntax highlighting for unique node names is not working with inline annotations #79755

Open
Kubulambula opened this issue Jul 21, 2023 · 4 comments

Comments

@Kubulambula
Copy link
Contributor

Godot version

4.1.1

System information

Any

Issue description

When using unique names with annotations on one line, the unique name is not highlighted, but the script is still valid.

capture

Steps to reproduce

Have an annotation and inline unique name like this:
@warning_ignore("unsafe_property_access") %MyLabel.text = "Hello World!".

Minimal reproduction project

reproduction.zip

@ghost
Copy link

ghost commented Jul 21, 2023

I can confirm that the bug happens for me on the android editor with:

Godot v4.1.1.stable • LineageOS 18.1 • 20230614-NIGHTLY • a5y17lte • Vulkan (Mobile) • integrated Mali-T830 • (4 Threads)

@dalexeev
Copy link
Member

dalexeev commented Jul 22, 2023

In this context, the %character is treated as a remainder / string formatting operator because it comes after the "operand" (close parenthesis). I don't think it's possible to fix this without a major refactoring of the highlighter. But I don't mean that this is a reason to close this issue, just clarifying that we probably shouldn't expect a fix soon.

To me, using inline annotations with statements looks like an undesirable style. This is ok with short definitions (like @onready and @export), but otherwise I prefer annotations on separate lines.

@Kubulambula
Copy link
Contributor Author

To me, using inline annotations with statements looks like an undesirable style. This is ok with short definitions (like @onready and @export), but otherwise I prefer annotations on separate lines.

I agree, but sometimes, you just have a lot of these lines and want to save space. That's how I discovered it.

@dalexeev
Copy link
Member

but sometimes, you just have a lot of these lines and want to save space

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

3 participants