mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-30 10:38:28 +01:00
Accept a trailing colon in --goto format. (#186174)
* Accept a trailing colon in --goto format. This is useful because many tools add a comma after file[:line[:col]]. * Support trailing comma after line:col in search.
This commit is contained in:
@@ -42,7 +42,7 @@ function parseAndValidate(cmdLineArgs: string[], reportWarnings: boolean): Nativ
|
||||
|
||||
const args = parseArgs(cmdLineArgs, OPTIONS, reportWarnings ? errorReporter : undefined);
|
||||
if (args.goto) {
|
||||
args._.forEach(arg => assert(/^(\w:)?[^:]+(:\d*){0,2}$/.test(arg), localize('gotoValidation', "Arguments in `--goto` mode should be in the format of `FILE(:LINE(:CHARACTER))`.")));
|
||||
args._.forEach(arg => assert(/^(\w:)?[^:]+(:\d*){0,2}:?$/.test(arg), localize('gotoValidation', "Arguments in `--goto` mode should be in the format of `FILE(:LINE(:CHARACTER))`.")));
|
||||
}
|
||||
|
||||
return args;
|
||||
|
||||
@@ -148,8 +148,8 @@ export function getOutOfWorkspaceEditorResources(accessor: ServicesAccessor): UR
|
||||
return resources as URI[];
|
||||
}
|
||||
|
||||
// Supports patterns of <path><#|:|(><line><#|:|,><col?>
|
||||
const LINE_COLON_PATTERN = /\s?[#:\(](?:line )?(\d*)(?:[#:,](\d*))?\)?\s*$/;
|
||||
// Supports patterns of <path><#|:|(><line><#|:|,><col?><:?>
|
||||
const LINE_COLON_PATTERN = /\s?[#:\(](?:line )?(\d*)(?:[#:,](\d*))?\)?:?\s*$/;
|
||||
|
||||
export interface IFilterAndRange {
|
||||
filter: string;
|
||||
|
||||
Reference in New Issue
Block a user