Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1264c0df
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1264c0df
编写于
6月 22, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
paths - allow to get at local userHome folder
上级
68bf05a5
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
16 addition
and
15 deletion
+16
-15
src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts
src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts
+1
-1
src/vs/workbench/contrib/externalTerminal/node/externalTerminal.contribution.ts
...ib/externalTerminal/node/externalTerminal.contribution.ts
+1
-1
src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
...s/workbench/contrib/search/browser/anythingQuickAccess.ts
+1
-1
src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.ts
...rkbench/contrib/searchEditor/browser/searchEditorInput.ts
+1
-1
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
+1
-1
src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts
...kbench/contrib/terminal/browser/terminalProcessManager.ts
+1
-1
src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
...vs/workbench/services/dialogs/browser/simpleFileDialog.ts
+2
-2
src/vs/workbench/services/path/common/pathService.ts
src/vs/workbench/services/path/common/pathService.ts
+6
-5
src/vs/workbench/services/textfile/browser/textFileService.ts
...vs/workbench/services/textfile/browser/textFileService.ts
+1
-1
src/vs/workbench/test/browser/workbenchTestServices.ts
src/vs/workbench/test/browser/workbenchTestServices.ts
+1
-1
未找到文件。
src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts
浏览文件 @
1264c0df
...
...
@@ -348,7 +348,7 @@ class SessionTreeItem extends BaseTreeItem {
// on unix try to tildify absolute paths
path
=
normalize
(
path
);
if
(
!
isWindows
)
{
path
=
tildify
(
path
,
(
await
this
.
_pathService
.
userHome
).
fsPath
);
path
=
tildify
(
path
,
(
await
this
.
_pathService
.
userHome
()
).
fsPath
);
}
}
}
...
...
src/vs/workbench/contrib/externalTerminal/node/externalTerminal.contribution.ts
浏览文件 @
1264c0df
...
...
@@ -40,7 +40,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
terminalService
.
openTerminal
(
paths
.
dirname
(
activeFile
.
fsPath
));
}
else
{
const
pathService
=
accessor
.
get
(
IPathService
);
const
userHome
=
await
pathService
.
userHome
;
const
userHome
=
await
pathService
.
userHome
()
;
terminalService
.
openTerminal
(
userHome
.
fsPath
);
}
}
...
...
src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
浏览文件 @
1264c0df
...
...
@@ -643,7 +643,7 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
return
;
}
const
userHome
=
await
this
.
pathService
.
userHome
;
const
userHome
=
await
this
.
pathService
.
userHome
()
;
const
detildifiedQuery
=
untildify
(
query
.
original
,
userHome
.
scheme
===
Schemas
.
file
?
userHome
.
fsPath
:
userHome
.
path
);
if
(
token
.
isCancellationRequested
)
{
return
;
...
...
src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.ts
浏览文件 @
1264c0df
...
...
@@ -280,7 +280,7 @@ export class SearchEditorInput extends EditorInput {
const
remoteAuthority
=
this
.
environmentService
.
configuration
.
remoteAuthority
;
const
schemeFilter
=
remoteAuthority
?
network
.
Schemas
.
vscodeRemote
:
network
.
Schemas
.
file
;
return
joinPath
(
this
.
fileDialogService
.
defaultFilePath
(
schemeFilter
)
||
(
await
this
.
pathService
.
userHome
),
searchFileName
);
return
joinPath
(
this
.
fileDialogService
.
defaultFilePath
(
schemeFilter
)
||
(
await
this
.
pathService
.
userHome
()
),
searchFileName
);
}
}
...
...
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
浏览文件 @
1264c0df
...
...
@@ -968,7 +968,7 @@ export class TerminalTaskSystem implements ITaskSystem {
windowsShellArgs
=
true
;
let
basename
=
path
.
basename
(
shellLaunchConfig
.
executable
!
).
toLowerCase
();
// If we don't have a cwd, then the terminal uses the home dir.
const
userHome
=
await
this
.
pathService
.
userHome
;
const
userHome
=
await
this
.
pathService
.
userHome
()
;
if
(
basename
===
'
cmd.exe
'
&&
((
options
.
cwd
&&
isUNC
(
options
.
cwd
))
||
(
!
options
.
cwd
&&
isUNC
(
userHome
.
fsPath
))))
{
return
undefined
;
}
...
...
src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts
浏览文件 @
1264c0df
...
...
@@ -146,7 +146,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
this
.
userHome
=
this
.
_pathService
.
resolvedUserHome
?.
fsPath
;
this
.
os
=
platform
.
OS
;
if
(
launchRemotely
)
{
const
userHomeUri
=
await
this
.
_pathService
.
userHome
;
const
userHomeUri
=
await
this
.
_pathService
.
userHome
()
;
this
.
userHome
=
userHomeUri
.
path
;
if
(
hasRemoteAuthority
)
{
const
remoteEnv
=
await
this
.
_remoteAgentService
.
getEnvironment
();
...
...
src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
浏览文件 @
1264c0df
...
...
@@ -231,8 +231,8 @@ export class SimpleFileDialog {
return
this
.
remoteAgentEnvironment
;
}
protected
async
getUserHome
():
Promise
<
URI
>
{
return
(
await
this
.
pathService
.
userHome
)
??
URI
.
from
({
scheme
:
this
.
scheme
,
authority
:
this
.
remoteAuthority
,
path
:
'
/
'
});
protected
getUserHome
():
Promise
<
URI
>
{
return
this
.
pathService
.
userHome
({
preferLocal
:
this
.
scheme
===
Schemas
.
file
});
}
private
async
pickResource
(
isSave
:
boolean
=
false
):
Promise
<
URI
|
undefined
>
{
...
...
src/vs/workbench/services/path/common/pathService.ts
浏览文件 @
1264c0df
...
...
@@ -40,9 +40,10 @@ export interface IPathService {
/**
* Resolves the user-home directory for the target environment.
* If the envrionment is connected to a remote, this will be the
* remote's user home directory, otherwise the local one.
* remote's user home directory, otherwise the local one unless
* `preferLocal` is set to `true`.
*/
readonly
userHome
:
Promise
<
URI
>
;
userHome
(
options
?:
{
preferLocal
:
boolean
})
:
Promise
<
URI
>
;
/**
* @deprecated use `userHome` instead.
...
...
@@ -60,7 +61,7 @@ export abstract class AbstractPathService implements IPathService {
private
maybeUnresolvedUserHome
:
URI
|
undefined
;
constructor
(
localUserHome
:
URI
,
private
localUserHome
:
URI
,
@
IRemoteAgentService
private
readonly
remoteAgentService
:
IRemoteAgentService
)
{
...
...
@@ -81,8 +82,8 @@ export abstract class AbstractPathService implements IPathService {
})();
}
get
userHome
(
):
Promise
<
URI
>
{
return
this
.
resolveUserHome
;
async
userHome
(
options
?:
{
preferLocal
:
boolean
}
):
Promise
<
URI
>
{
return
options
?.
preferLocal
?
this
.
localUserHome
:
this
.
resolveUserHome
;
}
get
resolvedUserHome
():
URI
|
undefined
{
...
...
src/vs/workbench/services/textfile/browser/textFileService.ts
浏览文件 @
1264c0df
...
...
@@ -462,7 +462,7 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
// Try to place where last active file was if any
// Otherwise fallback to user home
return
joinPath
(
this
.
fileDialogService
.
defaultFilePath
()
||
(
await
this
.
pathService
.
userHome
),
suggestedFilename
);
return
joinPath
(
this
.
fileDialogService
.
defaultFilePath
()
||
(
await
this
.
pathService
.
userHome
()
),
suggestedFilename
);
}
//#endregion
...
...
src/vs/workbench/test/browser/workbenchTestServices.ts
浏览文件 @
1264c0df
...
...
@@ -1154,7 +1154,7 @@ export class TestPathService implements IPathService {
get
path
()
{
return
Promise
.
resolve
(
isWindows
?
win32
:
posix
);
}
get
userHome
()
{
return
Promise
.
resolve
(
this
.
fallbackUserHome
)
;
}
async
userHome
()
{
return
this
.
fallbackUserHome
;
}
get
resolvedUserHome
()
{
return
this
.
fallbackUserHome
;
}
async
fileURI
(
path
:
string
):
Promise
<
URI
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录