Only send TS plugins that have registered for the document's language

Addresses comment on c2ee6133aa
This commit is contained in:
Matt Bierner
2017-08-17 17:16:11 -07:00
parent 799a4ea138
commit aebaece673

View File

@@ -54,12 +54,14 @@ class SyncedBuffer {
}
if (this.client.apiVersion.has240Features()) {
if (this.client.plugins.length) {
(args as any).plugins = this.client.plugins.map(x => x.name);
const tsPluginsForDocument = this.client.plugins
.filter(x => x.languages.indexOf(this.document.languageId) >= 0);
if (tsPluginsForDocument.length) {
(args as any).plugins = tsPluginsForDocument.map(plugin => plugin.name);
}
}
this.client.execute('open', args, false);
}