Normalize uri-paths before attempting to open them? Fixes #54990

This commit is contained in:
Martin Aeschlimann
2018-08-13 16:48:26 +02:00
parent ce15d8c355
commit dd31f42c0c

View File

@@ -37,7 +37,8 @@ import { normalizeNFC } from 'vs/base/common/normalization';
import URI from 'vs/base/common/uri';
import { Queue } from 'vs/base/common/async';
import { exists } from 'vs/base/node/pfs';
import { getComparisonKey, isEqual, hasToIgnoreCase } from 'vs/base/common/resources';
import { getComparisonKey, isEqual, hasToIgnoreCase, normalizePath } from 'vs/base/common/resources';
import { endsWith } from 'vs/base/common/strings';
enum WindowError {
UNRESPONSIVE,
@@ -1016,6 +1017,11 @@ export class WindowsManager implements IWindowsMainService {
if (uri.scheme === Schemas.file) {
return this.parsePath(uri.fsPath, options);
}
// normalize URI
uri = normalizePath(uri);
if (endsWith(uri.path, '/')) {
uri = uri.with({ path: uri.path.substr(0, uri.path.length - 1) });
}
if (isFile) {
if (options && options.gotoLineMode) {
const parsedPath = parseLineAndColumnAware(uri.path);