mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Use single diagnostic source for both js and ts
Fixes #48709 Use a unified diagnostic collection for js and ts since both diagnostics are provided by the typescript extension
This commit is contained in:
@@ -44,13 +44,13 @@ export class DiagnosticsManager {
|
||||
private _enableSuggestions: boolean = true;
|
||||
|
||||
constructor(
|
||||
language: string
|
||||
owner: string
|
||||
) {
|
||||
for (const kind of allDiagnosticKinds) {
|
||||
this._diagnostics.set(kind, new DiagnosticSet());
|
||||
}
|
||||
|
||||
this._currentDiagnostics = vscode.languages.createDiagnosticCollection(language);
|
||||
this._currentDiagnostics = vscode.languages.createDiagnosticCollection(owner);
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
|
||||
@@ -53,7 +53,7 @@ export default class LanguageProvider {
|
||||
}
|
||||
}, this._validate);
|
||||
|
||||
this.diagnosticsManager = new DiagnosticsManager(description.id);
|
||||
this.diagnosticsManager = new DiagnosticsManager(description.diagnosticOwner);
|
||||
|
||||
workspace.onDidChangeConfiguration(this.configurationChanged, this, this.disposables);
|
||||
this.configurationChanged();
|
||||
|
||||
@@ -108,6 +108,7 @@ export default class TypeScriptServiceClientHost {
|
||||
id: 'typescript-plugins',
|
||||
modeIds: Array.from(languages.values()),
|
||||
diagnosticSource: 'ts-plugins',
|
||||
diagnosticOwner: 'typescript',
|
||||
isExternal: true
|
||||
};
|
||||
const manager = new LanguageProvider(this.client, description, this.commandManager, this.typingsStatus);
|
||||
|
||||
@@ -5,22 +5,25 @@
|
||||
import * as languageModeIds from './languageModeIds';
|
||||
|
||||
export interface LanguageDescription {
|
||||
id: string;
|
||||
diagnosticSource: string;
|
||||
modeIds: string[];
|
||||
configFile?: string;
|
||||
isExternal?: boolean;
|
||||
readonly id: string;
|
||||
readonly diagnosticSource: string;
|
||||
readonly modeIds: string[];
|
||||
readonly configFile?: string;
|
||||
readonly isExternal?: boolean;
|
||||
readonly diagnosticOwner: string;
|
||||
}
|
||||
|
||||
export const standardLanguageDescriptions: LanguageDescription[] = [
|
||||
{
|
||||
id: 'typescript',
|
||||
diagnosticSource: 'ts',
|
||||
diagnosticOwner: 'typescript',
|
||||
modeIds: [languageModeIds.typescript, languageModeIds.typescriptreact],
|
||||
configFile: 'tsconfig.json'
|
||||
}, {
|
||||
id: 'javascript',
|
||||
diagnosticSource: 'js',
|
||||
diagnosticSource: 'ts',
|
||||
diagnosticOwner: 'typescript',
|
||||
modeIds: [languageModeIds.javascript, languageModeIds.javascriptreact],
|
||||
configFile: 'jsconfig.json'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user