Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
074bb34a
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,发现更多精彩内容 >>
提交
074bb34a
编写于
5月 19, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove IMode.outlineSupport
上级
d37a76dc
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
19 addition
and
54 deletion
+19
-54
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+1
-7
src/vs/editor/contrib/outlineMarker/browser/outlineMarker.ts
src/vs/editor/contrib/outlineMarker/browser/outlineMarker.ts
+6
-6
src/vs/editor/contrib/quickOpen/browser/quickOutline.ts
src/vs/editor/contrib/quickOpen/browser/quickOutline.ts
+8
-12
src/vs/editor/contrib/quickOpen/common/quickOpen.ts
src/vs/editor/contrib/quickOpen/common/quickOpen.ts
+0
-11
src/vs/languages/css/common/css.ts
src/vs/languages/css/common/css.ts
+1
-2
src/vs/languages/json/common/json.ts
src/vs/languages/json/common/json.ts
+1
-12
src/vs/languages/less/common/less.ts
src/vs/languages/less/common/less.ts
+1
-2
src/vs/languages/sass/common/sass.ts
src/vs/languages/sass/common/sass.ts
+1
-2
未找到文件。
src/vs/editor/common/modes.ts
浏览文件 @
074bb34a
...
...
@@ -211,11 +211,6 @@ export interface IMode {
*/
declarationSupport
?:
IDeclarationSupport
;
/**
* Optional adapter to support showing an outline.
*/
outlineSupport
?:
IOutlineSupport
;
/**
* Optional adapter to support formatting.
*/
...
...
@@ -550,7 +545,6 @@ export interface IOutlineEntry {
export
interface
IOutlineSupport
{
getOutline
(
resource
:
URI
):
TPromise
<
IOutlineEntry
[]
>
;
outlineGroupLabel
?:
{
[
name
:
string
]:
string
;
};
}
/**
...
...
@@ -808,7 +802,7 @@ export const SignatureHelpProviderRegistry = new LanguageFeatureRegistry<Signatu
export
const
HoverProviderRegistry
=
new
LanguageFeatureRegistry
<
HoverProvider
>
(
null
);
export
const
OutlineRegistry
=
new
LanguageFeatureRegistry
<
IOutlineSupport
>
(
'
outlineSupport
'
);
export
const
OutlineRegistry
=
new
LanguageFeatureRegistry
<
IOutlineSupport
>
(
null
);
export
const
OccurrencesRegistry
=
new
LanguageFeatureRegistry
<
IOccurrencesSupport
>
(
'
occurrencesSupport
'
);
...
...
src/vs/editor/contrib/outlineMarker/browser/outlineMarker.ts
浏览文件 @
074bb34a
...
...
@@ -12,9 +12,10 @@ import {IDisposable, dispose} from 'vs/base/common/lifecycle';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
IOutlineEntry
}
from
'
vs/editor/common/modes
'
;
import
{
IOutlineEntry
,
OutlineRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
ICodeEditor
,
IViewZone
,
IViewZoneChangeAccessor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
EditorBrowserRegistry
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
getOutlineEntries
,
IOutline
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
class
OutlineViewZone
implements
IViewZone
{
...
...
@@ -117,7 +118,7 @@ export class OutlineMarkerContribution implements editorCommon.IEditorContributi
private
_globalToDispose
:
IDisposable
[];
private
_localToDispose
:
IDisposable
[];
private
_currentOutlinePromise
:
TPromise
<
IOutline
Entry
[]
>
;
private
_currentOutlinePromise
:
TPromise
<
IOutline
>
;
private
_markers
:
OutlineMarker
[];
...
...
@@ -176,8 +177,7 @@ export class OutlineMarkerContribution implements editorCommon.IEditorContributi
return
;
}
var
mode
=
model
.
getMode
();
if
(
!
mode
.
outlineSupport
)
{
if
(
!
OutlineRegistry
.
has
(
model
))
{
return
;
}
...
...
@@ -186,10 +186,10 @@ export class OutlineMarkerContribution implements editorCommon.IEditorContributi
this
.
_currentOutlinePromise
.
cancel
();
}
this
.
_currentOutlinePromise
=
mode
.
outlineSupport
.
getOutline
(
model
.
getAssociatedResource
()
);
this
.
_currentOutlinePromise
=
getOutlineEntries
(
model
);
this
.
_currentOutlinePromise
.
then
((
result
)
=>
{
this
.
renderOutlines
(
result
);
this
.
renderOutlines
(
result
.
entries
);
},
(
error
)
=>
{
onUnexpectedError
(
error
);
});
...
...
src/vs/editor/contrib/quickOpen/browser/quickOutline.ts
浏览文件 @
074bb34a
...
...
@@ -17,8 +17,9 @@ import {IContext, IHighlight, QuickOpenEntryGroup, QuickOpenModel} from 'vs/base
import
{
IAutoFocus
,
Mode
}
from
'
vs/base/parts/quickopen/common/quickOpen
'
;
import
{
Behaviour
}
from
'
vs/editor/common/editorActionEnablement
'
;
import
{
ICommonCodeEditor
,
IEditorActionDescriptorData
,
IRange
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IOutlineEntry
}
from
'
vs/editor/common/modes
'
;
import
{
IOutlineEntry
,
OutlineRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
BaseEditorQuickOpenAction
,
IDecorator
}
from
'
./editorQuickOpen
'
;
import
{
getOutlineEntries
,
IOutline
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
let
SCOPE_PREFIX
=
'
:
'
;
...
...
@@ -130,28 +131,23 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction {
}
public
isSupported
():
boolean
{
let
mode
=
this
.
editor
.
getModel
().
getMode
();
return
!!
mode
&&
!!
mode
.
outlineSupport
&&
super
.
isSupported
();
return
(
OutlineRegistry
.
has
(
this
.
editor
.
getModel
())
&&
super
.
isSupported
());
}
public
run
():
TPromise
<
boolean
>
{
let
model
=
this
.
editor
.
getModel
();
let
mode
=
model
.
getMode
();
let
outlineSupport
=
mode
.
outlineSupport
;
// Only works for models with outline support
if
(
!
outlineSupport
)
{
if
(
!
OutlineRegistry
.
has
(
model
))
{
return
null
;
}
// Resolve outline
let
promise
=
outlineSupport
.
getOutline
(
model
.
getAssociatedResource
()
);
return
promise
.
then
((
result
:
IOutline
Entry
[]
)
=>
{
if
(
Array
.
isArray
(
result
)
&&
result
.
length
>
0
)
{
let
promise
=
getOutlineEntries
(
model
);
return
promise
.
then
((
result
:
IOutline
)
=>
{
if
(
result
.
entries
.
length
>
0
)
{
// Cache result
this
.
cachedResult
=
result
;
this
.
cachedResult
=
result
.
entries
;
return
super
.
run
();
}
...
...
src/vs/editor/contrib/quickOpen/common/quickOpen.ts
浏览文件 @
074bb34a
...
...
@@ -16,24 +16,14 @@ import {IModelService} from 'vs/editor/common/services/modelService';
export
interface
IOutline
{
entries
:
IOutlineEntry
[];
outlineGroupLabel
:
{
[
n
:
string
]:
string
;
};
}
export
function
getOutlineEntries
(
model
:
IModel
):
TPromise
<
IOutline
>
{
let
groupLabels
:
{
[
n
:
string
]:
string
}
=
Object
.
create
(
null
);
let
entries
:
IOutlineEntry
[]
=
[];
let
promises
=
OutlineRegistry
.
all
(
model
).
map
(
support
=>
{
if
(
support
.
outlineGroupLabel
)
{
let
keys
=
Object
.
keys
(
support
.
outlineGroupLabel
);
for
(
let
i
=
0
,
len
=
keys
.
length
;
i
<
len
;
i
++
)
{
let
key
=
keys
[
i
];
groupLabels
[
key
]
=
support
.
outlineGroupLabel
[
key
];
}
}
return
support
.
getOutline
(
model
.
getAssociatedResource
()).
then
(
result
=>
{
if
(
Array
.
isArray
(
result
))
{
entries
.
push
(...
result
);
...
...
@@ -50,7 +40,6 @@ export function getOutlineEntries(model: IModel): TPromise<IOutline> {
return
{
entries
:
flatEntries
,
outlineGroupLabel
:
groupLabels
};
});
}
...
...
src/vs/languages/css/common/css.ts
浏览文件 @
074bb34a
...
...
@@ -284,7 +284,6 @@ export class CSSMode extends AbstractMode {
public
inplaceReplaceSupport
:
Modes
.
IInplaceReplaceSupport
;
public
configSupport
:
Modes
.
IConfigurationSupport
;
public
occurrencesSupport
:
Modes
.
IOccurrencesSupport
;
public
outlineSupport
:
Modes
.
IOutlineSupport
;
public
declarationSupport
:
Modes
.
IDeclarationSupport
;
public
quickFixSupport
:
Modes
.
IQuickFixSupport
;
...
...
@@ -334,7 +333,7 @@ export class CSSMode extends AbstractMode {
//this.occurrencesSupport = this;
Modes
.
HoverProviderRegistry
.
register
(
this
.
getId
(),
this
);
// Modes.ReferenceSearchRegistry.register(this.getId(), this);
this
.
outlineSupport
=
this
;
Modes
.
OutlineRegistry
.
register
(
this
.
getId
(),
this
)
;
// this.declarationSupport = new DeclarationSupport(this.getId(), {
// tokens: [cssTokenTypes.TOKEN_VALUE + '.css'],
// findDeclaration: (resource, position) => this.findDeclaration(resource, position)});
...
...
src/vs/languages/json/common/json.ts
浏览文件 @
074bb34a
...
...
@@ -9,7 +9,6 @@ import Modes = require('vs/editor/common/modes');
import
URI
from
'
vs/base/common/uri
'
;
import
WinJS
=
require
(
'
vs/base/common/winjs.base
'
);
import
Platform
=
require
(
'
vs/platform/platform
'
);
import
nls
=
require
(
'
vs/nls
'
);
import
jsonWorker
=
require
(
'
vs/languages/json/common/jsonWorker
'
);
import
tokenization
=
require
(
'
vs/languages/json/common/features/tokenization
'
);
import
{
AbstractMode
,
createWordRegExp
,
ModeWorkerManager
}
from
'
vs/editor/common/modes/abstractMode
'
;
...
...
@@ -27,11 +26,8 @@ export class JSONMode extends AbstractMode implements Modes.HoverProvider, Modes
public
richEditSupport
:
Modes
.
IRichEditSupport
;
public
configSupport
:
Modes
.
IConfigurationSupport
;
public
inplaceReplaceSupport
:
Modes
.
IInplaceReplaceSupport
;
public
outlineSupport
:
Modes
.
IOutlineSupport
;
public
formattingSupport
:
Modes
.
IFormattingSupport
;
public
outlineGroupLabel
:
{
[
name
:
string
]:
string
;
};
private
_modeWorkerManager
:
ModeWorkerManager
<
jsonWorker
.
JSONWorker
>
;
private
_threadService
:
IThreadService
;
...
...
@@ -74,14 +70,7 @@ export class JSONMode extends AbstractMode implements Modes.HoverProvider, Modes
this
.
configSupport
=
this
;
// Initialize Outline support
this
.
outlineSupport
=
this
;
this
.
outlineGroupLabel
=
Object
.
create
(
null
);
this
.
outlineGroupLabel
[
'
object
'
]
=
nls
.
localize
(
'
object
'
,
"
objects
"
);
this
.
outlineGroupLabel
[
'
array
'
]
=
nls
.
localize
(
'
array
'
,
"
arrays
"
);
this
.
outlineGroupLabel
[
'
string
'
]
=
nls
.
localize
(
'
string
'
,
"
strings
"
);
this
.
outlineGroupLabel
[
'
number
'
]
=
nls
.
localize
(
'
number
'
,
"
numbers
"
);
this
.
outlineGroupLabel
[
'
boolean
'
]
=
nls
.
localize
(
'
boolean
'
,
"
booleans
"
);
this
.
outlineGroupLabel
[
'
null
'
]
=
nls
.
localize
(
'
undefined
'
,
"
undefined
"
);
Modes
.
OutlineRegistry
.
register
(
this
.
getId
(),
this
);
this
.
formattingSupport
=
this
;
...
...
src/vs/languages/less/common/less.ts
浏览文件 @
074bb34a
...
...
@@ -183,7 +183,6 @@ export class LESSMode extends AbstractMode implements Modes.HoverProvider, Modes
public
inplaceReplaceSupport
:
Modes
.
IInplaceReplaceSupport
;
public
configSupport
:
Modes
.
IConfigurationSupport
;
public
declarationSupport
:
Modes
.
IDeclarationSupport
;
public
outlineSupport
:
Modes
.
IOutlineSupport
;
public
tokenizationSupport
:
Modes
.
ITokenizationSupport
;
public
richEditSupport
:
Modes
.
IRichEditSupport
;
...
...
@@ -214,7 +213,7 @@ export class LESSMode extends AbstractMode implements Modes.HoverProvider, Modes
this
.
declarationSupport
=
new
DeclarationSupport
(
this
.
getId
(),
{
tokens
:
[
'
variable.less
'
,
lessTokenTypes
.
TOKEN_SELECTOR
+
'
.class.less
'
,
lessTokenTypes
.
TOKEN_SELECTOR
+
'
.id.less
'
,
'
selector.less
'
],
findDeclaration
:
(
resource
,
position
)
=>
this
.
findDeclaration
(
resource
,
position
)});
this
.
outlineSupport
=
this
;
Modes
.
OutlineRegistry
.
register
(
this
.
getId
(),
this
)
;
Modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[],
...
...
src/vs/languages/sass/common/sass.ts
浏览文件 @
074bb34a
...
...
@@ -284,7 +284,6 @@ export class SASSMode extends AbstractMode implements Modes.HoverProvider, Modes
public
inplaceReplaceSupport
:
Modes
.
IInplaceReplaceSupport
;
public
configSupport
:
Modes
.
IConfigurationSupport
;
public
outlineSupport
:
Modes
.
IOutlineSupport
;
public
declarationSupport
:
Modes
.
IDeclarationSupport
;
public
tokenizationSupport
:
Modes
.
ITokenizationSupport
;
public
richEditSupport
:
Modes
.
IRichEditSupport
;
...
...
@@ -315,7 +314,7 @@ export class SASSMode extends AbstractMode implements Modes.HoverProvider, Modes
this
.
declarationSupport
=
new
DeclarationSupport
(
this
.
getId
(),
{
tokens
:
[
'
variable.decl.sass
'
,
'
variable.ref.sass
'
,
'
support.function.name.sass
'
,
sassTokenTypes
.
TOKEN_PROPERTY
+
'
.sass
'
,
sassTokenTypes
.
TOKEN_SELECTOR
+
'
.sass
'
],
findDeclaration
:
(
resource
,
position
)
=>
this
.
findDeclaration
(
resource
,
position
)});
this
.
outlineSupport
=
this
;
Modes
.
OutlineRegistry
.
register
(
this
.
getId
(),
this
)
;
Modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录