Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
435f287a
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
435f287a
编写于
10月 08, 2021
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove support for `@monacodtsreplace` since TS has gotten a lot better at emitting dts
上级
0eaaf654
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
49 addition
and
93 deletion
+49
-93
build/lib/monaco-api.js
build/lib/monaco-api.js
+0
-20
build/lib/monaco-api.ts
build/lib/monaco-api.ts
+0
-19
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+46
-19
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+3
-35
未找到文件。
build/lib/monaco-api.js
浏览文件 @
435f287a
...
...
@@ -149,26 +149,6 @@ function getMassagedTopLevelDeclarationText(ts, sourceFile, declaration, importN
}
});
}
else
if
(
declaration
.
kind
===
ts
.
SyntaxKind
.
VariableStatement
)
{
const
jsDoc
=
result
.
substr
(
0
,
declaration
.
getLeadingTriviaWidth
(
sourceFile
));
if
(
jsDoc
.
indexOf
(
'
@monacodtsreplace
'
)
>=
0
)
{
const
jsDocLines
=
jsDoc
.
split
(
/
\r\n
|
\r
|
\n
/
);
let
directives
=
[];
for
(
const
jsDocLine
of
jsDocLines
)
{
const
m
=
jsDocLine
.
match
(
/^
\s
*
\*
\/([^/]
+
)\/([^/]
+
)\/
$/
);
if
(
m
)
{
directives
.
push
([
new
RegExp
(
m
[
1
],
'
g
'
),
m
[
2
]]);
}
}
// remove the jsdoc
result
=
result
.
substr
(
jsDoc
.
length
);
if
(
directives
.
length
>
0
)
{
// apply replace directives
const
replacer
=
createReplacerFromDirectives
(
directives
);
result
=
replacer
(
result
);
}
}
}
result
=
result
.
replace
(
/export default /g
,
'
export
'
);
result
=
result
.
replace
(
/export declare /g
,
'
export
'
);
result
=
result
.
replace
(
/declare /g
,
''
);
...
...
build/lib/monaco-api.ts
浏览文件 @
435f287a
...
...
@@ -178,25 +178,6 @@ function getMassagedTopLevelDeclarationText(ts: typeof import('typescript'), sou
// life..
}
});
}
else
if
(
declaration
.
kind
===
ts
.
SyntaxKind
.
VariableStatement
)
{
const
jsDoc
=
result
.
substr
(
0
,
declaration
.
getLeadingTriviaWidth
(
sourceFile
));
if
(
jsDoc
.
indexOf
(
'
@monacodtsreplace
'
)
>=
0
)
{
const
jsDocLines
=
jsDoc
.
split
(
/
\r\n
|
\r
|
\n
/
);
let
directives
:
[
RegExp
,
string
][]
=
[];
for
(
const
jsDocLine
of
jsDocLines
)
{
const
m
=
jsDocLine
.
match
(
/^
\s
*
\*
\/([^/]
+
)\/([^/]
+
)\/
$/
);
if
(
m
)
{
directives
.
push
([
new
RegExp
(
m
[
1
],
'
g
'
),
m
[
2
]]);
}
}
// remove the jsdoc
result
=
result
.
substr
(
jsDoc
.
length
);
if
(
directives
.
length
>
0
)
{
// apply replace directives
const
replacer
=
createReplacerFromDirectives
(
directives
);
result
=
replacer
(
result
);
}
}
}
result
=
result
.
replace
(
/export default /g
,
'
export
'
);
result
=
result
.
replace
(
/export declare /g
,
'
export
'
);
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
435f287a
...
...
@@ -1152,6 +1152,9 @@ export interface IEditorCommentsOptions {
ignoreEmptyLines
?:
boolean
;
}
/**
* @internal
*/
export
type
EditorCommentsOptions
=
Readonly
<
Required
<
IEditorCommentsOptions
>>
;
class
EditorComments
extends
BaseEditorOption
<
EditorOption
.
comments
,
EditorCommentsOptions
>
{
...
...
@@ -1382,6 +1385,9 @@ export interface IEditorFindOptions {
loop
?:
boolean
;
}
/**
* @internal
*/
export
type
EditorFindOptions
=
Readonly
<
Required
<
IEditorFindOptions
>>
;
class
EditorFind
extends
BaseEditorOption
<
EditorOption
.
find
,
EditorFindOptions
>
{
...
...
@@ -1634,6 +1640,9 @@ export interface IGotoLocationOptions {
alternativeReferenceCommand
?:
string
;
}
/**
* @internal
*/
export
type
GoToLocationOptions
=
Readonly
<
Required
<
IGotoLocationOptions
>>
;
class
EditorGoToLocation
extends
BaseEditorOption
<
EditorOption
.
gotoLocation
,
GoToLocationOptions
>
{
...
...
@@ -1769,6 +1778,9 @@ export interface IEditorHoverOptions {
sticky
?:
boolean
;
}
/**
* @internal
*/
export
type
EditorHoverOptions
=
Readonly
<
Required
<
IEditorHoverOptions
>>
;
class
EditorHover
extends
BaseEditorOption
<
EditorOption
.
hover
,
EditorHoverOptions
>
{
...
...
@@ -2390,6 +2402,9 @@ export interface IEditorLightbulbOptions {
enabled
?:
boolean
;
}
/**
* @internal
*/
export
type
EditorLightbulbOptions
=
Readonly
<
Required
<
IEditorLightbulbOptions
>>
;
class
EditorLightbulb
extends
BaseEditorOption
<
EditorOption
.
lightbulb
,
EditorLightbulbOptions
>
{
...
...
@@ -2446,6 +2461,9 @@ export interface IEditorInlayHintsOptions {
fontFamily
?:
string
;
}
/**
* @internal
*/
export
type
EditorInlayHintsOptions
=
Readonly
<
Required
<
IEditorInlayHintsOptions
>>
;
class
EditorInlayHints
extends
BaseEditorOption
<
EditorOption
.
inlayHints
,
EditorInlayHintsOptions
>
{
...
...
@@ -2554,6 +2572,9 @@ export interface IEditorMinimapOptions {
scale
?:
number
;
}
/**
* @internal
*/
export
type
EditorMinimapOptions
=
Readonly
<
Required
<
IEditorMinimapOptions
>>
;
class
EditorMinimap
extends
BaseEditorOption
<
EditorOption
.
minimap
,
EditorMinimapOptions
>
{
...
...
@@ -2667,10 +2688,10 @@ export interface IEditorPaddingOptions {
bottom
?:
number
;
}
export
interface
InternalEditorPaddingOptions
{
readonly
top
:
number
;
readonly
bottom
:
number
;
}
/**
* @internal
*/
export
type
InternalEditorPaddingOptions
=
Readonly
<
Required
<
IEditorPaddingOptions
>>
;
class
EditorPadding
extends
BaseEditorOption
<
EditorOption
.
padding
,
InternalEditorPaddingOptions
>
{
...
...
@@ -2728,6 +2749,9 @@ export interface IEditorParameterHintOptions {
cycle
?:
boolean
;
}
/**
* @internal
*/
export
type
InternalParameterHintOptions
=
Readonly
<
Required
<
IEditorParameterHintOptions
>>
;
class
EditorParameterHints
extends
BaseEditorOption
<
EditorOption
.
parameterHints
,
InternalParameterHintOptions
>
{
...
...
@@ -2794,6 +2818,9 @@ export interface IQuickSuggestionsOptions {
strings
?:
boolean
;
}
/**
* @internal
*/
export
type
ValidQuickSuggestionsOptions
=
boolean
|
Readonly
<
Required
<
IQuickSuggestionsOptions
>>
;
class
EditorQuickSuggestions
extends
BaseEditorOption
<
EditorOption
.
quickSuggestions
,
ValidQuickSuggestionsOptions
>
{
...
...
@@ -3226,6 +3253,9 @@ export interface IInlineSuggestOptions {
mode
?:
'
prefix
'
|
'
subword
'
|
'
subwordSmart
'
;
}
/**
* @internal
*/
export
type
InternalInlineSuggestOptions
=
Readonly
<
Required
<
IInlineSuggestOptions
>>
;
/**
...
...
@@ -3273,6 +3303,9 @@ export interface IBracketPairColorizationOptions {
enabled
?:
boolean
;
}
/**
* @internal
*/
export
type
InternalBracketPairColorizationOptions
=
Readonly
<
Required
<
IBracketPairColorizationOptions
>>
;
/**
...
...
@@ -3330,6 +3363,9 @@ export interface IGuidesOptions {
highlightActiveIndentation
?:
boolean
;
}
/**
* @internal
*/
export
type
InternalGuidesOptions
=
Readonly
<
Required
<
IGuidesOptions
>>
;
/**
...
...
@@ -3540,6 +3576,9 @@ export interface ISuggestOptions {
showSnippets
?:
boolean
;
}
/**
* @internal
*/
export
type
InternalSuggestOptions
=
Readonly
<
Required
<
ISuggestOptions
>>
;
class
EditorSuggest
extends
BaseEditorOption
<
EditorOption
.
suggest
,
InternalSuggestOptions
>
{
...
...
@@ -3851,6 +3890,9 @@ export interface ISmartSelectOptions {
selectLeadingAndTrailingWhitespace
?:
boolean
}
/**
* @internal
*/
export
type
SmartSelectOptions
=
Readonly
<
Required
<
ISmartSelectOptions
>>
;
class
SmartSelect
extends
BaseEditorOption
<
EditorOption
.
smartSelect
,
SmartSelectOptions
>
{
...
...
@@ -4140,21 +4182,6 @@ export const enum EditorOption {
wrappingInfo
,
}
/**
* WORKAROUND: TS emits "any" for complex editor options values (anything except string, bool, enum, etc. ends up being "any")
* @monacodtsreplace
* /accessibilitySupport, any/accessibilitySupport, AccessibilitySupport/
* /comments, any/comments, EditorCommentsOptions/
* /find, any/find, EditorFindOptions/
* /fontInfo, any/fontInfo, FontInfo/
* /gotoLocation, any/gotoLocation, GoToLocationOptions/
* /hover, any/hover, EditorHoverOptions/
* /lightbulb, any/lightbulb, EditorLightbulbOptions/
* /minimap, any/minimap, EditorMinimapOptions/
* /parameterHints, any/parameterHints, InternalParameterHintOptions/
* /quickSuggestions, any/quickSuggestions, ValidQuickSuggestionsOptions/
* /suggest, any/suggest, InternalSuggestOptions/
*/
export
const
EditorOptions
=
{
acceptSuggestionOnCommitCharacter
:
register
(
new
EditorBooleanOption
(
EditorOption
.
acceptSuggestionOnCommitCharacter
,
'
acceptSuggestionOnCommitCharacter
'
,
true
,
...
...
src/vs/monaco.d.ts
浏览文件 @
435f287a
...
...
@@ -3377,8 +3377,6 @@ declare namespace monaco.editor {
ignoreEmptyLines
?:
boolean
;
}
export
type
EditorCommentsOptions
=
Readonly
<
Required
<
IEditorCommentsOptions
>>
;
/**
* The kind of animation in which the editor's cursor should be rendered.
*/
...
...
@@ -3462,8 +3460,6 @@ declare namespace monaco.editor {
loop
?:
boolean
;
}
export
type
EditorFindOptions
=
Readonly
<
Required
<
IEditorFindOptions
>>
;
export
type
GoToLocationValues
=
'
peek
'
|
'
gotoAndPeek
'
|
'
goto
'
;
/**
...
...
@@ -3483,8 +3479,6 @@ declare namespace monaco.editor {
alternativeReferenceCommand
?:
string
;
}
export
type
GoToLocationOptions
=
Readonly
<
Required
<
IGotoLocationOptions
>>
;
/**
* Configuration options for editor hover
*/
...
...
@@ -3506,8 +3500,6 @@ declare namespace monaco.editor {
sticky
?:
boolean
;
}
export
type
EditorHoverOptions
=
Readonly
<
Required
<
IEditorHoverOptions
>>
;
/**
* A description for the overview ruler position.
*/
...
...
@@ -3633,8 +3625,6 @@ declare namespace monaco.editor {
enabled
?:
boolean
;
}
export
type
EditorLightbulbOptions
=
Readonly
<
Required
<
IEditorLightbulbOptions
>>
;
/**
* Configuration options for editor inlayHints
*/
...
...
@@ -3656,8 +3646,6 @@ declare namespace monaco.editor {
fontFamily
?:
string
;
}
export
type
EditorInlayHintsOptions
=
Readonly
<
Required
<
IEditorInlayHintsOptions
>>
;
/**
* Configuration options for editor minimap
*/
...
...
@@ -3698,8 +3686,6 @@ declare namespace monaco.editor {
scale
?:
number
;
}
export
type
EditorMinimapOptions
=
Readonly
<
Required
<
IEditorMinimapOptions
>>
;
/**
* Configuration options for editor padding
*/
...
...
@@ -3714,11 +3700,6 @@ declare namespace monaco.editor {
bottom
?:
number
;
}
export
interface
InternalEditorPaddingOptions
{
readonly
top
:
number
;
readonly
bottom
:
number
;
}
/**
* Configuration options for parameter hints
*/
...
...
@@ -3735,8 +3716,6 @@ declare namespace monaco.editor {
cycle
?:
boolean
;
}
export
type
InternalParameterHintOptions
=
Readonly
<
Required
<
IEditorParameterHintOptions
>>
;
/**
* Configuration options for quick suggestions
*/
...
...
@@ -3746,8 +3725,6 @@ declare namespace monaco.editor {
strings
?:
boolean
;
}
export
type
ValidQuickSuggestionsOptions
=
boolean
|
Readonly
<
Required
<
IQuickSuggestionsOptions
>>
;
export
type
LineNumbersType
=
'
on
'
|
'
off
'
|
'
relative
'
|
'
interval
'
|
((
lineNumber
:
number
)
=>
string
);
export
enum
RenderLineNumbersType
{
...
...
@@ -3877,8 +3854,6 @@ declare namespace monaco.editor {
mode
?:
'
prefix
'
|
'
subword
'
|
'
subwordSmart
'
;
}
export
type
InternalInlineSuggestOptions
=
Readonly
<
Required
<
IInlineSuggestOptions
>>
;
export
interface
IBracketPairColorizationOptions
{
/**
* Enable or disable bracket pair colorization.
...
...
@@ -3886,8 +3861,6 @@ declare namespace monaco.editor {
enabled
?:
boolean
;
}
export
type
InternalBracketPairColorizationOptions
=
Readonly
<
Required
<
IBracketPairColorizationOptions
>>
;
export
interface
IGuidesOptions
{
/**
* Enable rendering of bracket pair guides.
...
...
@@ -3905,8 +3878,6 @@ declare namespace monaco.editor {
highlightActiveIndentation
?:
boolean
;
}
export
type
InternalGuidesOptions
=
Readonly
<
Required
<
IGuidesOptions
>>
;
/**
* Configuration options for editor suggest widget
*/
...
...
@@ -4065,14 +4036,10 @@ declare namespace monaco.editor {
showSnippets
?:
boolean
;
}
export
type
InternalSuggestOptions
=
Readonly
<
Required
<
ISuggestOptions
>>
;
export
interface
ISmartSelectOptions
{
selectLeadingAndTrailingWhitespace
?:
boolean
;
}
export
type
SmartSelectOptions
=
Readonly
<
Required
<
ISmartSelectOptions
>>
;
/**
* Describes how to indent wrapped lines.
*/
...
...
@@ -4235,6 +4202,7 @@ declare namespace monaco.editor {
layoutInfo
=
129
,
wrappingInfo
=
130
}
export
const
EditorOptions
:
{
acceptSuggestionOnCommitCharacter
:
IEditorOption
<
EditorOption
.
acceptSuggestionOnCommitCharacter
,
boolean
>
;
acceptSuggestionOnEnter
:
IEditorOption
<
EditorOption
.
acceptSuggestionOnEnter
,
'
on
'
|
'
off
'
|
'
smart
'
>
;
...
...
@@ -4310,11 +4278,11 @@ declare namespace monaco.editor {
occurrencesHighlight
:
IEditorOption
<
EditorOption
.
occurrencesHighlight
,
boolean
>
;
overviewRulerBorder
:
IEditorOption
<
EditorOption
.
overviewRulerBorder
,
boolean
>
;
overviewRulerLanes
:
IEditorOption
<
EditorOption
.
overviewRulerLanes
,
number
>
;
padding
:
IEditorOption
<
EditorOption
.
padding
,
InternalEditorPaddingOptions
>
;
padding
:
IEditorOption
<
EditorOption
.
padding
,
Readonly
<
Required
<
IEditorPaddingOptions
>>
>
;
parameterHints
:
IEditorOption
<
EditorOption
.
parameterHints
,
Readonly
<
Required
<
IEditorParameterHintOptions
>>>
;
peekWidgetDefaultFocus
:
IEditorOption
<
EditorOption
.
peekWidgetDefaultFocus
,
'
tree
'
|
'
editor
'
>
;
definitionLinkOpensInPeek
:
IEditorOption
<
EditorOption
.
definitionLinkOpensInPeek
,
boolean
>
;
quickSuggestions
:
IEditorOption
<
EditorOption
.
quickSuggestions
,
ValidQuickSuggestionsOptions
>
;
quickSuggestions
:
IEditorOption
<
EditorOption
.
quickSuggestions
,
any
>
;
quickSuggestionsDelay
:
IEditorOption
<
EditorOption
.
quickSuggestionsDelay
,
number
>
;
readOnly
:
IEditorOption
<
EditorOption
.
readOnly
,
boolean
>
;
renameOnType
:
IEditorOption
<
EditorOption
.
renameOnType
,
boolean
>
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录