Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
53dd6b09
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,发现更多精彩内容 >>
提交
53dd6b09
编写于
4月 18, 2018
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make folding api public (for #47808)
上级
61591c85
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
101 addition
and
107 deletion
+101
-107
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+99
-1
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+0
-104
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+2
-2
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
53dd6b09
...
...
@@ -2749,7 +2749,7 @@ declare module 'vscode' {
/**
* Optional function for resolving and validating a position *before* running rename. The result can
* be a range or a range and a placeholder text. The placeholder text should be the identifier of the symbol
* be a range or a range and a placeholder text. The placeholder text should be the identifier of the symbol
* which is being renamed - when omitted the text in the returned range is used.
*
* @param document The document in which rename will be invoked.
...
...
@@ -3384,6 +3384,90 @@ declare module 'vscode' {
provideColorPresentations
(
color
:
Color
,
context
:
{
document
:
TextDocument
,
range
:
Range
},
token
:
CancellationToken
):
ProviderResult
<
ColorPresentation
[]
>
;
}
export
class
FoldingRange
{
/**
* The zero-based start line of the range to fold. The folded area starts after the line's last character.
*/
start
:
number
;
/**
* The zero-based end line of the range to fold. The folded area ends with the line's last character.
*/
end
:
number
;
/**
* Describes the [Kind](#FoldingRangeKind) of the folding range such as [Comment](#FoldingRangeKind.Comment) or
* [Region](#FoldingRangeKind.Region). The kind is used to categorize folding ranges and used by commands
* like 'Fold all comments'. See
* [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.
*/
kind
?:
FoldingRangeKind
;
/**
* Creates a new folding range.
*
* @param start The start line of the folded range.
* @param end The end line of the folded range.
* @param kind The kind of the folding range.
*/
constructor
(
start
:
number
,
end
:
number
,
kind
?:
FoldingRangeKind
);
}
export
class
FoldingRangeKind
{
/**
* Kind for folding range representing a comment. The value of the kind is 'comment'.
*/
static
readonly
Comment
:
FoldingRangeKind
;
/**
* Kind for folding range representing a import. The value of the kind is 'imports'.
*/
static
readonly
Imports
:
FoldingRangeKind
;
/**
* Kind for folding range representing regions (for example a folding range marked by `#region` and `#endregion`).
* The value of the kind is 'region'.
*/
static
readonly
Region
:
FoldingRangeKind
;
/**
* String value of the kind, e.g. `comment`.
*/
readonly
value
:
string
;
/**
* Creates a new [FoldingRangeKind](#FoldingRangeKind).
*
* @param value of the kind.
*/
public
constructor
(
value
:
string
);
}
/**
* Metadata about the kind of folding ranges that a [FoldingRangeProvider](#FoldingRangeProvider) providers uses.
*/
export
interface
FoldingRangeProviderMetadata
{
/**
* [FoldingRangeKind](#FoldingRangeKind) that this provider may return.
*/
readonly
providedFoldingRangeKinds
?:
ReadonlyArray
<
FoldingRangeKind
>
;
}
/**
* Folding context (for future use)
*/
export
interface
FoldingContext
{
}
export
interface
FoldingRangeProvider
{
/**
* Returns a list of folding ranges or null and undefined if the provider
* does not want to participate or was cancelled.
* @param document The document in which the command was invoked.
* @param context Additional context information (for future use)
* @param token A cancellation token.
*/
provideFoldingRanges
(
document
:
TextDocument
,
context
:
FoldingContext
,
token
:
CancellationToken
):
ProviderResult
<
FoldingRange
[]
>
;
}
/**
* A tuple of two characters, like a pair of
* opening and closing brackets.
...
...
@@ -6370,6 +6454,20 @@ declare module 'vscode' {
*/
export
function
registerColorProvider
(
selector
:
DocumentSelector
,
provider
:
DocumentColorProvider
):
Disposable
;
/**
* Register a folding range provider.
*
* Multiple folding can be registered for a language. In that case providers are sorted
* by their [score](#languages.match) and the best-matching provider is used. Failure
* of the selected provider will cause a failure of the whole operation.
*
* @param selector A selector that defines the documents this provider is applicable to.
* @param provider A folding range provider.
* @param metadata Metadata about the kind of code actions the provider providers.
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
*/
export
function
registerFoldingRangeProvider
(
selector
:
DocumentSelector
,
provider
:
FoldingRangeProvider
,
metadata
?:
FoldingRangeProviderMetadata
):
Disposable
;
/**
* Set a [language configuration](#LanguageConfiguration) for a language.
*
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
53dd6b09
...
...
@@ -11,110 +11,6 @@ declare module 'vscode' {
export
function
sampleFunction
():
Thenable
<
any
>
;
}
//#region Aeschli: folding
export
class
FoldingRange
{
/**
* The zero-based start line of the range to fold. The folded area starts after the line's last character.
*/
start
:
number
;
/**
* The zero-based end line of the range to fold. The folded area ends with the line's last character.
*/
end
:
number
;
/**
* Describes the [Kind](#FoldingRangeKind) of the folding range such as [Comment](#FoldingRangeKind.Comment) or
* [Region](#FoldingRangeKind.Region). The kind is used to categorize folding ranges and used by commands
* like 'Fold all comments'. See
* [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.
*/
kind
?:
FoldingRangeKind
;
/**
* Creates a new folding range.
*
* @param start The start line of the folded range.
* @param end The end line of the folded range.
* @param kind The kind of the folding range.
*/
constructor
(
start
:
number
,
end
:
number
,
kind
?:
FoldingRangeKind
);
}
export
class
FoldingRangeKind
{
/**
* Kind for folding range representing a comment. The value of the kind is 'comment'.
*/
static
readonly
Comment
:
FoldingRangeKind
;
/**
* Kind for folding range representing a import. The value of the kind is 'imports'.
*/
static
readonly
Imports
:
FoldingRangeKind
;
/**
* Kind for folding range representing regions (for example a folding range marked by `#region` and `#endregion`).
* The value of the kind is 'region'.
*/
static
readonly
Region
:
FoldingRangeKind
;
/**
* String value of the kind, e.g. `comment`.
*/
readonly
value
:
string
;
/**
* Creates a new [FoldingRangeKind](#FoldingRangeKind).
*
* @param value of the kind.
*/
public
constructor
(
value
:
string
);
}
export
namespace
languages
{
/**
* Register a folding range provider.
*
* Multiple folding can be registered for a language. In that case providers are sorted
* by their [score](#languages.match) and the best-matching provider is used. Failure
* of the selected provider will cause a failure of the whole operation.
*
* @param selector A selector that defines the documents this provider is applicable to.
* @param provider A folding range provider.
* @param metadata Metadata about the kind of code actions the provider providers.
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
*/
export
function
registerFoldingRangeProvider
(
selector
:
DocumentSelector
,
provider
:
FoldingRangeProvider
,
metadata
?:
FoldingRangeProviderMetadata
):
Disposable
;
}
/**
* Metadata about the kind of folding ranges that a [FoldingRangeProvider](#FoldingRangeProvider) providers uses.
*/
export
interface
FoldingRangeProviderMetadata
{
/**
* [FoldingRangeKind](#FoldingRangeKind) that this provider may return.
*/
readonly
providedFoldingRangeKinds
?:
ReadonlyArray
<
FoldingRangeKind
>
;
}
/**
* Folding context (for future use)
*/
export
interface
FoldingContext
{
}
export
interface
FoldingRangeProvider
{
/**
* Returns a list of folding ranges or null and undefined if the provider
* does not want to participate or was cancelled.
* @param document The document in which the command was invoked.
* @param context Additional context information (for future use)
* @param token A cancellation token.
*/
provideFoldingRanges
(
document
:
TextDocument
,
context
:
FoldingContext
,
token
:
CancellationToken
):
ProviderResult
<
FoldingRange
[]
>
;
}
//#endregion
//#region Joh: file system provider
export
enum
FileChangeType
{
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
53dd6b09
...
...
@@ -328,9 +328,9 @@ export function createApiFactory(
registerColorProvider
(
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
DocumentColorProvider
):
vscode
.
Disposable
{
return
extHostLanguageFeatures
.
registerColorProvider
(
checkSelector
(
selector
),
provider
);
},
registerFoldingRangeProvider
:
proposedApiFunction
(
extension
,
(
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
FoldingRangeProvider
):
vscode
.
Disposable
=>
{
registerFoldingRangeProvider
(
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
FoldingRangeProvider
):
vscode
.
Disposable
{
return
extHostLanguageFeatures
.
registerFoldingRangeProvider
(
checkSelector
(
selector
),
provider
);
}
)
,
},
setLanguageConfiguration
:
(
language
:
string
,
configuration
:
vscode
.
LanguageConfiguration
):
vscode
.
Disposable
=>
{
return
extHostLanguageFeatures
.
setLanguageConfiguration
(
language
,
configuration
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录