mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Initial implementation (#240264)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Event, Disposable, EventEmitter, SourceControlHistoryItemRef, l10n, workspace, Uri } from 'vscode';
|
||||
import { Event, Disposable, EventEmitter, SourceControlHistoryItemRef, l10n, workspace, Uri, DiagnosticSeverity } from 'vscode';
|
||||
import { dirname, sep, relative } from 'path';
|
||||
import { Readable } from 'stream';
|
||||
import { promises as fs, createReadStream } from 'fs';
|
||||
@@ -772,3 +772,15 @@ export function getCommitShortHash(scope: Uri, hash: string): string {
|
||||
const shortHashLength = config.get<number>('commitShortHashLength', 7);
|
||||
return hash.substring(0, shortHashLength);
|
||||
}
|
||||
|
||||
export type DiagnosticSeverityConfig = 'error' | 'warning' | 'information' | 'hint';
|
||||
|
||||
export function toDiagnosticSeverity(value: DiagnosticSeverityConfig): DiagnosticSeverity {
|
||||
return value === 'error'
|
||||
? DiagnosticSeverity.Error
|
||||
: value === 'warning'
|
||||
? DiagnosticSeverity.Warning
|
||||
: value === 'information'
|
||||
? DiagnosticSeverity.Information
|
||||
: DiagnosticSeverity.Hint;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user