mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-27 21:52:59 +00:00
paths - move path to extpath
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import * as path from 'vs/base/common/paths.node';
|
||||
import * as arrays from 'vs/base/common/arrays';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
import * as extpath from 'vs/base/common/extpath';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
@@ -48,7 +48,7 @@ function doValidatePaths(args: string[], gotoLineMode?: boolean): string[] {
|
||||
const sanitizedFilePath = sanitizeFilePath(pathCandidate, cwd);
|
||||
|
||||
const basename = path.basename(sanitizedFilePath);
|
||||
if (basename /* can be empty if code is opened on root */ && !paths.isValidBasename(basename)) {
|
||||
if (basename /* can be empty if code is opened on root */ && !extpath.isValidBasename(basename)) {
|
||||
return null; // do not allow invalid file names
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
import * as extpath from 'vs/base/common/extpath';
|
||||
import { OpenContext } from 'vs/platform/windows/common/windows';
|
||||
import { IWorkspaceIdentifier, IResolvedWorkspace, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
@@ -98,7 +98,7 @@ export function findWindowOnWorkspace<W extends ISimpleWindow>(windows: W[], wor
|
||||
export function findWindowOnExtensionDevelopmentPath<W extends ISimpleWindow>(windows: W[], extensionDevelopmentPath: string): W | null {
|
||||
for (const window of windows) {
|
||||
// match on extension development path. The path can be a path or uri string, using paths.isEqual is not 100% correct but good enough
|
||||
if (window.extensionDevelopmentPath && paths.isEqual(window.extensionDevelopmentPath, extensionDevelopmentPath, !platform.isLinux /* ignorecase */)) {
|
||||
if (window.extensionDevelopmentPath && extpath.isEqual(window.extensionDevelopmentPath, extensionDevelopmentPath, !platform.isLinux /* ignorecase */)) {
|
||||
return window;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user