Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync languages provided by Typescript plugins #75371

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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