mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 05:36:37 +00: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:
parent
5d94be354b
commit
afef1aba55
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue