Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a pants plugin to VSCode #10920

Open
thamenato opened this issue Oct 7, 2020 · 7 comments
Open

Create a pants plugin to VSCode #10920

thamenato opened this issue Oct 7, 2020 · 7 comments

Comments

@thamenato
Copy link
Member

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

  • syntax highlight for BUILD/pants.toml files
  • lint and format BUILD files

Maybe other things can be added later such as:

  • build target tree
  • being able to click on a target dependency and open that BUILD file
  • run pants directly from VSCode (?)

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

@Eric-Arellano
Copy link
Contributor

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
Copy link
Member Author

thamenato commented Oct 7, 2020

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
Copy link
Member Author

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
Copy link

joshua-cannon-techlabs commented Oct 28, 2021

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 😢

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

@kaos
Copy link
Member

kaos commented Oct 29, 2021

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

That could be #7079

And +1 for implementing support for BSP.

@sureshjoshi
Copy link
Member

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
Copy link
Member

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

8 participants