danielscherzer / GLSL

VSIX Project that provides GLSL language integration.
257 stars 28 forks source link

Feature request: add highlight for fixed-size types #116

Closed stephen-hqxu closed 1 year ago

stephen-hqxu commented 1 year ago

Installed product versions

Description

Hi, I want to start by saying a big thanks for maintaining such a great tool and it really saves me a lot of time hunting for typos when writing complex shaders. πŸ‘πŸ½

Just a little feature request. I wonder if that's possible to add highlights for all fixed-size scaler, vector and matrix types. There are only a few of them such as u16vec2 get a highlight in the current release; some of them like uint32_t have auto-completion but don't provide highlight.

I can see it's possible to add rest of them via user keyword list, but I think it might be better to provide built-in support since many extensions (e.g., GL_EXT_shader_explicit_arithmetic_types) enable use of those types.

Unfortunately I don't know how popular those extensions are among shader developers, so not sure how much benefit this feature can bring. For Vulkan, it seems quite prevalent according to GPUInfo at https://vulkan.gpuinfo.org/listfeaturescore10.php and https://vulkan.gpuinfo.org/listfeaturescore12.php that most modern graphics devices support use of fixed-size types.

danielscherzer commented 1 year ago

This feature should be included in the new version (0.11.165). Hopefully it works for you as expected. Cheers, Daniel

stephen-hqxu commented 1 year ago

Thanks, I have updated to the latest version (0.11.165) and did a quick test, but it looks like some of the keywords are still not highlighted, even though I can see they have been added in https://github.com/danielscherzer/GLSLhelper/commit/137844a358253e7f678ee51fb63e6e50b9b72d1c; also I notice float64_t and its vector/matrix types are missing in glslKeywords.txt.

glsl-highlight-test

danielscherzer commented 1 year ago

Thanks for the detailed error report! The encoding of the glslKeywords.txt was messed-up. Hopefully the new version works.

stephen-hqxu commented 1 year ago

Just to confirm that the new version (0.11.166) works perfectly. I am closing this issue as completed. Cheers.