-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
It should be possible to add a build step that scans the plugin extension points for definitions (config options, function, operators, channel factories). For example, you can use the Groovy compiler to parse these classes enough to get the AST and extract the annotations from there.
These definitions should be saved to a JSON file or API that can be queried by the language server.
For example, the JSON for nf-boost would look something like this:
{
"configuration": {
"boost": {
"description": "The `boost` scope allows you to configure the `nf-boost` plugin.",
"options": {
"cleanup": {
"description": "Set to `true` to enable automatic cleanup (default: `false`). Temporary files will be automatically deleted as soon as they are no longer needed.\n\nCan also be `'v1'` or `'v2'` to use an implementation that works with publishDir or the workflow output definition, respectively. Setting to `true` is equivalent to `'v1'`.",
"type": "String"
},
"cleanupInterval": {
"description": "Specify how often to scan for cleanup (default: `'60s'`).",
"type": "Duration"
}
}
}
},
"factories": [],
"functions": [
{
"name": "fromJson",
"arguments": [
{
"name": "source",
"type": "Path"
}
],
"returnType": "Object"
},
{
"name": "fromJson",
"arguments": [
{
"name": "text",
"type": "String"
}
],
"returnType": "Object"
},
{
"name": "toJson",
"arguments": [
{
"name": "value",
"type": "Object"
},
{
"name": "value",
"type": "boolean",
"defaultValue": false
}
],
"returnType": "String"
},
// ...
],
"operators": [
{
"name": "scan",
"arguments": [
{
"name": "seed",
"defaultValue": null
},
{
"name": "accumulator",
"type": "Closure"
}
]
},
// ...
]
}
Metadata
Metadata
Assignees
Labels
No labels