Initial implementation (#240264)

This commit is contained in:
Ladislau Szomoru
2025-02-10 18:05:21 +01:00
committed by GitHub
parent 732d06fd55
commit 22c92fc911
4 changed files with 115 additions and 4 deletions

View File

@@ -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;
}