I'm minding my own business editing a pants.toml i...
# general
h
I'm minding my own business editing a pants.toml in PyCharm, and suddenly I get context-sensitive autocomplete for every scope and option, without having to do anything at all. Of course I quickly realized this is due to https://github.com/pantsbuild/pants/issues/17895. Huge hat-tip to @fresh-cat-90827 for this!!
👖 4
😊 2
🙌 5
w
Does VSCode get this natively? Or is there some extra work?
f
Glad to hear this is useful!
Does VSCode get this natively? Or is there some extra work?
I am afraid you have to install an extension, see https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml, and pick the Pantsbuild schema I have a ticket to add a new goal to Pants, if the team thinks it's reasonable https://github.com/pantsbuild/pants/issues/18126
r
First of all thanks @fresh-cat-90827 I just installed it inside VSCode. Works great! Although I saw these warnings
Copy code
{"add":["pants.backend.awslambda.python","pants.backend.build_files.fmt.black","pants.backend.python","pants.backend.docker","pants.backend.docker.lint.hadolint","pants.backend.experimental.python.lint.autoflake","pants.backend.python.lint.bandit","pants.backend.python.lint.black","pants.backend.python.lint.docformatter","pants.backend.python.lint.flake8","pants.backend.python.typecheck.mypy","pants.backend.python.lint.isort","pants.backend.plugin_development","internal_plugins"]} is not of type "array"Even Better TOML
f
thanks @refined-addition-53644 for giving it a go! Yep, these are expected, please see https://github.com/pantsbuild/pants/pull/17915. We kind of exploit the TOML syntax with the
.add
and
.remove
. The schema for the arrays can be somewhat sophisticated, so I didn't feel comfortable doing this in the first iteration
👍 1
however, I plan to improve on the schema; I hope it will be possible to declare all possible variations 🙂
w
I am afraid you have to install an extension, see https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml, and pick the Pantsbuild schema
Thanks! That’s what I thought, but I wasn’t sure. Still awesome :)
❤️ 1