Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d33df695
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,发现更多精彩内容 >>
提交
d33df695
编写于
7月 27, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - adopt UriDisplayService for reference search
上级
2ba14ee1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
62 deletion
+15
-62
src/vs/editor/contrib/referenceSearch/referencesController.ts
...vs/editor/contrib/referenceSearch/referencesController.ts
+2
-10
src/vs/editor/contrib/referenceSearch/referencesModel.ts
src/vs/editor/contrib/referenceSearch/referencesModel.ts
+1
-17
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
+8
-7
src/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.ts
...lone/browser/referenceSearch/standaloneReferenceSearch.ts
+1
-13
src/vs/workbench/parts/codeEditor/electron-browser/workbenchReferenceSearch.ts
...s/codeEditor/electron-browser/workbenchReferenceSearch.ts
+3
-15
未找到文件。
src/vs/editor/contrib/referenceSearch/referencesController.ts
浏览文件 @
d33df695
...
...
@@ -9,20 +9,16 @@ import { onUnexpectedError } from 'vs/base/common/errors';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
IInstantiationService
,
optional
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IContextKey
,
IContextKeyService
,
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
ReferencesModel
}
from
'
./referencesModel
'
;
import
{
ReferenceWidget
,
LayoutData
}
from
'
./referencesWidget
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
Location
}
from
'
vs/editor/common/modes
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
CancelablePromise
}
from
'
vs/base/common/async
'
;
...
...
@@ -56,14 +52,10 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
editor
:
ICodeEditor
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
ICodeEditorService
private
readonly
_editorService
:
ICodeEditorService
,
@
ITextModelService
private
readonly
_textModelResolverService
:
ITextModelService
,
@
INotificationService
private
readonly
_notificationService
:
INotificationService
,
@
IInstantiationService
private
readonly
_instantiationService
:
IInstantiationService
,
@
IWorkspaceContextService
private
readonly
_contextService
:
IWorkspaceContextService
,
@
IStorageService
private
readonly
_storageService
:
IStorageService
,
@
IThemeService
private
readonly
_themeService
:
IThemeService
,
@
IConfigurationService
private
readonly
_configurationService
:
IConfigurationService
,
@
optional
(
IEnvironmentService
)
private
_environmentService
:
IEnvironmentService
)
{
this
.
_editor
=
editor
;
this
.
_referenceSearchVisible
=
ctxReferenceSearchVisible
.
bindTo
(
contextKeyService
);
...
...
@@ -106,7 +98,7 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
}));
const
storageKey
=
'
peekViewLayout
'
;
const
data
=
<
LayoutData
>
JSON
.
parse
(
this
.
_storageService
.
get
(
storageKey
,
undefined
,
'
{}
'
));
this
.
_widget
=
new
ReferenceWidget
(
this
.
_editor
,
this
.
_defaultTreeKeyboardSupport
,
data
,
this
.
_textModelResolverService
,
this
.
_contextService
,
this
.
_themeService
,
this
.
_instantiationService
,
this
.
_environmentService
);
this
.
_widget
=
this
.
_instantiationService
.
createInstance
(
ReferenceWidget
,
this
.
_editor
,
this
.
_defaultTreeKeyboardSupport
,
data
);
this
.
_widget
.
setTitle
(
nls
.
localize
(
'
labelLoading
'
,
"
Loading...
"
));
this
.
_widget
.
show
(
range
);
this
.
_disposables
.
push
(
this
.
_widget
.
onDidClose
(()
=>
{
...
...
src/vs/editor/contrib/referenceSearch/referencesModel.ts
浏览文件 @
d33df695
...
...
@@ -6,7 +6,7 @@
import
{
localize
}
from
'
vs/nls
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
basename
,
dirname
}
from
'
vs/base/common/paths
'
;
import
{
basename
}
from
'
vs/base/common/paths
'
;
import
{
IDisposable
,
dispose
,
IReference
}
from
'
vs/base/common/lifecycle
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
URI
from
'
vs/base/common/uri
'
;
...
...
@@ -46,14 +46,6 @@ export class OneReference {
return
this
.
_parent
.
uri
;
}
public
get
name
():
string
{
return
this
.
_parent
.
name
;
}
public
get
directory
():
string
{
return
this
.
_parent
.
directory
;
}
public
get
range
():
IRange
{
return
this
.
_range
;
}
...
...
@@ -135,14 +127,6 @@ export class FileReferences implements IDisposable {
return
this
.
_uri
;
}
public
get
name
():
string
{
return
basename
(
this
.
uri
.
fsPath
);
}
public
get
directory
():
string
{
return
dirname
(
this
.
uri
.
fsPath
);
}
public
get
preview
():
FilePreview
{
return
this
.
_preview
;
}
...
...
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
浏览文件 @
d33df695
...
...
@@ -7,7 +7,6 @@
import
'
vs/css!./media/referencesWidget
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
getPathLabel
}
from
'
vs/base/common/labels
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
,
dispose
,
IReference
}
from
'
vs/base/common/lifecycle
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
...
...
@@ -44,6 +43,9 @@ import { WorkbenchTree, WorkbenchTreeController } from 'vs/platform/list/browser
import
{
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
Location
}
from
'
vs/editor/common/modes
'
;
import
{
ClickBehavior
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
IUriDisplayService
}
from
'
vs/platform/uriDisplay/common/uriDisplay
'
;
import
{
dirname
,
basenameOrAuthority
}
from
'
vs/base/common/resources
'
;
class
DecorationsManager
implements
IDisposable
{
...
...
@@ -530,11 +532,10 @@ export class ReferenceWidget extends PeekViewWidget {
editor
:
ICodeEditor
,
private
_defaultTreeKeyboardSupport
:
boolean
,
public
layoutData
:
LayoutData
,
private
_textModelResolverService
:
ITextModelService
,
private
_contextService
:
IWorkspaceContextService
,
themeService
:
IThemeService
,
private
_instantiationService
:
IInstantiationService
,
private
_environmentService
:
IEnvironmentService
@
IThemeService
themeService
:
IThemeService
,
@
ITextModelService
private
_textModelResolverService
:
ITextModelService
,
@
IInstantiationService
private
_instantiationService
:
IInstantiationService
,
@
IUriDisplayService
private
_uriDisplay
:
IUriDisplayService
)
{
super
(
editor
,
{
showFrame
:
false
,
showArrow
:
true
,
isResizeable
:
true
,
isAccessible
:
true
});
...
...
@@ -780,7 +781,7 @@ export class ReferenceWidget extends PeekViewWidget {
// Update widget header
if
(
reference
.
uri
.
scheme
!==
Schemas
.
inMemory
)
{
this
.
setTitle
(
reference
.
name
,
getPathLabel
(
reference
.
directory
,
this
.
_environmentService
,
this
.
_contextServic
e
));
this
.
setTitle
(
basenameOrAuthority
(
reference
.
uri
),
this
.
_uriDisplay
.
getLabel
(
dirname
(
reference
.
uri
),
fals
e
));
}
else
{
this
.
setTitle
(
nls
.
localize
(
'
peekView.alternateTitle
'
,
"
References
"
));
}
...
...
src/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.ts
浏览文件 @
d33df695
...
...
@@ -5,16 +5,12 @@
'
use strict
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
IInstantiationService
,
optional
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
registerEditorContribution
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
ReferencesController
}
from
'
vs/editor/contrib/referenceSearch/referencesController
'
;
...
...
@@ -24,28 +20,20 @@ export class StandaloneReferencesController extends ReferencesController {
editor
:
ICodeEditor
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
ICodeEditorService
editorService
:
ICodeEditorService
,
@
ITextModelService
textModelResolverService
:
ITextModelService
,
@
INotificationService
notificationService
:
INotificationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IStorageService
storageService
:
IStorageService
,
@
IThemeService
themeService
:
IThemeService
,
@
IConfigurationService
configurationService
:
IConfigurationService
,
@
optional
(
IEnvironmentService
)
environmentService
:
IEnvironmentService
)
{
super
(
true
,
editor
,
contextKeyService
,
editorService
,
textModelResolverService
,
notificationService
,
instantiationService
,
contextService
,
storageService
,
themeService
,
configurationService
,
environmentService
);
}
}
...
...
src/vs/workbench/parts/codeEditor/electron-browser/workbenchReferenceSearch.ts
浏览文件 @
d33df695
...
...
@@ -4,16 +4,12 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
IInstantiationService
,
optional
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
registerEditorContribution
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
ReferencesController
}
from
'
vs/editor/contrib/referenceSearch/referencesController
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
...
...
@@ -23,29 +19,21 @@ export class WorkbenchReferencesController extends ReferencesController {
public
constructor
(
editor
:
ICodeEditor
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
ITextModelService
textModelResolverService
:
ITextModelService
,
@
ICodeEditorService
editorService
:
ICodeEditorService
,
@
INotificationService
notificationService
:
INotificationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IStorageService
storageService
:
IStorageService
,
@
IThemeService
themeService
:
IThemeService
,
@
IConfigurationService
configurationService
:
IConfigurationService
,
@
optional
(
IEnvironmentService
)
environmentService
:
IEnvironmentService
)
{
super
(
false
,
editor
,
contextKeyService
,
codeEditorService
,
textModelResolverService
,
editorService
,
notificationService
,
instantiationService
,
contextService
,
storageService
,
themeService
,
configurationService
,
environmentService
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录