Skip to content

Commit

Permalink
Normalize paths of workspace roots
Browse files Browse the repository at this point in the history
This avoids having workspace roots like /workspace/../../workspace when having relative paths in the workspace roots configuration.

Fixes eclipse-theia#7597

Signed-off-by: Cornelius A. Ludmann <cornelius.ludmann@typefox.io>
  • Loading branch information
corneliusludmann committed Apr 17, 2020
1 parent ebf7b78 commit 205d7ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/workspace/src/browser/workspace-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ export class WorkspaceService implements FrontendApplicationContribution {
if (uriStr.endsWith('/')) {
uriStr = uriStr.slice(0, -1);
}
const fileStat = await this.fileSystem.getFileStat(uriStr);
const normalizedUriStr = new URI(uriStr).normalizePath().toString();
const fileStat = await this.fileSystem.getFileStat(normalizedUriStr);
if (!fileStat) {
return undefined;
}
Expand Down

0 comments on commit 205d7ba

Please sign in to comment.