mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 19:18:32 -05:00
Merge from vscode 1eb87b0e9ce9886afeaecec22b31abd0d9b7939f (#7282)
* Merge from vscode 1eb87b0e9ce9886afeaecec22b31abd0d9b7939f * fix various icon issues * fix preview features
This commit is contained in:
@@ -125,7 +125,7 @@ export function rgErrorMsgForDisplay(msg: string): Maybe<SearchError> {
|
||||
const firstLine = lines[0].trim();
|
||||
|
||||
if (lines.some(l => startsWith(l, 'regex parse error'))) {
|
||||
return new SearchError('Regex parse error', SearchErrorCode.regexParseError);
|
||||
return new SearchError(buildRegexParseError(lines), SearchErrorCode.regexParseError);
|
||||
}
|
||||
|
||||
const match = firstLine.match(/grep config error: unknown encoding: (.*)/);
|
||||
@@ -150,6 +150,21 @@ export function rgErrorMsgForDisplay(msg: string): Maybe<SearchError> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function buildRegexParseError(lines: string[]): string {
|
||||
let errorMessage: string[] = ['Regex parse error'];
|
||||
let pcre2ErrorLine = lines.filter(l => (startsWith(l, 'PCRE2:')));
|
||||
if (pcre2ErrorLine.length >= 1) {
|
||||
let pcre2ErrorMessage = pcre2ErrorLine[0].replace('PCRE2:', '');
|
||||
if (pcre2ErrorMessage.indexOf(':') !== -1 && pcre2ErrorMessage.split(':').length >= 2) {
|
||||
let pcre2ActualErrorMessage = pcre2ErrorMessage.split(':')[1];
|
||||
errorMessage.push(':' + pcre2ActualErrorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
return errorMessage.join('');
|
||||
}
|
||||
|
||||
|
||||
export class RipgrepParser extends EventEmitter {
|
||||
private remainder = '';
|
||||
private isDone = false;
|
||||
|
||||
Reference in New Issue
Block a user