Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
ec337988
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ec337988
编写于
1月 22, 2021
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
parseUri/Path => resolveUri/Path
上级
3f26fd17
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
src/vs/platform/windows/electron-main/windowsMainService.ts
src/vs/platform/windows/electron-main/windowsMainService.ts
+13
-13
未找到文件。
src/vs/platform/windows/electron-main/windowsMainService.ts
浏览文件 @
ec337988
...
...
@@ -661,7 +661,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
continue
;
}
const
path
=
this
.
pars
eUri
(
pathToOpen
,
parseOptions
);
const
path
=
this
.
resolv
eUri
(
pathToOpen
,
parseOptions
);
if
(
path
)
{
path
.
label
=
pathToOpen
.
label
;
pathsToOpen
.
push
(
path
);
...
...
@@ -697,7 +697,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
for
(
const
rawFolderUri
of
folderUris
)
{
const
folderUri
=
this
.
argToUri
(
rawFolderUri
);
if
(
folderUri
)
{
const
path
=
this
.
pars
eUri
({
folderUri
},
parseOptions
);
const
path
=
this
.
resolv
eUri
({
folderUri
},
parseOptions
);
if
(
path
)
{
pathsToOpen
.
push
(
path
);
}
...
...
@@ -711,7 +711,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
for
(
const
rawFileUri
of
fileUris
)
{
const
fileUri
=
this
.
argToUri
(
rawFileUri
);
if
(
fileUri
)
{
const
path
=
this
.
pars
eUri
(
hasWorkspaceFileExtension
(
rawFileUri
)
?
{
workspaceUri
:
fileUri
}
:
{
fileUri
},
parseOptions
);
const
path
=
this
.
resolv
eUri
(
hasWorkspaceFileExtension
(
rawFileUri
)
?
{
workspaceUri
:
fileUri
}
:
{
fileUri
},
parseOptions
);
if
(
path
)
{
pathsToOpen
.
push
(
path
);
}
...
...
@@ -722,7 +722,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
// folder or file paths
const
cliPaths
=
cli
.
_
;
for
(
const
cliPath
of
cliPaths
)
{
const
path
=
this
.
pars
ePath
(
cliPath
,
parseOptions
);
const
path
=
this
.
resolv
ePath
(
cliPath
,
parseOptions
);
if
(
path
)
{
pathsToOpen
.
push
(
path
);
}
...
...
@@ -767,7 +767,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
// Workspaces
if
(
lastSessionWindow
.
workspace
)
{
const
pathToOpen
=
this
.
pars
eUri
({
workspaceUri
:
lastSessionWindow
.
workspace
.
configPath
},
{
remoteAuthority
:
lastSessionWindow
.
remoteAuthority
});
const
pathToOpen
=
this
.
resolv
eUri
({
workspaceUri
:
lastSessionWindow
.
workspace
.
configPath
},
{
remoteAuthority
:
lastSessionWindow
.
remoteAuthority
});
if
(
isWorkspacePathToOpen
(
pathToOpen
))
{
pathsToOpen
.
push
(
pathToOpen
);
}
...
...
@@ -775,7 +775,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
// Folders
else
if
(
lastSessionWindow
.
folderUri
)
{
const
pathToOpen
=
this
.
pars
eUri
({
folderUri
:
lastSessionWindow
.
folderUri
},
{
remoteAuthority
:
lastSessionWindow
.
remoteAuthority
});
const
pathToOpen
=
this
.
resolv
eUri
({
folderUri
:
lastSessionWindow
.
folderUri
},
{
remoteAuthority
:
lastSessionWindow
.
remoteAuthority
});
if
(
isSingleFolderWorkspacePathToOpen
(
pathToOpen
))
{
pathsToOpen
.
push
(
pathToOpen
);
}
...
...
@@ -824,7 +824,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
return
undefined
;
}
private
pars
eUri
(
toOpen
:
IWindowOpenable
,
options
:
IPathParseOptions
=
{}):
IPathToOpen
|
undefined
{
private
resolv
eUri
(
toOpen
:
IWindowOpenable
,
options
:
IPathParseOptions
=
{}):
IPathToOpen
|
undefined
{
if
(
!
toOpen
)
{
return
undefined
;
}
...
...
@@ -832,7 +832,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
// handle local files in `parsePath` with some extra validation
let
uri
=
this
.
resourceFromURIToOpen
(
toOpen
);
if
(
uri
.
scheme
===
Schemas
.
file
)
{
return
this
.
pars
ePath
(
uri
.
fsPath
,
options
,
isFileToOpen
(
toOpen
));
return
this
.
resolv
ePath
(
uri
.
fsPath
,
options
,
isFileToOpen
(
toOpen
));
}
// open remote if either specified in the cli or if it's a remotehost URI
...
...
@@ -890,7 +890,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
return
openable
.
fileUri
;
}
private
pars
ePath
(
path
:
string
,
options
:
IPathParseOptions
,
forceOpenWorkspaceAsFile
?:
boolean
):
IPathToOpen
|
undefined
{
private
resolv
ePath
(
path
:
string
,
options
:
IPathParseOptions
,
forceOpenWorkspaceAsFile
?:
boolean
):
IPathToOpen
|
undefined
{
if
(
!
path
)
{
return
undefined
;
}
...
...
@@ -910,14 +910,14 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
// Handle remote paths
const
remoteAuthority
=
options
.
remoteAuthority
;
if
(
remoteAuthority
)
{
return
this
.
pars
eRemotePath
(
path
,
remoteAuthority
,
forceOpenWorkspaceAsFile
);
return
this
.
resolv
eRemotePath
(
path
,
remoteAuthority
,
forceOpenWorkspaceAsFile
);
}
// Handle local paths
return
this
.
pars
eLocalPath
(
path
,
options
,
lineNumber
,
columnNumber
,
forceOpenWorkspaceAsFile
);
return
this
.
resolv
eLocalPath
(
path
,
options
,
lineNumber
,
columnNumber
,
forceOpenWorkspaceAsFile
);
}
private
pars
eRemotePath
(
path
:
string
,
remoteAuthority
:
string
,
forceOpenWorkspaceAsFile
?:
boolean
):
IPathToOpen
|
undefined
{
private
resolv
eRemotePath
(
path
:
string
,
remoteAuthority
:
string
,
forceOpenWorkspaceAsFile
?:
boolean
):
IPathToOpen
|
undefined
{
const
first
=
path
.
charCodeAt
(
0
);
// make absolute
...
...
@@ -950,7 +950,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
return
{
workspace
:
getSingleFolderWorkspaceIdentifier
(
uri
),
remoteAuthority
};
}
private
pars
eLocalPath
(
path
:
string
,
options
:
IPathParseOptions
,
lineNumber
:
number
|
undefined
,
columnNumber
:
number
|
undefined
,
forceOpenWorkspaceAsFile
?:
boolean
):
IPathToOpen
|
undefined
{
private
resolv
eLocalPath
(
path
:
string
,
options
:
IPathParseOptions
,
lineNumber
:
number
|
undefined
,
columnNumber
:
number
|
undefined
,
forceOpenWorkspaceAsFile
?:
boolean
):
IPathToOpen
|
undefined
{
// Ensure the path is normalized and absolute
path
=
sanitizeFilePath
(
normalize
(
path
),
process
.
env
[
'
VSCODE_CWD
'
]
||
process
.
cwd
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录