dparnell / intellij-wgsl

WGSL plugin for IntelliJ and CLion
BSD 3-Clause "New" or "Revised" License
22 stars 10 forks source link

Add support for `const` keyword #44

Closed terrarier2111 closed 2 years ago

terrarier2111 commented 2 years ago

Currently writing const looks like an other invalid expression, fix this by adding support for the const keyword and thus const expressions

dparnell commented 2 years ago

I have just pushed a fix for this. It should be available in the Jetbrains marketplace in a couple of days once they approve the update

dparnell commented 2 years ago

This should be available on the Jetbrains market place now. Let me know if this fixes your problem.,

terrarier2111 commented 2 years ago

Thanks! This works unfortunately only partially, the const keyword doesn't get flagged anymore, but the / in: const INV_ATLAS_SIZE: f32 = 1.0 / 2048.0; does get marked red

dparnell commented 2 years ago

This is going to take a bit of fixing properly. The issue is the grammar is expecting the value to be a simple constant. I will change it to allow any expression.

dparnell commented 2 years ago

This should be fixed in the 0.0.22 release on the Jetbrains marketplace now.