facebook / buck2

Build system, successor to Buck
https://buck2.build/
Apache License 2.0
3.54k stars 217 forks source link

Feature request: buck2 vscode extension #112

Open jmhodges opened 1 year ago

jmhodges commented 1 year ago

(This is totally not meant as a "do this today" thing, but a placeholder here for future possible work.)

It would be nice for there to be a Buck2 vscode extension. Syntax highlighting for Buck2-flavored Starlark, support for running buck2 commands later on, maybe some nice auto-import, that kind of stuff.

The official Bazel VSCode extension is similar enough to actually cause interesting problems. Namely, that, right now, popping open a Buck2 Skylark .bzl file will trigger the loading of the Bazel extension which will, in turn, emit errors and such about missing WORKSPACE files and so on that are irrelevant in Buck2-land.

It'd be nice to get Starlark syntax highlighting, at least, without the noise, even if we don't get all the rest.

ndmitchell commented 1 year ago

There is actually LSP support baked into Buck2 - just run buck2 lsp. I'm using that internally with the Starlark extension https://github.com/facebook/buck2/tree/main/starlark-rust/vscode and the options "starlark.lspPath": "buck2" and "starlark.lspArguments": ["lsp"]. It could certainly be cleaned up to work better out of the box.

MadcapJake commented 1 year ago

What kind of lsp functionality is it capable of? It doesn't seem like the Starlark vscode plugin is implementing any vscode piece other than a debugger that calls starlark --dap .