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

Data structure name has a different colour to a standalone field #146

Open
richardm90 opened this issue Oct 12, 2024 · 5 comments
Open

Data structure name has a different colour to a standalone field #146

richardm90 opened this issue Oct 12, 2024 · 5 comments

Comments

@richardm90
Copy link
Contributor

I'm not sure if this is deliberate but a data structure variable name is shown as a different colour to a standalone field name. I tend to use the a light modern theme where the difference is barely noticeable but when using the dark modern theme it becomes more obvious.

image

If I add a freeidentifiers include into the pattern I get the colours I was expecting.

image

I've not played around with more complex examples yet as I first wanted to check this wasn't deliberate - I know some of the complex patterns handle more than just data structures i.e. procedures, prototypes, etc.

@barrettotte
Copy link
Owner

Weird, yeah there's something that I need to change with this. I always develop with the Monokai theme and naively thought the colors would have consistent behavior across themes, but clearly that's not the case.

Here's the example in Monokai:
image

I will look into fixing this up and also click around on different themes.
Thanks for bringing this to my attention

@richardm90
Copy link
Contributor Author

I'm pretty sure that it's not the theme itself that is causing the problem. I just think it's more obvious when I swapped to a dark theme.

I could solve the problem but I had to change the code for the pattern to include freeIdentifiers.

Did you need to make any changes to the extension for the image you took in Monokai?

@barrettotte
Copy link
Owner

Did you need to make any changes to the extension for the image you took in Monokai?

No, my screenshot was the extension without changes.

@richardm90
Copy link
Contributor Author

OK, that wasn't the answer I was expecting and these are the results I get.

Monokai (the same result as you):
image

Dark Modern (you can easily see the difference in colours):
image

Light Modern (you can just notice a difference in the colors):
image

The quick change I made to syntaxes/rpgle.tmLanguaga.json to see if it would fix the problem (not the full solution).

image

The results with my fix in place.

Monokai (no noticable difference):
image

Dark Modern (fixed):
image

Light Modern (fixed):
image

@barrettotte
Copy link
Owner

While throwing #freeIdentifiers in fixes your particular problem, it does break a handful of the manual tests in tests/ (137.rpgle, 115.rpgle, 29.rpgle) with Monokai; I didn't check the other themes yet. This is due to the regex for #freeIdentifiers consuming tokens that other regex needs.

Clicking through other themes without the change shows the same inconsistency between Monokai vs Dark Modern. Which leads me to think Monokai is the odd one out here.

I suspect I need to change some of the naming prefixes for the regex and confirm it has consistent behavior across all themes without regressing the highlighting of the prior tests.
Additionally, the other languages probably need to be checked across themes for sanity.

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

No branches or pull requests

2 participants