PolyMeilex / vscode-wgsl

VsCode Syntax highlight for WGSL files
MIT License
79 stars 8 forks source link

Handling of `#import` #25

Open wduminy opened 1 year ago

wduminy commented 1 year ago

I am using the bevy engine and it uses #import. Here is an example shader.

In VS-Code I get this error when I enable v0.1.16 of vscode-wsgl:

error: expected global item ('struct', 'const', 'var', 'alias', ';', 'fn') or the end of the file, found '#'
  ┌─ wgsl:1:1
  │
1 │ #import bevy_pbr::forward_io::VertexOutput;
  │ ^ expected global item ('struct', 'const', 'var', 'alias', ';', 'fn') or the end of the file

It would be nice if somehow this import statement could be processed or ignored.