Skip to content

Commit

Permalink
notify tsserver about changes in external files.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrius-pra committed Jun 13, 2019
1 parent 37518ca commit 2ac8fbb
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 2ac8fbb

Please sign in to comment.