dparnell / intellij-wgsl

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

`WGSLTokenType.LESS_THAN expected, got '('` #32

Closed LoganDark closed 2 years ago

LoganDark commented 2 years ago

This code:

struct Vertex {
    @builtin(position) pos: vec4<f32>
}

@vertex
fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> Vertex {
    let x = f32(1 - i32(in_vertex_index)) * 0.5;
    let y = f32(i32(in_vertex_index & 1u) * 2 - 1) * 0.5;
    return Vertex(vec4(x, y, 0.0, 1.0));
}

@fragment
fn fs_main(in: Vertex) -> @location(0) vec4<f32> {
    return vec4(1.0, 0.0, 0.0, 1.0);
}

validates fine, but the plugin throws an error at the first vec4 because it incorrectly assumes that it must be qualified with <f32>.

dparnell commented 2 years ago

I'll take a look and see what I can see

dparnell commented 2 years ago

Ok, it appears that the spec in this area has changed. It may take a little while to get the grammar updated to accommodate the new syntax

dparnell commented 2 years ago

I have just pushed a fix for this issue. Once it has been approved by Jetbrains it should be available on the store.

LoganDark commented 2 years ago

Feel free to close the issue once the new version is available :)

dparnell commented 2 years ago

It usually takes them a couple of days to approve a new version of the plugin

dparnell commented 2 years ago

This should now be available in the Jetbrains store

LoganDark commented 2 years ago

Thanks!