pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.34k stars 640 forks source link

Create a pants plugin to VSCode #10920

Open thamenato opened 4 years ago

thamenato commented 4 years ago

As a pants user I'd love to have a plugin on VSCode where I can have (at least):

Maybe other things can be added later such as:

Note: Currently we have a plugin for IntelliJ (https://github.com/pantsbuild/intellij-pants-plugin)

Eric-Arellano commented 4 years ago

syntax highlight for pants.toml files

For pants.toml, have you set up the TOML support for VS Code? PyCharm's is quite nice. Or do you mean you further want the VSCode plugin to validate the config file?

By the way, check out BSP (build-server protocol). It's like LSP, but for build tools. https://github.com/build-server-protocol/build-server-protocol

Rather than doing a VSCode plugin, I think we'd want to integrate with BSP so that we get support for many editors all in one. I believe @cosmicexplorer has checked out BSP in the past?

thamenato commented 4 years ago

For pants.toml, have you set up the TOML support for VS Code? PyCharm's is quite nice. Or do you mean you further want the VSCode plugin to validate the config file?

I do have TOML support, and yes it is really nice 😄 but I meant more of the available tags and it's properties. Sort of it I press cmd+space it'll show me: GLOBAL, source, python-repos, etc... and when I'm inside [GLOBAL] it would show me / auto-complete dynamic_ui, pantsd, etc...

thamenato commented 4 years ago

Rather than doing a VSCode plugin, I think we'd want to integrate with BSP so that we get support for many editors all in one. I believe @cosmicexplorer has checked out BSP in the past?

That's actually a pretty good idea. I'm a VIM user so I won't complain there! I'll investigate that and chat with @cosmicexplorer .

joshua-cannon-techlabs commented 3 years ago

To add, I can associate my BUILD files as Python files for highlighting, but then get red squiggles with "python_library is not defined" (etc...) all over the place :cry:

I wonder if you could define a stub file for pants target definitions :thinking:

kaos commented 3 years ago

I believe @cosmicexplorer has checked out BSP in the past?

That could be #7079

And +1 for implementing support for BSP.

sureshjoshi commented 2 years ago

Just putting this here for posterity. I played around with the concept for a while, and I'm using this.

It's a proof-of-concept as much as anything, but if anyone wants to run with it - be my guest! https://github.com/robotpajamas/suspenders

thejcannon commented 2 years ago

I actually has an idea for this to get a really solid "poor man's solution". We might wanna have a plugin (.vscode or whatever) which export exports the virtualenvs as well as a .vsocde config which points to the ve path(s) "correctly".