Open mighdoll opened 4 months ago
From what I can tell, it seems to panic when encountering certain syntax (unsure why), for example if I have a file in the open project with an override
declaration this error happens
Ack, sorry to keep you waiting, I completely missed the first notification for this!
It looks like the panic is because the scope-builder encounters a variable declaration that was declared with a keyword other than const
, let
or var
(in hindsight, panicking is probably not the most future-proof way to deal with unrecognized syntax, lol). I think Ruby's probably correct that the override
is the culprit — I added support for overrides in #42 and must have forgotten to update the scope builder.
It should be a pretty straightforward fix:
fn visit_var_decl(&mut self, decl: &VarDecl) -> FlowControl {
match decl.storage.lexeme().as_str() {
- "const" | "let" => simple_decl!(self, Const(decl)),
+ "const" | "let" | "override" => simple_decl!(self, Const(decl)),
"var" => simple_decl!(self, Var(decl)),
_ => unreachable!(),
}
FlowControl::Break
}
But it's possible something else will fail after that hurdle is cleared. I'm kind of slammed at the moment, but if anyone has time to work on a PR I'd be happy to answer any questions you might have or point you in the right direction if you get stuck!
I tried opening a single wgsl file in stoneberry, after building vscode-wgsl version 16de6a0 and manually installing the vsix file.
Looking at the log below, I guess vscode-wgsl eagerly tries to parse all of the .wgsl files and fails on TextureToHistograms.wgsl. Does that sound right? If so, I can try to isolate it further. Is there a debug mode to enable more details of parsing progress?