Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
043a0654
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,发现更多精彩内容 >>
提交
043a0654
编写于
8月 23, 2019
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add SymbolInformation.tags, render deprecated items in quick outline and workspace symbol search
上级
87c7042e
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
53 addition
and
39 deletion
+53
-39
src/vs/editor/contrib/documentSymbols/media/outlineTree.css
src/vs/editor/contrib/documentSymbols/media/outlineTree.css
+0
-5
src/vs/editor/contrib/documentSymbols/media/symbol-icons.css
src/vs/editor/contrib/documentSymbols/media/symbol-icons.css
+5
-0
src/vs/editor/contrib/quickOpen/quickOpen.ts
src/vs/editor/contrib/quickOpen/quickOpen.ts
+1
-1
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+7
-0
src/vs/workbench/api/common/extHostLanguageFeatures.ts
src/vs/workbench/api/common/extHostLanguageFeatures.ts
+2
-2
src/vs/workbench/api/common/extHostTypeConverters.ts
src/vs/workbench/api/common/extHostTypeConverters.ts
+4
-1
src/vs/workbench/api/common/extHostTypes.ts
src/vs/workbench/api/common/extHostTypes.ts
+1
-0
src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts
.../workbench/contrib/quickopen/browser/gotoSymbolHandler.ts
+23
-28
src/vs/workbench/contrib/search/browser/openSymbolHandler.ts
src/vs/workbench/contrib/search/browser/openSymbolHandler.ts
+8
-1
src/vs/workbench/contrib/search/common/search.ts
src/vs/workbench/contrib/search/common/search.ts
+2
-1
未找到文件。
src/vs/editor/contrib/documentSymbols/media/outlineTree.css
浏览文件 @
043a0654
...
...
@@ -20,11 +20,6 @@
color
:
var
(
--outline-element-color
);
}
.monaco-list
.outline-element
.deprecated
{
text-decoration
:
line-through
;
opacity
:
0.66
;
}
.monaco-tree
.monaco-tree-row.focused
.outline-element
.outline-element-detail
{
visibility
:
inherit
;
}
...
...
src/vs/editor/contrib/documentSymbols/media/symbol-icons.css
浏览文件 @
043a0654
...
...
@@ -3,6 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-workbench
.monaco-icon-label.deprecated
{
text-decoration
:
line-through
;
opacity
:
0.66
;
}
.monaco-workbench
.symbol-icon.inline
{
background-position
:
left
center
;
padding-left
:
20px
;
...
...
src/vs/editor/contrib/quickOpen/quickOpen.ts
浏览文件 @
043a0654
...
...
@@ -51,7 +51,7 @@ function flatten(bucket: DocumentSymbol[], entries: DocumentSymbol[], overrideCo
for
(
let
entry
of
entries
)
{
bucket
.
push
({
kind
:
entry
.
kind
,
tags
:
[]
,
tags
:
entry
.
tags
,
name
:
entry
.
name
,
detail
:
entry
.
detail
,
containerName
:
entry
.
containerName
||
overrideContainerLabel
,
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
043a0654
...
...
@@ -1144,6 +1144,13 @@ declare module 'vscode' {
Deprecated
=
1
}
export
interface
SymbolInformation
{
/**
*
*/
tags
?:
ReadonlyArray
<
SymbolTag
>
;
}
export
interface
DocumentSymbol
{
/**
*
...
...
src/vs/workbench/api/common/extHostLanguageFeatures.ts
浏览文件 @
043a0654
...
...
@@ -70,8 +70,8 @@ class DocumentSymbolAdapter {
const
element
=
<
modes
.
DocumentSymbol
>
{
name
:
info
.
name
||
'
!!MISSING: name!!
'
,
kind
:
typeConvert
.
SymbolKind
.
from
(
info
.
kind
),
tags
:
[]
,
detail
:
undefined
!
,
// Strict null override — avoid changing behavior
tags
:
info
.
tags
&&
info
.
tags
.
map
(
typeConvert
.
SymbolTag
.
from
)
,
detail
:
''
,
containerName
:
info
.
containerName
,
range
:
typeConvert
.
Range
.
from
(
info
.
location
.
range
),
selectionRange
:
typeConvert
.
Range
.
from
(
info
.
location
.
range
),
...
...
src/vs/workbench/api/common/extHostTypeConverters.ts
浏览文件 @
043a0654
...
...
@@ -576,17 +576,20 @@ export namespace WorkspaceSymbol {
return
<
search
.
IWorkspaceSymbol
>
{
name
:
info
.
name
,
kind
:
SymbolKind
.
from
(
info
.
kind
),
tags
:
info
.
tags
&&
info
.
tags
.
map
(
SymbolTag
.
from
),
containerName
:
info
.
containerName
,
location
:
location
.
from
(
info
.
location
)
};
}
export
function
to
(
info
:
search
.
IWorkspaceSymbol
):
types
.
SymbolInformation
{
return
new
types
.
SymbolInformation
(
const
result
=
new
types
.
SymbolInformation
(
info
.
name
,
SymbolKind
.
to
(
info
.
kind
),
info
.
containerName
,
location
.
to
(
info
.
location
)
);
result
.
tags
=
info
.
tags
&&
info
.
tags
.
map
(
SymbolTag
.
to
);
return
result
;
}
}
...
...
src/vs/workbench/api/common/extHostTypes.ts
浏览文件 @
043a0654
...
...
@@ -995,6 +995,7 @@ export class SymbolInformation {
name
:
string
;
location
!
:
Location
;
kind
:
SymbolKind
;
tags
?:
SymbolTag
[];
containerName
:
string
|
undefined
;
constructor
(
name
:
string
,
kind
:
SymbolKind
,
containerName
:
string
|
undefined
,
location
:
Location
);
...
...
src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts
浏览文件 @
043a0654
...
...
@@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
import
*
as
types
from
'
vs/base/common/types
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
IEntryRunContext
,
Mode
,
IAutoFocus
}
from
'
vs/base/parts/quickopen/common/quickOpen
'
;
import
{
QuickOpenModel
,
IHighlight
}
from
'
vs/base/parts/quickopen/browser/quickOpenModel
'
;
import
{
QuickOpenModel
}
from
'
vs/base/parts/quickopen/browser/quickOpenModel
'
;
import
{
QuickOpenHandler
,
EditorQuickOpenEntryGroup
,
QuickOpenAction
}
from
'
vs/workbench/browser/quickopen
'
;
import
*
as
filters
from
'
vs/base/common/filters
'
;
import
{
IEditor
,
IDiffEditorModel
,
IEditorViewState
,
ScrollType
}
from
'
vs/editor/common/editorCommon
'
;
...
...
@@ -16,15 +16,15 @@ import { IModelDecorationsChangeAccessor, OverviewRulerLane, IModelDeltaDecorati
import
{
IQuickOpenService
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
ITextEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
getDocumentSymbols
}
from
'
vs/editor/contrib/quickOpen/quickOpen
'
;
import
{
DocumentSymbolProviderRegistry
,
DocumentSymbol
,
symbolKindToCssClass
,
SymbolKind
}
from
'
vs/editor/common/modes
'
;
import
{
DocumentSymbolProviderRegistry
,
DocumentSymbol
,
symbolKindToCssClass
,
SymbolKind
,
SymbolTag
}
from
'
vs/editor/common/modes
'
;
import
{
IRange
}
from
'
vs/editor/common/core/range
'
;
import
{
themeColorFromId
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
overviewRulerRangeHighlight
}
from
'
vs/editor/common/view/editorColorRegistry
'
;
import
{
GroupIdentifier
,
IEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorService
,
SIDE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorGroup
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
asPromise
}
from
'
vs/base/common/async
'
;
import
{
CancellationToken
,
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
IIconLabelValueOptions
}
from
'
vs/base/browser/ui/iconLabel/iconLabel
'
;
export
const
GOTO_SYMBOL_PREFIX
=
'
@
'
;
export
const
SCOPE_PREFIX
=
'
:
'
;
...
...
@@ -235,29 +235,20 @@ class OutlineModel extends QuickOpenModel {
}
class
SymbolEntry
extends
EditorQuickOpenEntryGroup
{
private
editorService
:
IEditorService
;
private
index
:
number
;
private
name
:
string
;
private
kind
:
SymbolKind
;
private
icon
:
string
;
private
description
:
string
;
private
range
:
IRange
;
private
revealRange
:
IRange
;
private
handler
:
GotoSymbolHandler
;
constructor
(
index
:
number
,
name
:
string
,
kind
:
SymbolKind
,
description
:
string
,
icon
:
string
,
range
:
IRange
,
revealRange
:
IRange
,
highlights
:
IHighlight
[],
editorService
:
IEditorService
,
handler
:
GotoSymbolHandler
)
{
super
();
this
.
index
=
index
;
this
.
name
=
name
;
this
.
kind
=
kind
;
this
.
icon
=
icon
;
this
.
description
=
description
;
this
.
range
=
range
;
this
.
revealRange
=
revealRange
||
range
;
this
.
setHighlights
(
highlights
);
this
.
editorService
=
editorService
;
this
.
handler
=
handler
;
constructor
(
private
index
:
number
,
private
name
:
string
,
private
kind
:
SymbolKind
,
private
description
:
string
,
private
icon
:
string
,
private
deprecated
:
boolean
,
private
range
:
IRange
,
private
revealRange
:
IRange
,
private
editorService
:
IEditorService
,
private
handler
:
GotoSymbolHandler
)
{
super
();
}
getIndex
():
number
{
...
...
@@ -276,6 +267,10 @@ class SymbolEntry extends EditorQuickOpenEntryGroup {
return
this
.
icon
;
}
getLabelOptions
():
IIconLabelValueOptions
|
undefined
{
return
this
.
deprecated
?
{
extraClasses
:
[
'
deprecated
'
]
}
:
undefined
;
}
getDescription
():
string
{
return
this
.
description
;
}
...
...
@@ -479,8 +474,8 @@ export class GotoSymbolHandler extends QuickOpenHandler {
// Add
results
.
push
(
new
SymbolEntry
(
i
,
label
,
element
.
kind
,
description
,
`symbol-icon
${
icon
}
`
,
element
.
range
,
element
.
selectionRange
,
[],
this
.
editorService
,
this
label
,
element
.
kind
,
description
,
`symbol-icon
${
icon
}
`
,
element
.
tags
&&
element
.
tags
.
indexOf
(
SymbolTag
.
Deprecated
)
>=
0
,
element
.
range
,
element
.
selectionRange
,
this
.
editorService
,
this
));
}
...
...
@@ -504,7 +499,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
}
if
(
model
&&
types
.
isFunction
((
<
ITextModel
>
model
).
getLanguageIdentifier
))
{
const
entries
=
await
asPromise
(()
=>
getDocumentSymbols
(
<
ITextModel
>
model
,
true
,
this
.
pendingOutlineRequest
!
.
token
)
);
const
entries
=
await
getDocumentSymbols
(
<
ITextModel
>
model
,
true
,
this
.
pendingOutlineRequest
!
.
token
);
return
new
OutlineModel
(
this
.
toQuickOpenEntries
(
entries
));
}
...
...
src/vs/workbench/contrib/search/browser/openSymbolHandler.ts
浏览文件 @
043a0654
...
...
@@ -14,7 +14,7 @@ import * as filters from 'vs/base/common/filters';
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
IWorkbenchEditorConfiguration
}
from
'
vs/workbench/common/editor
'
;
import
{
symbolKindToCssClass
}
from
'
vs/editor/common/modes
'
;
import
{
symbolKindToCssClass
,
SymbolTag
}
from
'
vs/editor/common/modes
'
;
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
@@ -25,6 +25,7 @@ import { ILabelService } from 'vs/platform/label/common/label';
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
IIconLabelValueOptions
}
from
'
vs/base/browser/ui/iconLabel/iconLabel
'
;
class
SymbolEntry
extends
EditorQuickOpenEntry
{
private
bearingResolve
:
Promise
<
this
|
undefined
>
|
undefined
;
...
...
@@ -65,6 +66,12 @@ class SymbolEntry extends EditorQuickOpenEntry {
return
symbolKindToCssClass
(
this
.
bearing
.
kind
);
}
getLabelOptions
():
IIconLabelValueOptions
|
undefined
{
return
this
.
bearing
.
tags
&&
this
.
bearing
.
tags
.
indexOf
(
SymbolTag
.
Deprecated
)
>=
0
?
{
extraClasses
:
[
'
deprecated
'
]
}
:
undefined
;
}
getResource
():
URI
{
return
this
.
bearing
.
location
.
uri
;
}
...
...
src/vs/workbench/contrib/search/common/search.ts
浏览文件 @
043a0654
...
...
@@ -6,7 +6,7 @@
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ISearchConfiguration
,
ISearchConfigurationProperties
}
from
'
vs/workbench/services/search/common/search
'
;
import
{
SymbolKind
,
Location
,
ProviderResult
}
from
'
vs/editor/common/modes
'
;
import
{
SymbolKind
,
Location
,
ProviderResult
,
SymbolTag
}
from
'
vs/editor/common/modes
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
toResource
,
SideBySideEditor
}
from
'
vs/workbench/common/editor
'
;
...
...
@@ -19,6 +19,7 @@ export interface IWorkspaceSymbol {
name
:
string
;
containerName
?:
string
;
kind
:
SymbolKind
;
tags
?:
SymbolTag
[];
location
:
Location
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录