Add ${/} as a shorter alias for ${pathSeparator} predefined variable (#200750)

Fixes #180827
This commit is contained in:
Alex Ross 2023-12-13 16:04:54 +00:00 committed by GitHub
parent 81178e2113
commit 86504b9c9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View file

@ -66,7 +66,7 @@ function registerVariableCompletions(pattern: string): vscode.Disposable {
{ label: 'fileBasename', detail: vscode.l10n.t("The current opened file's basename") },
{ label: 'fileBasenameNoExtension', detail: vscode.l10n.t("The current opened file's basename with no file extension") },
{ label: 'defaultBuildTask', detail: vscode.l10n.t("The name of the default build task. If there is not a single default build task then a quick pick is shown to choose the build task.") },
{ label: 'pathSeparator', detail: vscode.l10n.t("The character used by the operating system to separate components in file paths") },
{ label: 'pathSeparator', detail: vscode.l10n.t("The character used by the operating system to separate components in file paths. Is also aliased to '/'.") },
{ label: 'extensionInstallFolder', detail: vscode.l10n.t("The path where an an extension is installed."), param: 'publisher.extension' },
].map(variable => ({
label: `\${${variable.label}}`,

View file

@ -107,7 +107,8 @@ export enum VariableKind {
FileDirnameBasename = 'fileDirnameBasename',
ExecPath = 'execPath',
ExecInstallFolder = 'execInstallFolder',
PathSeparator = 'pathSeparator'
PathSeparator = 'pathSeparator',
PathSeparatorAlias = '/'
}
export class VariableError extends Error {

View file

@ -368,6 +368,7 @@ export class AbstractVariableResolverService implements IConfigurationResolverSe
return match;
}
case 'pathSeparator':
case '/':
return paths.sep;
default: