Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
8591582c
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
8591582c
编写于
5月 19, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Align IDeclarationSupport with ext host API
上级
1f3c9192
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
10 addition
and
78 deletion
+10
-78
src/vs/editor/common/languages.common.ts
src/vs/editor/common/languages.common.ts
+0
-1
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+0
-1
src/vs/editor/common/modes/supports/declarationSupport.ts
src/vs/editor/common/modes/supports/declarationSupport.ts
+0
-47
src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts
...editor/contrib/goToDeclaration/browser/goToDeclaration.ts
+1
-7
src/vs/languages/css/common/css.ts
src/vs/languages/css/common/css.ts
+3
-3
src/vs/languages/less/common/less.ts
src/vs/languages/less/common/less.ts
+3
-4
src/vs/languages/sass/common/sass.ts
src/vs/languages/sass/common/sass.ts
+3
-4
src/vs/languages/typescript/common/languageFeatures.ts
src/vs/languages/typescript/common/languageFeatures.ts
+0
-4
src/vs/workbench/api/node/extHostLanguageFeatures.ts
src/vs/workbench/api/node/extHostLanguageFeatures.ts
+0
-7
未找到文件。
src/vs/editor/common/languages.common.ts
浏览文件 @
8591582c
...
...
@@ -36,7 +36,6 @@ import 'vs/editor/common/modes/monarch/monarchCommon';
import
'
vs/editor/common/modes/monarch/monarchDefinition
'
;
import
'
vs/editor/common/modes/monarch/monarchLexer
'
;
import
'
vs/editor/common/modes/monarch/monarchCompile
'
;
import
'
vs/editor/common/modes/supports/declarationSupport
'
;
import
'
vs/editor/common/modes/supports/richEditSupport
'
;
import
'
vs/editor/common/modes/supports/suggestSupport
'
;
import
'
vs/editor/common/modes/supports/tokenizationSupport
'
;
...
...
src/vs/editor/common/modes.ts
浏览文件 @
8591582c
...
...
@@ -522,7 +522,6 @@ export interface IReferenceSupport {
* Interface used to find declarations on a symbol
*/
export
interface
IDeclarationSupport
{
canFindDeclaration
(
context
:
ILineContext
,
offset
:
number
):
boolean
;
findDeclaration
(
resource
:
URI
,
position
:
editorCommon
.
IPosition
):
TPromise
<
IReference
|
IReference
[]
>
;
}
...
...
src/vs/editor/common/modes/supports/declarationSupport.ts
已删除
100644 → 0
浏览文件 @
1f3c9192
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IPosition
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IDeclarationSupport
,
ILineContext
,
IMode
,
IReference
}
from
'
vs/editor/common/modes
'
;
import
{
handleEvent
,
isLineToken
}
from
'
vs/editor/common/modes/supports
'
;
export
interface
IDeclarationContribution
{
tokens
?:
string
[];
findDeclaration
:
(
resource
:
URI
,
position
:
IPosition
)
=>
TPromise
<
IReference
>
;
}
export
class
DeclarationSupport
implements
IDeclarationSupport
{
private
_modeId
:
string
;
private
contribution
:
IDeclarationContribution
;
/**
* Provide the token type postfixes for the tokens where a declaration can be found in the 'tokens' argument.
*/
constructor
(
modeId
:
string
,
contribution
:
IDeclarationContribution
)
{
this
.
_modeId
=
modeId
;
this
.
contribution
=
contribution
;
}
public
canFindDeclaration
(
context
:
ILineContext
,
offset
:
number
):
boolean
{
return
handleEvent
(
context
,
offset
,
(
nestedMode
:
IMode
,
context
:
ILineContext
,
offset
:
number
)
=>
{
if
(
this
.
_modeId
===
nestedMode
.
getId
())
{
return
(
!
Array
.
isArray
(
this
.
contribution
.
tokens
)
||
this
.
contribution
.
tokens
.
length
<
1
||
isLineToken
(
context
,
offset
,
this
.
contribution
.
tokens
));
}
else
if
(
nestedMode
.
declarationSupport
)
{
return
nestedMode
.
declarationSupport
.
canFindDeclaration
(
context
,
offset
);
}
else
{
return
false
;
}
});
}
public
findDeclaration
(
resource
:
URI
,
position
:
IPosition
):
TPromise
<
IReference
>
{
return
this
.
contribution
.
findDeclaration
(
resource
,
position
);
}
}
src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts
浏览文件 @
8591582c
...
...
@@ -70,13 +70,7 @@ export class DefinitionAction extends EditorAction {
return
false
;
}
const
model
=
this
.
editor
.
getModel
();
const
position
=
this
.
editor
.
getSelection
().
getStartPosition
();
return
DeclarationRegistry
.
all
(
model
).
some
(
provider
=>
{
return
provider
.
canFindDeclaration
(
model
.
getLineContext
(
position
.
lineNumber
),
position
.
column
-
1
);
});
return
DeclarationRegistry
.
has
(
this
.
editor
.
getModel
());
}
public
run
():
TPromise
<
any
>
{
...
...
src/vs/languages/css/common/css.ts
浏览文件 @
8591582c
...
...
@@ -333,9 +333,9 @@ export class CSSMode extends AbstractMode {
Modes
.
HoverProviderRegistry
.
register
(
this
.
getId
(),
this
);
// Modes.ReferenceSearchRegistry.register(this.getId(), 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)})
;
// this.declarationSupport = {
//
findDeclaration: (resource, position) => this.findDeclaration(resource, position)
//
}
;
Modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[
'
'
,
'
:
'
],
...
...
src/vs/languages/less/common/less.ts
浏览文件 @
8591582c
...
...
@@ -18,7 +18,6 @@ import {IModeService} from 'vs/editor/common/services/modeService';
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IThreadService
,
ThreadAffinity
}
from
'
vs/platform/thread/common/thread
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
DeclarationSupport
}
from
'
vs/editor/common/modes/supports/declarationSupport
'
;
import
{
IEditorWorkerService
}
from
'
vs/editor/common/services/editorWorkerService
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
wireCancellationToken
}
from
'
vs/base/common/async
'
;
...
...
@@ -210,9 +209,9 @@ export class LESSMode extends AbstractMode implements Modes.HoverProvider, Modes
this
.
inplaceReplaceSupport
=
this
;
this
.
configSupport
=
this
;
Modes
.
ReferenceSearchRegistry
.
register
(
this
.
getId
(),
this
);
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
.
declarationSupport
=
{
findDeclaration
:
(
resource
,
position
)
=>
this
.
findDeclaration
(
resource
,
position
)
}
;
Modes
.
OutlineRegistry
.
register
(
this
.
getId
(),
this
);
Modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
...
...
src/vs/languages/sass/common/sass.ts
浏览文件 @
8591582c
...
...
@@ -18,7 +18,6 @@ import {IModeService} from 'vs/editor/common/services/modeService';
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IThreadService
,
ThreadAffinity
}
from
'
vs/platform/thread/common/thread
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
DeclarationSupport
}
from
'
vs/editor/common/modes/supports/declarationSupport
'
;
import
{
IEditorWorkerService
}
from
'
vs/editor/common/services/editorWorkerService
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
wireCancellationToken
}
from
'
vs/base/common/async
'
;
...
...
@@ -311,9 +310,9 @@ export class SASSMode extends AbstractMode implements Modes.HoverProvider, Modes
this
.
inplaceReplaceSupport
=
this
;
this
.
configSupport
=
this
;
Modes
.
ReferenceSearchRegistry
.
register
(
this
.
getId
(),
this
);
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
.
declarationSupport
=
{
findDeclaration
:
(
resource
,
position
)
=>
this
.
findDeclaration
(
resource
,
position
)
}
;
Modes
.
OutlineRegistry
.
register
(
this
.
getId
(),
this
);
Modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
...
...
src/vs/languages/typescript/common/languageFeatures.ts
浏览文件 @
8591582c
...
...
@@ -337,10 +337,6 @@ class OccurrencesAdapter extends Adapter implements modes.IOccurrencesSupport {
class
DeclarationAdapter
extends
Adapter
implements
modes
.
IDeclarationSupport
{
canFindDeclaration
(
context
:
modes
.
ILineContext
,
offset
:
number
):
boolean
{
return
true
;
}
findDeclaration
(
resource
:
URI
,
position
:
editor
.
IPosition
):
TPromise
<
modes
.
IReference
[]
>
{
return
this
.
_worker
(
resource
).
then
(
worker
=>
{
return
worker
.
getDefinitionAtPosition
(
resource
.
toString
(),
this
.
_positionToOffset
(
resource
,
position
));
...
...
src/vs/workbench/api/node/extHostLanguageFeatures.ts
浏览文件 @
8591582c
...
...
@@ -162,10 +162,6 @@ class DeclarationAdapter implements modes.IDeclarationSupport {
this
.
_provider
=
provider
;
}
canFindDeclaration
()
{
return
true
;
}
findDeclaration
(
resource
:
URI
,
position
:
IPosition
):
TPromise
<
modes
.
IReference
[]
>
{
let
doc
=
this
.
_documents
.
getDocumentData
(
resource
).
document
;
let
pos
=
TypeConverters
.
toPosition
(
position
);
...
...
@@ -887,9 +883,6 @@ export class MainThreadLanguageFeatures {
$registerDeclaractionSupport
(
handle
:
number
,
selector
:
vscode
.
DocumentSelector
):
TPromise
<
any
>
{
this
.
_registrations
[
handle
]
=
modes
.
DeclarationRegistry
.
register
(
selector
,
<
modes
.
IDeclarationSupport
>
{
canFindDeclaration
()
{
return
true
;
},
findDeclaration
:
(
resource
:
URI
,
position
:
IPosition
):
TPromise
<
modes
.
IReference
[]
>
=>
{
return
this
.
_proxy
.
$findDeclaration
(
handle
,
resource
,
position
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录