notify tsserver about changes in external files.

This commit is contained in:
Andrius
2019-06-05 08:29:05 +03:00
parent 37518cae49
commit 2ac8fbb7d0

View File

@@ -24,6 +24,7 @@ import { PluginManager } from './utils/plugins';
import * as typeConverters from './utils/typeConverters';
import TypingsStatus, { AtaProgressReporter } from './utils/typingsStatus';
import VersionStatus from './utils/versionStatus';
import { flatten } from './utils/arrays';
// Style check diagnostics that can be reported as warnings
const styleCheckDiagnostics = [
@@ -68,7 +69,7 @@ export default class TypeScriptServiceClientHost extends Disposable {
configFileWatcher.onDidDelete(handleProjectCreateOrDelete, this, this._disposables);
configFileWatcher.onDidChange(handleProjectChange, this, this._disposables);
const allModeIds = this.getAllModeIds(descriptions);
const allModeIds = this.getAllModeIds(descriptions, pluginManager);
this.client = this._register(new TypeScriptServiceClient(
workspaceState,
version => this.versionStatus.onDidChangeTypeScriptVersion(version),
@@ -138,11 +139,11 @@ export default class TypeScriptServiceClientHost extends Disposable {
this.configurationChanged();
}
private getAllModeIds(descriptions: LanguageDescription[]) {
const allModeIds: string[] = [];
for (const description of descriptions) {
allModeIds.push(...description.modeIds);
}
private getAllModeIds(descriptions: LanguageDescription[], pluginManager: PluginManager) {
const allModeIds = flatten([
...descriptions.map(x => x.modeIds),
...pluginManager.plugins.map(x => x.languages)
]);
return allModeIds;
}