-
Notifications
You must be signed in to change notification settings - Fork 13
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
Changes and fixes to grammar: Number literals, preprocessor, string #57
base: master
Are you sure you want to change the base?
Conversation
The regex was not properly catching hex numbers. Modified the regex to be more comprehensive and fix the issue. Signed-off-by: Andreas K. Berg <[email protected]>
There are extensions that add support for file includes in GLSL. Not sure about the extent to which those are used or available in ES, but including the rule makes the extension more accessible for a larger audience. Signed-off-by: Andreas K. Berg <[email protected]>
Added the defined preprocessor keywords (+include, see previous commit for suggestion), instead of whatever kind of black magic that was blocking theming of directive parameters. Now, only a valid preprocessor keyword will be highlighted, and any literals or symbols behind it will also be properly highlighted. Also changed the scope name to hit better with common themes (Tested with Microsoft themes, which colour preprocessor directives differently, as well as with variants of Atom and Material and others). Signed-off-by: Andreas K. Berg <[email protected]>
Signed-off-by: Andreas K. Berg <[email protected]>
Fixed error introduced in previous commit. Signed-off-by: Andreas K. Berg <[email protected]>
Signed-off-by: Andreas K. Berg <[email protected]>
@akberg, will you continue to work on this Pull request? |
I'll push the additional edits I made that make me more happy to use the extension, but if, as you say, you intend to have this extension's support limited to ES, then I should take my contributions somewhere else - my interest is in having general GLSL support compiled in one place, and currently compute shaders in particular. For processor directives, I just intended to do an initial fix, so just keeping the changed scope name would suffice to fix syntax highlighting.
Thanks for taking the time to properly review, btw. |
Thanks for taking the time to properly review. I did some more local changes for the highlighting to be good enough for my using, but if, as you say, you intend to have this extension's support limited to ES, then I should take my contributions somewhere else - my interest is in having general GLSL support compiled in one place, and currently compute shaders in particular. |
I've been searching hopelessly for a remotely useful GLSL language support for VSCode for a while, and this one immediately seems to provide a mostly decent highlighting. I did however notice a few misses, that need fixing -- and added an extra which is open for discussion:
GL_GOOGLE_include_directive
) provide the include directive for including files and reusing code. For this, I've added theinclude
keyword to the preprocessor list, and a rule for double-quoted strings. I'm not using GLES though, just GL, so I don't know how available those extensions are for ES. In any case, supporting the highlighting would make the extension more accessible, given that this is pretty much the only useful syntax highlighter on the marketplace.