diff --git a/packages/variable-resolver/src/browser/common-variable-contribution.ts b/packages/variable-resolver/src/browser/common-variable-contribution.ts index 318f87d3c32a3..a23ee1c2bfdc8 100644 --- a/packages/variable-resolver/src/browser/common-variable-contribution.ts +++ b/packages/variable-resolver/src/browser/common-variable-contribution.ts @@ -18,6 +18,7 @@ import { injectable, inject } from 'inversify'; import { VariableContribution, VariableRegistry } from './variable'; import { EnvVariablesServer } from '@theia/core/lib/common/env-variables'; import { CommandService } from '@theia/core/lib/common/command'; +import { isWindows } from '@theia/core/lib/common/os'; import { PreferenceService } from '@theia/core/lib/browser/preferences/preference-service'; import { ResourceContextKey } from '@theia/core/lib/browser/resource-context-key'; import { VariableInput } from './variable-input'; @@ -129,6 +130,10 @@ export class CommonVariableContribution implements VariableContribution { return undefined; } }); + variables.registerVariable({ + name: 'pathSeparator', + resolve: () => isWindows ? '\\' : '/' + }); } }