fresh-cat-90827
12/28/2022, 8:39 PMpants.toml
in VSCode and, potentially, in PyCharm (depends on the tooling available). ๐งตfresh-cat-90827
12/28/2022, 8:39 PM./pants help-all
should give us all the information we need in JSON format, so that the schemas could be updated between Pants version. It looks like it's common to have multiple schema files, one for each version.
I attach a gif to illustrate the point and the schema file used to produce the demo.fresh-cat-90827
12/28/2022, 8:39 PMfresh-cat-90827
12/28/2022, 8:39 PM{
"$schema": "<http://json-schema.org/draft-07/schema#>",
"description": "<https://www.pantsbuild.org/>",
"properties": {
"GLOBAL": {
"description": "Options to control the overall behavior of Pants.",
"type": "object",
"properties": {
"pants_version": {
"description": "Use this Pants version.",
"type": "string"
},
"level": {
"description": "Set the logging level.",
"type": "string",
"enum": [
"trace",
"debug",
"info",
"warn",
"error"
]
},
"pantsd": {
"description": "Enables use of the Pants daemon (pantsd).",
"type": "boolean"
}
}
},
"apache-thrift": {
"description": "Apache Thrift IDL compiler.",
"type": "object",
"properties": {
"thrift_search_paths": {
"description": "A list of paths to search for Thrift.",
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"required": [
"GLOBAL"
],
"title": "Schema for Pantsbuild pants.toml configuration file.",
"type": "object",
"x-taplo-info": {
"authors": [
"Pantsbuild (<https://www.pantsbuild.org/>)"
]
}
}
bitter-ability-32190
12/28/2022, 8:41 PMbitter-ability-32190
12/28/2022, 8:42 PMpants.toml
and BUILD
LSP-ingfresh-cat-90827
12/28/2022, 8:42 PMbitter-ability-32190
12/28/2022, 8:42 PMbitter-ability-32190
12/28/2022, 8:42 PMfresh-cat-90827
12/28/2022, 8:42 PMfresh-cat-90827
12/28/2022, 8:48 PMbitter-ability-32190
12/28/2022, 8:49 PMfresh-cat-90827
12/28/2022, 8:49 PMfresh-cat-90827
12/28/2022, 8:49 PMBeing able to generate a schema is a precursor, so please be my guestOh I see, gotcha. I thought an LSP solution would eliminate the need for the JSON schema file
fresh-cat-90827
12/28/2022, 8:50 PMfresh-cat-90827
12/28/2022, 8:53 PMhelp-all
JSON data (I'll likely need to extend the Python code used to generate the help) to produce a schema insteadbitter-ability-32190
12/28/2022, 8:54 PMbitter-ability-32190
12/28/2022, 8:54 PMexport
it, but I suspect there's a reason that wouldn't workhappy-kitchen-89482
12/28/2022, 9:31 PM./pants help-all
could spit out that schema, I reckon?happy-kitchen-89482
12/28/2022, 9:31 PMfresh-cat-90827
12/28/2022, 10:29 PM./pants help-all could spit out that schema, I reckon?yes, indeed! I'll see what will be more convenient -- parsing the JSON output or creating a new subcommand to get the schema constructed conveniently in Python code instead
fresh-cat-90827
12/28/2022, 11:57 PMwide-midnight-78598
12/29/2022, 12:52 AMwide-midnight-78598
12/29/2022, 12:53 AMexport
, but that has no access to help
, so it's a BuiltInGoal
- and parsing is pretty simple.wide-midnight-78598
12/29/2022, 12:55 AM