Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
da0845e8
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,发现更多精彩内容 >>
提交
da0845e8
编写于
5月 18, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
indicate preview state in editor picker
上级
e8d94213
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
2 deletion
+40
-2
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
+22
-0
src/vs/workbench/browser/parts/editor/editorPicker.ts
src/vs/workbench/browser/parts/editor/editorPicker.ts
+10
-2
src/vs/workbench/browser/parts/editor/media/editorPicker.css
src/vs/workbench/browser/parts/editor/media/editorPicker.css
+8
-0
未找到文件。
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
浏览文件 @
da0845e8
...
...
@@ -106,6 +106,13 @@ export class QuickOpenEntry {
return
null
;
}
/**
* Extra CSS class name to add to the quick open entry to do custom styling of entries.
*/
public
getExtraClass
():
string
{
return
null
;
}
/**
* Allows to reuse the same model while filtering. Hidden entries will not show up in the viewer.
*/
...
...
@@ -402,6 +409,10 @@ export class QuickOpenEntryGroup extends QuickOpenEntry {
return
this
.
entry
?
this
.
entry
.
getHighlights
()
:
super
.
getHighlights
();
}
public
getExtraClass
():
string
{
return
this
.
entry
?
this
.
entry
.
getExtraClass
()
:
super
.
getExtraClass
();
}
public
isHidden
():
boolean
{
return
this
.
entry
?
this
.
entry
.
isHidden
()
:
super
.
isHidden
();
}
...
...
@@ -463,6 +474,7 @@ class NoActionProvider implements IActionProvider {
export
interface
IQuickOpenEntryTemplateData
{
container
:
HTMLElement
;
entry
:
HTMLElement
;
icon
:
HTMLSpanElement
;
prefix
:
HTMLSpanElement
;
label
:
HighlightedLabel
;
...
...
@@ -569,6 +581,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
return
{
container
,
entry
,
icon
,
prefix
,
label
,
...
...
@@ -628,6 +641,14 @@ class Renderer implements IRenderer<QuickOpenEntry> {
if
(
entry
instanceof
QuickOpenEntry
)
{
let
[
labelHighlights
,
descriptionHighlights
,
detailHighlights
]
=
entry
.
getHighlights
();
// Extra Class
let
extraClass
=
entry
.
getExtraClass
();
if
(
extraClass
)
{
DOM
.
addClass
(
data
.
entry
,
extraClass
);
}
else
{
data
.
entry
.
className
=
'
quick-open-entry
'
;
}
// Icon
let
iconClass
=
entry
.
getIcon
()
?
(
'
quick-open-entry-icon
'
+
entry
.
getIcon
())
:
''
;
data
.
icon
.
className
=
iconClass
;
...
...
@@ -656,6 +677,7 @@ class Renderer implements IRenderer<QuickOpenEntry> {
data
.
actionBar
.
dispose
();
data
.
actionBar
=
null
;
data
.
container
=
null
;
data
.
entry
=
null
;
data
.
description
.
dispose
();
data
.
description
=
null
;
data
.
detail
.
dispose
();
...
...
src/vs/workbench/browser/parts/editor/editorPicker.ts
浏览文件 @
da0845e8
...
...
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
'
vs/css!./media/editorPicker
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
labels
=
require
(
'
vs/base/common/labels
'
);
...
...
@@ -18,9 +19,10 @@ import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/edito
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
EditorInput
,
asFileEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorGroup
}
from
'
vs/workbench/common/editor/editorStacksModel
'
;
import
{
IEditorGroup
,
IEditorStacksModel
}
from
'
vs/workbench/common/editor/editorStacksModel
'
;
export
class
EditorPickerEntry
extends
QuickOpenEntryGroup
{
private
stacks
:
IEditorStacksModel
;
constructor
(
private
editor
:
EditorInput
,
...
...
@@ -28,6 +30,8 @@ export class EditorPickerEntry extends QuickOpenEntryGroup {
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
)
{
super
();
this
.
stacks
=
editorService
.
getStacksModel
();
}
public
getPrefix
():
string
{
...
...
@@ -60,6 +64,10 @@ export class EditorPickerEntry extends QuickOpenEntryGroup {
return
this
.
editor
.
getDescription
();
}
public
getExtraClass
():
string
{
return
this
.
_group
.
isPreview
(
this
.
editor
)
?
'
editor-preview
'
:
''
;
}
public
run
(
mode
:
Mode
,
context
:
IContext
):
boolean
{
if
(
mode
===
Mode
.
OPEN
)
{
return
this
.
runOpen
(
context
);
...
...
@@ -69,7 +77,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup {
}
private
runOpen
(
context
:
IContext
):
boolean
{
this
.
editorService
.
openEditor
(
this
.
editor
,
null
,
this
.
editorService
.
getStacksModel
()
.
positionOfGroup
(
this
.
group
)).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
editorService
.
openEditor
(
this
.
editor
,
null
,
this
.
stacks
.
positionOfGroup
(
this
.
group
)).
done
(
null
,
errors
.
onUnexpectedError
);
return
true
;
}
...
...
src/vs/workbench/browser/parts/editor/media/editorPicker.css
0 → 100644
浏览文件 @
da0845e8
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-workbench
.quick-open-widget
.quick-open-tree
.quick-open-entry.editor-preview
{
font-style
:
italic
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录