LSP: diagnose missing identifiers in scope
It would be really helpful if the LSP could diagnose undefined identifiers in global scope that might need to be imported and produce LSP level diagnostics. I don't know how hard this is, though, as I'm not sure how much accurate information the LSP knows about what is in scope.
I think the LSP doesn't really do diagnostics? It doesn't yet give syntax errors for instance.
I think the LSP doesn't really do diagnostics? It doesn't yet give syntax errors for instance.
It certainly doesn't output many, but it does diagnose parse failures. The actual diagnostics are pretty poor though:
some_rule(
name = "hey",
arg = "there",
)
[
another_rule(
name = "foo",
arg = "bar",
)
Will just flag "Error parsing: root//BUILD" at the first line...
I expect that it could at minimum output the few lints that buck2 starlark lint catches.