mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
add MarkerSeverity, #44141
This commit is contained in:
@@ -5,9 +5,8 @@
|
||||
'use strict';
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import { IMarkerData } from 'vs/platform/markers/common/markers';
|
||||
import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import * as vscode from 'vscode';
|
||||
import { MainContext, MainThreadDiagnosticsShape, ExtHostDiagnosticsShape, IMainContext } from './extHost.protocol';
|
||||
import { DiagnosticSeverity } from './extHostTypes';
|
||||
@@ -126,7 +125,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
|
||||
|
||||
// add 'signal' marker for showing omitted errors/warnings
|
||||
marker.push({
|
||||
severity: Severity.Error,
|
||||
severity: MarkerSeverity.Error,
|
||||
message: localize({ key: 'limitHit', comment: ['amount of errors/warning skipped due to limits'] }, "Not showing {0} further errors and warnings.", diagnostics.length - DiagnosticCollection._maxDiagnosticsPerFile),
|
||||
startLineNumber: marker[marker.length - 1].startLineNumber,
|
||||
startColumn: marker[marker.length - 1].startColumn,
|
||||
@@ -202,13 +201,13 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
|
||||
};
|
||||
}
|
||||
|
||||
private static _convertDiagnosticsSeverity(severity: number): Severity {
|
||||
private static _convertDiagnosticsSeverity(severity: number): MarkerSeverity {
|
||||
switch (severity) {
|
||||
case 0: return Severity.Error;
|
||||
case 1: return Severity.Warning;
|
||||
case 2: return Severity.Info;
|
||||
case 3: return Severity.Ignore;
|
||||
default: return Severity.Error;
|
||||
case 0: return MarkerSeverity.Error;
|
||||
case 1: return MarkerSeverity.Warning;
|
||||
case 2: return MarkerSeverity.Info;
|
||||
case 3: return MarkerSeverity.Hint;
|
||||
default: return MarkerSeverity.Error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import * as modes from 'vs/editor/common/modes';
|
||||
import * as types from './extHostTypes';
|
||||
import { Position as EditorPosition, ITextEditorOptions } from 'vs/platform/editor/common/editor';
|
||||
@@ -21,6 +20,7 @@ import * as htmlContent from 'vs/base/common/htmlContent';
|
||||
import { IRelativePattern } from 'vs/base/common/glob';
|
||||
import { LanguageSelector, LanguageFilter } from 'vs/editor/common/modes/languageSelector';
|
||||
import { WorkspaceEditDto, ResourceTextEditDto } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { MarkerSeverity } from 'vs/platform/markers/common/markers';
|
||||
|
||||
export interface PositionLike {
|
||||
line: number;
|
||||
@@ -83,29 +83,29 @@ export function fromPosition(position: types.Position): IPosition {
|
||||
return { lineNumber: position.line + 1, column: position.character + 1 };
|
||||
}
|
||||
|
||||
export function fromDiagnosticSeverity(value: number): Severity {
|
||||
export function fromDiagnosticSeverity(value: number): MarkerSeverity {
|
||||
switch (value) {
|
||||
case types.DiagnosticSeverity.Error:
|
||||
return Severity.Error;
|
||||
return MarkerSeverity.Error;
|
||||
case types.DiagnosticSeverity.Warning:
|
||||
return Severity.Warning;
|
||||
return MarkerSeverity.Warning;
|
||||
case types.DiagnosticSeverity.Information:
|
||||
return Severity.Info;
|
||||
return MarkerSeverity.Info;
|
||||
case types.DiagnosticSeverity.Hint:
|
||||
return Severity.Ignore;
|
||||
return MarkerSeverity.Hint;
|
||||
}
|
||||
return Severity.Error;
|
||||
return MarkerSeverity.Error;
|
||||
}
|
||||
|
||||
export function toDiagnosticSeverty(value: Severity): types.DiagnosticSeverity {
|
||||
export function toDiagnosticSeverty(value: MarkerSeverity): types.DiagnosticSeverity {
|
||||
switch (value) {
|
||||
case Severity.Info:
|
||||
case MarkerSeverity.Info:
|
||||
return types.DiagnosticSeverity.Information;
|
||||
case Severity.Warning:
|
||||
case MarkerSeverity.Warning:
|
||||
return types.DiagnosticSeverity.Warning;
|
||||
case Severity.Error:
|
||||
case MarkerSeverity.Error:
|
||||
return types.DiagnosticSeverity.Error;
|
||||
case Severity.Ignore:
|
||||
case MarkerSeverity.Hint:
|
||||
return types.DiagnosticSeverity.Hint;
|
||||
}
|
||||
return types.DiagnosticSeverity.Error;
|
||||
|
||||
Reference in New Issue
Block a user