https://pantsbuild.org/ logo
#general
Title
# general
h

happy-kitchen-89482

01/30/2023, 2:55 AM
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

wide-midnight-78598

01/30/2023, 6:08 AM
Does VSCode get this natively? Or is there some extra work?
f

fresh-cat-90827

01/30/2023, 7:13 AM
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

refined-addition-53644

01/30/2023, 9:58 AM
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

fresh-cat-90827

01/30/2023, 10:06 AM
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

wide-midnight-78598

01/30/2023, 12:59 PM
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