Provide a way to allow pass config into typescript plugin extension
Closed this issue · 2 comments
Kingwl commented
As the current behavior We cannot pass config into a extension who based on typescript plugin.
Could we find some way to specify which config we does care and pass them into typescript plugin config?
eg:
{
"contributes": {
"typescriptServerPlugins": [{
"name": "any plugin",
"enableForWorkspaceTypeScriptVersions": true,
"configs": {
"configA": "anyPlugin.barrrrrr",
"configB": "anyPlugin.foooooo"
}
}],
"configuration": {
"title": "TypeScript",
"properties": {
"anyPlugin.barrrrrr": {
"type": "boolean",
"default": false,
"description": "desc"
},
"anyPlugin.foooooo": {
"type": "boolean",
"default": false,
"description": "desc"
}
}
}
}
}
And then we could use the config by typescript plugin config as here
mjbvz commented
Extensions can use the TypeScript extension's configurePlugin
api for this
Here's an example of how TSLint uses this the api:
https://github.com/microsoft/vscode-typescript-tslint-plugin/blob/6b41f866243e0526ee1dddbc8de55155f157c93a/src/index.ts#L55
This allow an extension to send whatever information it wants to a plugin, instead of making VS Code responsible for synchronizing the configuration on behalf of the extension
Kingwl commented
thanks