Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c4ed98f3
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,发现更多精彩内容 >>
提交
c4ed98f3
编写于
3月 29, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
undo monaco.d.ts api breakages and keep using enum #23293
上级
805905df
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
120 addition
and
57 deletion
+120
-57
src/vs/editor/browser/standalone/standaloneLanguages.ts
src/vs/editor/browser/standalone/standaloneLanguages.ts
+1
-0
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+62
-24
src/vs/editor/contrib/quickOpen/browser/quickOutline.ts
src/vs/editor/contrib/quickOpen/browser/quickOutline.ts
+2
-2
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+25
-1
src/vs/workbench/api/node/extHostTypeConverters.ts
src/vs/workbench/api/node/extHostTypeConverters.ts
+24
-24
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
...vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
+2
-2
src/vs/workbench/parts/search/browser/openSymbolHandler.ts
src/vs/workbench/parts/search/browser/openSymbolHandler.ts
+4
-4
未找到文件。
src/vs/editor/browser/standalone/standaloneLanguages.ts
浏览文件 @
c4ed98f3
...
...
@@ -700,6 +700,7 @@ export function createMonacoLanguagesAPI(): typeof monaco.languages {
// enums
DocumentHighlightKind
:
modes
.
DocumentHighlightKind
,
CompletionItemKind
:
CompletionItemKind
,
SymbolKind
:
modes
.
SymbolKind
,
IndentAction
:
IndentAction
,
};
}
src/vs/editor/common/modes.ts
浏览文件 @
c4ed98f3
...
...
@@ -458,30 +458,68 @@ export interface TypeDefinitionProvider {
/**
* A symbol kind.
*/
export
type
SymbolKind
=
'
file
'
|
'
module
'
|
'
namespace
'
|
'
package
'
|
'
class
'
|
'
method
'
|
'
property
'
|
'
field
'
|
'
constructor
'
|
'
enum
'
|
'
interface
'
|
'
function
'
|
'
variable
'
|
'
constant
'
|
'
string
'
|
'
number
'
|
'
boolean
'
|
'
array
'
|
'
object
'
|
'
key
'
|
'
null
'
|
'
enum-member
'
|
'
struct
'
;
export
enum
SymbolKind
{
File
=
0
,
Module
=
1
,
Namespace
=
2
,
Package
=
3
,
Class
=
4
,
Method
=
5
,
Property
=
6
,
Field
=
7
,
Constructor
=
8
,
Enum
=
9
,
Interface
=
10
,
Function
=
11
,
Variable
=
12
,
Constant
=
13
,
String
=
14
,
Number
=
15
,
Boolean
=
16
,
Array
=
17
,
Object
=
18
,
Key
=
19
,
Null
=
20
,
EnumMember
=
21
,
Struct
=
22
}
/**
* @internal
*/
export
const
symbolKindToCssClass
=
(
function
()
{
const
_fromMapping
:
{
[
n
:
number
]:
string
}
=
Object
.
create
(
null
);
_fromMapping
[
SymbolKind
.
File
]
=
'
file
'
;
_fromMapping
[
SymbolKind
.
Module
]
=
'
module
'
;
_fromMapping
[
SymbolKind
.
Namespace
]
=
'
namespace
'
;
_fromMapping
[
SymbolKind
.
Package
]
=
'
package
'
;
_fromMapping
[
SymbolKind
.
Class
]
=
'
class
'
;
_fromMapping
[
SymbolKind
.
Method
]
=
'
method
'
;
_fromMapping
[
SymbolKind
.
Property
]
=
'
property
'
;
_fromMapping
[
SymbolKind
.
Field
]
=
'
field
'
;
_fromMapping
[
SymbolKind
.
Constructor
]
=
'
constructor
'
;
_fromMapping
[
SymbolKind
.
Enum
]
=
'
enum
'
;
_fromMapping
[
SymbolKind
.
Interface
]
=
'
interface
'
;
_fromMapping
[
SymbolKind
.
Function
]
=
'
function
'
;
_fromMapping
[
SymbolKind
.
Variable
]
=
'
variable
'
;
_fromMapping
[
SymbolKind
.
Constant
]
=
'
constant
'
;
_fromMapping
[
SymbolKind
.
String
]
=
'
string
'
;
_fromMapping
[
SymbolKind
.
Number
]
=
'
number
'
;
_fromMapping
[
SymbolKind
.
Boolean
]
=
'
boolean
'
;
_fromMapping
[
SymbolKind
.
Array
]
=
'
array
'
;
_fromMapping
[
SymbolKind
.
Object
]
=
'
object
'
;
_fromMapping
[
SymbolKind
.
Key
]
=
'
key
'
;
_fromMapping
[
SymbolKind
.
Null
]
=
'
null
'
;
_fromMapping
[
SymbolKind
.
EnumMember
]
=
'
enum-member
'
;
_fromMapping
[
SymbolKind
.
Struct
]
=
'
struct
'
;
return
function
toCssClassName
(
kind
:
SymbolKind
):
string
{
return
_fromMapping
[
kind
]
||
'
property
'
;
};
})();
/**
* Represents information about programming constructs like variables, classes,
...
...
src/vs/editor/contrib/quickOpen/browser/quickOutline.ts
浏览文件 @
c4ed98f3
...
...
@@ -14,7 +14,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
IContext
,
IHighlight
,
QuickOpenEntryGroup
,
QuickOpenModel
}
from
'
vs/base/parts/quickopen/browser/quickOpenModel
'
;
import
{
IAutoFocus
,
Mode
}
from
'
vs/base/parts/quickopen/common/quickOpen
'
;
import
{
ICommonCodeEditor
,
IRange
,
ModeContextKeys
,
EditorContextKeys
}
from
'
vs/editor/common/editorCommon
'
;
import
{
SymbolInformation
,
DocumentSymbolProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
SymbolInformation
,
DocumentSymbolProviderRegistry
,
symbolKindToCssClass
}
from
'
vs/editor/common/modes
'
;
import
{
BaseEditorQuickOpenAction
,
IDecorator
}
from
'
./editorQuickOpen
'
;
import
{
getDocumentSymbols
,
IOutline
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
{
editorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
...
...
@@ -191,7 +191,7 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction {
}
// Add
results
.
push
(
new
SymbolEntry
(
label
,
element
.
kind
,
description
,
element
.
location
.
range
,
highlights
,
editor
,
controller
));
results
.
push
(
new
SymbolEntry
(
label
,
symbolKindToCssClass
(
element
.
kind
)
,
description
,
element
.
location
.
range
,
highlights
,
editor
,
controller
));
}
}
...
...
src/vs/monaco.d.ts
浏览文件 @
c4ed98f3
...
...
@@ -4708,7 +4708,31 @@ declare module monaco.languages {
/**
* A symbol kind.
*/
export
type
SymbolKind
=
'
file
'
|
'
module
'
|
'
namespace
'
|
'
package
'
|
'
class
'
|
'
method
'
|
'
property
'
|
'
field
'
|
'
constructor
'
|
'
enum
'
|
'
interface
'
|
'
function
'
|
'
variable
'
|
'
constant
'
|
'
string
'
|
'
number
'
|
'
boolean
'
|
'
array
'
|
'
object
'
|
'
key
'
|
'
null
'
|
'
enum-member
'
|
'
struct
'
;
export
enum
SymbolKind
{
File
=
0
,
Module
=
1
,
Namespace
=
2
,
Package
=
3
,
Class
=
4
,
Method
=
5
,
Property
=
6
,
Field
=
7
,
Constructor
=
8
,
Enum
=
9
,
Interface
=
10
,
Function
=
11
,
Variable
=
12
,
Constant
=
13
,
String
=
14
,
Number
=
15
,
Boolean
=
16
,
Array
=
17
,
Object
=
18
,
Key
=
19
,
Null
=
20
,
EnumMember
=
21
,
Struct
=
22
,
}
/**
* Represents information about programming constructs like variables, classes,
...
...
src/vs/workbench/api/node/extHostTypeConverters.ts
浏览文件 @
c4ed98f3
...
...
@@ -177,32 +177,32 @@ export const TextEdit = {
export
namespace
SymbolKind
{
const
_fromMapping
:
{
[
kind
:
number
]:
modes
.
SymbolKind
}
=
Object
.
create
(
null
);
_fromMapping
[
types
.
SymbolKind
.
File
]
=
'
file
'
;
_fromMapping
[
types
.
SymbolKind
.
Module
]
=
'
module
'
;
_fromMapping
[
types
.
SymbolKind
.
Namespace
]
=
'
namespace
'
;
_fromMapping
[
types
.
SymbolKind
.
Package
]
=
'
package
'
;
_fromMapping
[
types
.
SymbolKind
.
Class
]
=
'
class
'
;
_fromMapping
[
types
.
SymbolKind
.
Method
]
=
'
method
'
;
_fromMapping
[
types
.
SymbolKind
.
Property
]
=
'
property
'
;
_fromMapping
[
types
.
SymbolKind
.
Field
]
=
'
field
'
;
_fromMapping
[
types
.
SymbolKind
.
Constructor
]
=
'
constructor
'
;
_fromMapping
[
types
.
SymbolKind
.
Enum
]
=
'
enum
'
;
_fromMapping
[
types
.
SymbolKind
.
Interface
]
=
'
interface
'
;
_fromMapping
[
types
.
SymbolKind
.
Function
]
=
'
function
'
;
_fromMapping
[
types
.
SymbolKind
.
Variable
]
=
'
variable
'
;
_fromMapping
[
types
.
SymbolKind
.
Constant
]
=
'
constant
'
;
_fromMapping
[
types
.
SymbolKind
.
String
]
=
'
string
'
;
_fromMapping
[
types
.
SymbolKind
.
Number
]
=
'
number
'
;
_fromMapping
[
types
.
SymbolKind
.
Boolean
]
=
'
boolean
'
;
_fromMapping
[
types
.
SymbolKind
.
Array
]
=
'
array
'
;
_fromMapping
[
types
.
SymbolKind
.
Object
]
=
'
object
'
;
_fromMapping
[
types
.
SymbolKind
.
Key
]
=
'
key
'
;
_fromMapping
[
types
.
SymbolKind
.
Null
]
=
'
null
'
;
_fromMapping
[
types
.
SymbolKind
.
EnumMember
]
=
'
enum-member
'
;
_fromMapping
[
types
.
SymbolKind
.
Struct
]
=
'
struct
'
;
_fromMapping
[
types
.
SymbolKind
.
File
]
=
modes
.
SymbolKind
.
File
;
_fromMapping
[
types
.
SymbolKind
.
Module
]
=
modes
.
SymbolKind
.
Module
;
_fromMapping
[
types
.
SymbolKind
.
Namespace
]
=
modes
.
SymbolKind
.
Namespace
;
_fromMapping
[
types
.
SymbolKind
.
Package
]
=
modes
.
SymbolKind
.
Package
;
_fromMapping
[
types
.
SymbolKind
.
Class
]
=
modes
.
SymbolKind
.
Class
;
_fromMapping
[
types
.
SymbolKind
.
Method
]
=
modes
.
SymbolKind
.
Method
;
_fromMapping
[
types
.
SymbolKind
.
Property
]
=
modes
.
SymbolKind
.
Property
;
_fromMapping
[
types
.
SymbolKind
.
Field
]
=
modes
.
SymbolKind
.
Field
;
_fromMapping
[
types
.
SymbolKind
.
Constructor
]
=
modes
.
SymbolKind
.
Constructor
;
_fromMapping
[
types
.
SymbolKind
.
Enum
]
=
modes
.
SymbolKind
.
Enum
;
_fromMapping
[
types
.
SymbolKind
.
Interface
]
=
modes
.
SymbolKind
.
Interface
;
_fromMapping
[
types
.
SymbolKind
.
Function
]
=
modes
.
SymbolKind
.
Function
;
_fromMapping
[
types
.
SymbolKind
.
Variable
]
=
modes
.
SymbolKind
.
Variable
;
_fromMapping
[
types
.
SymbolKind
.
Constant
]
=
modes
.
SymbolKind
.
Constant
;
_fromMapping
[
types
.
SymbolKind
.
String
]
=
modes
.
SymbolKind
.
String
;
_fromMapping
[
types
.
SymbolKind
.
Number
]
=
modes
.
SymbolKind
.
Number
;
_fromMapping
[
types
.
SymbolKind
.
Boolean
]
=
modes
.
SymbolKind
.
Boolean
;
_fromMapping
[
types
.
SymbolKind
.
Array
]
=
modes
.
SymbolKind
.
Array
;
_fromMapping
[
types
.
SymbolKind
.
Object
]
=
modes
.
SymbolKind
.
Object
;
_fromMapping
[
types
.
SymbolKind
.
Key
]
=
modes
.
SymbolKind
.
Key
;
_fromMapping
[
types
.
SymbolKind
.
Null
]
=
modes
.
SymbolKind
.
Null
;
_fromMapping
[
types
.
SymbolKind
.
EnumMember
]
=
modes
.
SymbolKind
.
EnumMember
;
_fromMapping
[
types
.
SymbolKind
.
Struct
]
=
modes
.
SymbolKind
.
Struct
;
export
function
from
(
kind
:
vscode
.
SymbolKind
):
modes
.
SymbolKind
{
return
_fromMapping
[
kind
]
||
'
property
'
;
return
_fromMapping
[
kind
]
||
modes
.
SymbolKind
.
Property
;
}
export
function
to
(
kind
:
modes
.
SymbolKind
):
vscode
.
SymbolKind
{
...
...
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
浏览文件 @
c4ed98f3
...
...
@@ -21,7 +21,7 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi
import
{
IQuickOpenService
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
Position
,
IEditorInput
,
ITextEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
getDocumentSymbols
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
{
DocumentSymbolProviderRegistry
,
SymbolInformation
}
from
'
vs/editor/common/modes
'
;
import
{
DocumentSymbolProviderRegistry
,
SymbolInformation
,
symbolKindToCssClass
}
from
'
vs/editor/common/modes
'
;
import
{
getCodeEditor
}
from
'
vs/editor/common/services/codeEditorService
'
;
export
const
GOTO_SYMBOL_PREFIX
=
'
@
'
;
...
...
@@ -451,7 +451,7 @@ export class GotoSymbolHandler extends QuickOpenHandler {
// Show parent scope as description
const
description
:
string
=
element
.
containerName
;
const
icon
=
element
.
kind
;
const
icon
=
symbolKindToCssClass
(
element
.
kind
)
;
// Add
results
.
push
(
new
SymbolEntry
(
i
,
...
...
src/vs/workbench/parts/search/browser/openSymbolHandler.ts
浏览文件 @
c4ed98f3
...
...
@@ -17,7 +17,7 @@ import strings = require('vs/base/common/strings');
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
EditorInput
,
IWorkbenchEditorConfiguration
}
from
'
vs/workbench/common/editor
'
;
import
labels
=
require
(
'
vs/base/common/labels
'
);
import
{
SymbolInformation
}
from
'
vs/editor/common/modes
'
;
import
{
SymbolInformation
,
symbolKindToCssClass
}
from
'
vs/editor/common/modes
'
;
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -56,7 +56,7 @@ class SymbolEntry extends EditorQuickOpenEntry {
}
public
getIcon
():
string
{
return
this
.
_bearing
.
kind
;
return
symbolKindToCssClass
(
this
.
_bearing
.
kind
)
;
}
public
getResource
():
URI
{
...
...
@@ -106,8 +106,8 @@ class SymbolEntry extends EditorQuickOpenEntry {
const
elementAName
=
elementA
.
getLabel
().
toLowerCase
();
const
elementBName
=
elementB
.
getLabel
().
toLowerCase
();
if
(
elementAName
===
elementBName
)
{
let
elementAType
=
elementA
.
_bearing
.
kind
;
let
elementBType
=
elementB
.
_bearing
.
kind
;
let
elementAType
=
symbolKindToCssClass
(
elementA
.
_bearing
.
kind
)
;
let
elementBType
=
symbolKindToCssClass
(
elementB
.
_bearing
.
kind
)
;
return
elementAType
.
localeCompare
(
elementBType
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录