Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
05188623
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,发现更多精彩内容 >>
提交
05188623
编写于
4月 06, 2020
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
do not use envService.userHome
#94506
上级
0fdef6e7
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
15 addition
and
13 deletion
+15
-13
src/vs/workbench/contrib/debug/browser/linkDetector.ts
src/vs/workbench/contrib/debug/browser/linkDetector.ts
+3
-3
src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts
src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts
+7
-7
src/vs/workbench/services/label/common/labelService.ts
src/vs/workbench/services/label/common/labelService.ts
+3
-1
src/vs/workbench/services/label/test/browser/label.test.ts
src/vs/workbench/services/label/test/browser/label.test.ts
+2
-2
未找到文件。
src/vs/workbench/contrib/debug/browser/linkDetector.ts
浏览文件 @
05188623
...
...
@@ -7,12 +7,12 @@ import * as osPath from 'vs/base/common/path';
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IRemotePathService
}
from
'
vs/workbench/services/path/common/remotePathService
'
;
const
CONTROL_CODES
=
'
\\
u0000-
\\
u0020
\\
u007f-
\\
u009f
'
;
const
WEB_LINK_REGEX
=
new
RegExp
(
'
(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:
\\
/
\\
/|data:|www
\\
.)[^
\\
s
'
+
CONTROL_CODES
+
'
"]{2,}[^
\\
s
'
+
CONTROL_CODES
+
'
"
\'
)}
\\
],:;.!?]
'
,
'
ug
'
);
...
...
@@ -38,7 +38,7 @@ export class LinkDetector {
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
IFileService
private
readonly
fileService
:
IFileService
,
@
IOpenerService
private
readonly
openerService
:
IOpenerService
,
@
I
EnvironmentService
private
readonly
environmentService
:
IEnvironment
Service
,
@
I
RemotePathService
private
readonly
remotePathService
:
IRemotePath
Service
,
@
IWorkbenchEnvironmentService
private
readonly
workbenchEnvironmentService
:
IWorkbenchEnvironmentService
)
{
// noop
...
...
@@ -120,7 +120,7 @@ export class LinkDetector {
}
if
(
path
[
0
]
===
'
~
'
)
{
const
userHome
=
this
.
environmentService
.
userHome
;
const
userHome
=
this
.
remotePathService
.
userHomeSync
;
if
(
userHome
)
{
path
=
osPath
.
join
(
userHome
.
fsPath
,
path
.
substring
(
1
));
}
...
...
src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts
浏览文件 @
05188623
...
...
@@ -17,7 +17,6 @@ import { IDebugSession, IDebugService, CONTEXT_LOADED_SCRIPTS_ITEM_TYPE } from '
import
{
Source
}
from
'
vs/workbench/contrib/debug/common/debugSource
'
;
import
{
IWorkspaceContextService
,
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
tildify
}
from
'
vs/base/common/labels
'
;
import
{
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
...
...
@@ -40,6 +39,7 @@ import { IViewDescriptorService } from 'vs/workbench/common/views';
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IRemotePathService
}
from
'
vs/workbench/services/path/common/remotePathService
'
;
const
NEW_STYLE_COMPRESS
=
true
;
...
...
@@ -241,12 +241,12 @@ class RootFolderTreeItem extends BaseTreeItem {
class
RootTreeItem
extends
BaseTreeItem
{
constructor
(
private
_
environmentService
:
IEnvironment
Service
,
private
_contextService
:
IWorkspaceContextService
,
private
_labelService
:
ILabelService
)
{
constructor
(
private
_
remotePathService
:
IRemotePath
Service
,
private
_contextService
:
IWorkspaceContextService
,
private
_labelService
:
ILabelService
)
{
super
(
undefined
,
'
Root
'
);
}
add
(
session
:
IDebugSession
):
SessionTreeItem
{
return
this
.
createIfNeeded
(
session
.
getId
(),
()
=>
new
SessionTreeItem
(
this
.
_labelService
,
this
,
session
,
this
.
_
environment
Service
,
this
.
_contextService
));
return
this
.
createIfNeeded
(
session
.
getId
(),
()
=>
new
SessionTreeItem
(
this
.
_labelService
,
this
,
session
,
this
.
_
remotePath
Service
,
this
.
_contextService
));
}
find
(
session
:
IDebugSession
):
SessionTreeItem
{
...
...
@@ -262,7 +262,7 @@ class SessionTreeItem extends BaseTreeItem {
private
_map
=
new
Map
<
string
,
BaseTreeItem
>
();
private
_labelService
:
ILabelService
;
constructor
(
labelService
:
ILabelService
,
parent
:
BaseTreeItem
,
session
:
IDebugSession
,
private
_
environmentService
:
IEnvironment
Service
,
private
rootProvider
:
IWorkspaceContextService
)
{
constructor
(
labelService
:
ILabelService
,
parent
:
BaseTreeItem
,
session
:
IDebugSession
,
private
_
remotePathService
:
IRemotePath
Service
,
private
rootProvider
:
IWorkspaceContextService
)
{
super
(
parent
,
session
.
getLabel
(),
true
);
this
.
_labelService
=
labelService
;
this
.
_session
=
session
;
...
...
@@ -347,7 +347,7 @@ class SessionTreeItem extends BaseTreeItem {
}
else
{
// on unix try to tildify absolute paths
path
=
normalize
(
path
);
const
userHome
=
this
.
_
environmentService
.
userHome
;
const
userHome
=
this
.
_
remotePathService
.
userHomeSync
;
if
(
userHome
&&
!
isWindows
)
{
path
=
tildify
(
path
,
userHome
.
fsPath
);
}
...
...
@@ -424,9 +424,9 @@ export class LoadedScriptsView extends ViewPane {
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
IContextKeyService
readonly
contextKeyService
:
IContextKeyService
,
@
IWorkspaceContextService
private
readonly
contextService
:
IWorkspaceContextService
,
@
IEnvironmentService
private
readonly
environmentService
:
IEnvironmentService
,
@
IDebugService
private
readonly
debugService
:
IDebugService
,
@
ILabelService
private
readonly
labelService
:
ILabelService
,
@
IRemotePathService
private
readonly
remotePathService
:
IRemotePathService
,
@
IOpenerService
openerService
:
IOpenerService
,
@
IThemeService
themeService
:
IThemeService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
...
...
@@ -446,7 +446,7 @@ export class LoadedScriptsView extends ViewPane {
this
.
filter
=
new
LoadedScriptsFilter
();
const
root
=
new
RootTreeItem
(
this
.
environment
Service
,
this
.
contextService
,
this
.
labelService
);
const
root
=
new
RootTreeItem
(
this
.
remotePath
Service
,
this
.
contextService
,
this
.
labelService
);
this
.
treeLabels
=
this
.
instantiationService
.
createInstance
(
ResourceLabels
,
{
onDidChangeVisibility
:
this
.
onDidChangeBodyVisibility
});
this
.
_register
(
this
.
treeLabels
);
...
...
src/vs/workbench/services/label/common/labelService.ts
浏览文件 @
05188623
...
...
@@ -21,6 +21,7 @@ import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/exte
import
{
match
}
from
'
vs/base/common/glob
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IRemotePathService
}
from
'
vs/workbench/services/path/common/remotePathService
'
;
const
resourceLabelFormattersExtPoint
=
ExtensionsRegistry
.
registerExtensionPoint
<
ResourceLabelFormatter
[]
>
({
extensionPoint
:
'
resourceLabelFormatters
'
,
...
...
@@ -101,6 +102,7 @@ export class LabelService extends Disposable implements ILabelService {
constructor
(
@
IEnvironmentService
private
readonly
environmentService
:
IEnvironmentService
,
@
IWorkspaceContextService
private
readonly
contextService
:
IWorkspaceContextService
,
@
IRemotePathService
private
readonly
remotePathService
:
IRemotePathService
)
{
super
();
}
...
...
@@ -264,7 +266,7 @@ export class LabelService extends Disposable implements ILabelService {
}
if
(
formatting
.
tildify
&&
!
forceNoTildify
)
{
const
userHome
=
this
.
environmentService
.
userHome
;
const
userHome
=
this
.
remotePathService
.
userHomeSync
;
if
(
userHome
)
{
label
=
tildify
(
label
,
userHome
.
fsPath
);
}
...
...
src/vs/workbench/services/label/test/browser/label.test.ts
浏览文件 @
05188623
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
TestEnvironmentService
}
from
'
vs/workbench/test/browser/workbenchTestServices
'
;
import
{
TestEnvironmentService
,
TestRemotePathService
}
from
'
vs/workbench/test/browser/workbenchTestServices
'
;
import
{
TestWorkspace
}
from
'
vs/platform/workspace/test/common/testWorkspace
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
sep
}
from
'
vs/base/common/path
'
;
...
...
@@ -17,7 +17,7 @@ suite('URI Label', () => {
let
labelService
:
LabelService
;
setup
(()
=>
{
labelService
=
new
LabelService
(
TestEnvironmentService
,
new
TestContextService
());
labelService
=
new
LabelService
(
TestEnvironmentService
,
new
TestContextService
()
,
new
TestRemotePathService
(
TestEnvironmentService
)
);
});
test
(
'
file scheme
'
,
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录