Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #5734 correct workspace path variables on windows #5741

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixes theia-ide#5734 correct path variables on windows
Signed-off-by: George Vinokhodov <Vineg@yandex.ru>
Vineg committed Jul 17, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1b3f9b52da6dca19aa2304b5c177e784bca37ec3
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@

import { injectable, inject, postConstruct } from 'inversify';
import URI from '@theia/core/lib/common/uri';
import { FileSystem } from '@theia/filesystem/lib/common';
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
import { ApplicationShell, NavigatableWidget } from '@theia/core/lib/browser';
import { VariableContribution, VariableRegistry } from '@theia/variable-resolver/lib/browser';
@@ -28,6 +29,8 @@ export class WorkspaceVariableContribution implements VariableContribution {
protected readonly workspaceService: WorkspaceService;
@inject(ApplicationShell)
protected readonly shell: ApplicationShell;
@inject(FileSystem)
protected readonly fileSystem: FileSystem;

protected currentWidget: NavigatableWidget | undefined;

@@ -62,15 +65,15 @@ export class WorkspaceVariableContribution implements VariableContribution {
description: 'The path of the workspace root folder',
resolve: (context?: URI) => {
const uri = this.getWorkspaceRootUri(context);
return uri && uri.path.toString();
return uri && this.fileSystem.getFsPath(uri.toString());
}
});
variables.registerVariable({
name: 'workspaceFolder',
description: 'The path of the workspace root folder',
resolve: (context?: URI) => {
const uri = this.getWorkspaceRootUri(context);
return uri && uri.path.toString();
return uri && this.fileSystem.getFsPath(uri.toString());
}
});
variables.registerVariable({
@@ -86,15 +89,15 @@ export class WorkspaceVariableContribution implements VariableContribution {
description: 'The path of the current working directory',
resolve: (context?: URI) => {
const uri = this.getWorkspaceRootUri(context);
return (uri && uri.path.toString()) || '';
return (uri && this.fileSystem.getFsPath(uri.toString())) || '';
}
});
variables.registerVariable({
name: 'file',
description: 'The path of the currently opened file',
resolve: () => {
const uri = this.getResourceUri();
return uri && uri.path.toString();
return uri && this.fileSystem.getFsPath(uri.toString());
}
});
variables.registerVariable({