Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
bc659cf3
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,发现更多精彩内容 >>
提交
bc659cf3
编写于
2月 12, 2019
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move editor.codeInsets setting to its contribution because it isn't a monaco editor thing
上级
d02c8011
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
26 addition
and
22 deletion
+26
-22
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+0
-9
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+0
-6
src/vs/workbench/parts/codeinset/codeInset.contribution.ts
src/vs/workbench/parts/codeinset/codeInset.contribution.ts
+26
-7
未找到文件。
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
bc659cf3
...
@@ -600,11 +600,6 @@ export interface IEditorOptions {
...
@@ -600,11 +600,6 @@ export interface IEditorOptions {
* Defaults to true.
* Defaults to true.
*/
*/
codeLens
?:
boolean
;
codeLens
?:
boolean
;
/**
* Show code insets
* Defaults to true.
*/
codeInsets
?:
boolean
;
/**
/**
* Control the behavior and rendering of the code action lightbulb.
* Control the behavior and rendering of the code action lightbulb.
*/
*/
...
@@ -1001,7 +996,6 @@ export interface EditorContribOptions {
...
@@ -1001,7 +996,6 @@ export interface EditorContribOptions {
readonly
selectionHighlight
:
boolean
;
readonly
selectionHighlight
:
boolean
;
readonly
occurrencesHighlight
:
boolean
;
readonly
occurrencesHighlight
:
boolean
;
readonly
codeLens
:
boolean
;
readonly
codeLens
:
boolean
;
readonly
codeInsets
:
boolean
;
readonly
folding
:
boolean
;
readonly
folding
:
boolean
;
readonly
foldingStrategy
:
'
auto
'
|
'
indentation
'
;
readonly
foldingStrategy
:
'
auto
'
|
'
indentation
'
;
readonly
showFoldingControls
:
'
always
'
|
'
mouseover
'
;
readonly
showFoldingControls
:
'
always
'
|
'
mouseover
'
;
...
@@ -2057,7 +2051,6 @@ export class EditorOptionsValidator {
...
@@ -2057,7 +2051,6 @@ export class EditorOptionsValidator {
selectionHighlight
:
_boolean
(
opts
.
selectionHighlight
,
defaults
.
selectionHighlight
),
selectionHighlight
:
_boolean
(
opts
.
selectionHighlight
,
defaults
.
selectionHighlight
),
occurrencesHighlight
:
_boolean
(
opts
.
occurrencesHighlight
,
defaults
.
occurrencesHighlight
),
occurrencesHighlight
:
_boolean
(
opts
.
occurrencesHighlight
,
defaults
.
occurrencesHighlight
),
codeLens
:
_boolean
(
opts
.
codeLens
,
defaults
.
codeLens
),
codeLens
:
_boolean
(
opts
.
codeLens
,
defaults
.
codeLens
),
codeInsets
:
_boolean
(
opts
.
codeInsets
,
defaults
.
codeInsets
),
folding
:
_boolean
(
opts
.
folding
,
defaults
.
folding
),
folding
:
_boolean
(
opts
.
folding
,
defaults
.
folding
),
foldingStrategy
:
_stringSet
<
'
auto
'
|
'
indentation
'
>
(
opts
.
foldingStrategy
,
defaults
.
foldingStrategy
,
[
'
auto
'
,
'
indentation
'
]),
foldingStrategy
:
_stringSet
<
'
auto
'
|
'
indentation
'
>
(
opts
.
foldingStrategy
,
defaults
.
foldingStrategy
,
[
'
auto
'
,
'
indentation
'
]),
showFoldingControls
:
_stringSet
<
'
always
'
|
'
mouseover
'
>
(
opts
.
showFoldingControls
,
defaults
.
showFoldingControls
,
[
'
always
'
,
'
mouseover
'
]),
showFoldingControls
:
_stringSet
<
'
always
'
|
'
mouseover
'
>
(
opts
.
showFoldingControls
,
defaults
.
showFoldingControls
,
[
'
always
'
,
'
mouseover
'
]),
...
@@ -2171,7 +2164,6 @@ export class InternalEditorOptionsFactory {
...
@@ -2171,7 +2164,6 @@ export class InternalEditorOptionsFactory {
selectionHighlight
:
(
accessibilityIsOn
?
false
:
opts
.
contribInfo
.
selectionHighlight
),
// DISABLED WHEN SCREEN READER IS ATTACHED
selectionHighlight
:
(
accessibilityIsOn
?
false
:
opts
.
contribInfo
.
selectionHighlight
),
// DISABLED WHEN SCREEN READER IS ATTACHED
occurrencesHighlight
:
(
accessibilityIsOn
?
false
:
opts
.
contribInfo
.
occurrencesHighlight
),
// DISABLED WHEN SCREEN READER IS ATTACHED
occurrencesHighlight
:
(
accessibilityIsOn
?
false
:
opts
.
contribInfo
.
occurrencesHighlight
),
// DISABLED WHEN SCREEN READER IS ATTACHED
codeLens
:
(
accessibilityIsOn
?
false
:
opts
.
contribInfo
.
codeLens
),
// DISABLED WHEN SCREEN READER IS ATTACHED
codeLens
:
(
accessibilityIsOn
?
false
:
opts
.
contribInfo
.
codeLens
),
// DISABLED WHEN SCREEN READER IS ATTACHED
codeInsets
:
(
accessibilityIsOn
?
false
:
opts
.
contribInfo
.
codeInsets
),
folding
:
(
accessibilityIsOn
?
false
:
opts
.
contribInfo
.
folding
),
// DISABLED WHEN SCREEN READER IS ATTACHED
folding
:
(
accessibilityIsOn
?
false
:
opts
.
contribInfo
.
folding
),
// DISABLED WHEN SCREEN READER IS ATTACHED
foldingStrategy
:
opts
.
contribInfo
.
foldingStrategy
,
foldingStrategy
:
opts
.
contribInfo
.
foldingStrategy
,
showFoldingControls
:
opts
.
contribInfo
.
showFoldingControls
,
showFoldingControls
:
opts
.
contribInfo
.
showFoldingControls
,
...
@@ -2661,7 +2653,6 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
...
@@ -2661,7 +2653,6 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
selectionHighlight
:
true
,
selectionHighlight
:
true
,
occurrencesHighlight
:
true
,
occurrencesHighlight
:
true
,
codeLens
:
true
,
codeLens
:
true
,
codeInsets
:
true
,
folding
:
true
,
folding
:
true
,
foldingStrategy
:
'
auto
'
,
foldingStrategy
:
'
auto
'
,
showFoldingControls
:
'
mouseover
'
,
showFoldingControls
:
'
mouseover
'
,
...
...
src/vs/monaco.d.ts
浏览文件 @
bc659cf3
...
@@ -2934,11 +2934,6 @@ declare namespace monaco.editor {
...
@@ -2934,11 +2934,6 @@ declare namespace monaco.editor {
* Defaults to true.
* Defaults to true.
*/
*/
codeLens
?:
boolean
;
codeLens
?:
boolean
;
/**
* Show code insets
* Defaults to true.
*/
codeInsets
?:
boolean
;
/**
/**
* Control the behavior and rendering of the code action lightbulb.
* Control the behavior and rendering of the code action lightbulb.
*/
*/
...
@@ -3276,7 +3271,6 @@ declare namespace monaco.editor {
...
@@ -3276,7 +3271,6 @@ declare namespace monaco.editor {
readonly
selectionHighlight
:
boolean
;
readonly
selectionHighlight
:
boolean
;
readonly
occurrencesHighlight
:
boolean
;
readonly
occurrencesHighlight
:
boolean
;
readonly
codeLens
:
boolean
;
readonly
codeLens
:
boolean
;
readonly
codeInsets
:
boolean
;
readonly
folding
:
boolean
;
readonly
folding
:
boolean
;
readonly
foldingStrategy
:
'
auto
'
|
'
indentation
'
;
readonly
foldingStrategy
:
'
auto
'
|
'
indentation
'
;
readonly
showFoldingControls
:
'
always
'
|
'
mouseover
'
;
readonly
showFoldingControls
:
'
always
'
|
'
mouseover
'
;
...
...
src/vs/workbench/parts/codeinset/codeInset.contribution.ts
浏览文件 @
bc659cf3
...
@@ -21,6 +21,10 @@ import { getCodeInsetData, ICodeInsetData } from './codeinset';
...
@@ -21,6 +21,10 @@ import { getCodeInsetData, ICodeInsetData } from './codeinset';
import
{
registerEditorContribution
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
registerEditorContribution
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
MainThreadWebviews
}
from
'
vs/workbench/api/electron-browser/mainThreadWebview
'
;
import
{
MainThreadWebviews
}
from
'
vs/workbench/api/electron-browser/mainThreadWebview
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
localize
}
from
'
vs/nls.mock
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
export
class
CodeInsetController
implements
editorCommon
.
IEditorContribution
{
export
class
CodeInsetController
implements
editorCommon
.
IEditorContribution
{
...
@@ -41,9 +45,10 @@ export class CodeInsetController implements editorCommon.IEditorContribution {
...
@@ -41,9 +45,10 @@ export class CodeInsetController implements editorCommon.IEditorContribution {
private
_editor
:
editorBrowser
.
ICodeEditor
,
private
_editor
:
editorBrowser
.
ICodeEditor
,
@
ICommandService
private
readonly
_commandService
:
ICommandService
,
@
ICommandService
private
readonly
_commandService
:
ICommandService
,
@
INotificationService
private
readonly
_notificationService
:
INotificationService
,
@
INotificationService
private
readonly
_notificationService
:
INotificationService
,
@
IExtensionService
private
readonly
_extensionService
:
IExtensionService
@
IExtensionService
private
readonly
_extensionService
:
IExtensionService
,
@
IConfigurationService
private
readonly
_configService
:
IConfigurationService
,
)
{
)
{
this
.
_isEnabled
=
this
.
_
editor
.
getConfiguration
().
contribInfo
.
codeInsets
;
this
.
_isEnabled
=
this
.
_
configService
.
getValue
<
boolean
>
(
'
editor.codeInsets
'
)
;
this
.
_globalToDispose
=
[];
this
.
_globalToDispose
=
[];
this
.
_localToDispose
=
[];
this
.
_localToDispose
=
[];
...
@@ -53,12 +58,14 @@ export class CodeInsetController implements editorCommon.IEditorContribution {
...
@@ -53,12 +58,14 @@ export class CodeInsetController implements editorCommon.IEditorContribution {
this
.
_globalToDispose
.
push
(
this
.
_editor
.
onDidChangeModel
(()
=>
this
.
_onModelChange
()));
this
.
_globalToDispose
.
push
(
this
.
_editor
.
onDidChangeModel
(()
=>
this
.
_onModelChange
()));
this
.
_globalToDispose
.
push
(
this
.
_editor
.
onDidChangeModelLanguage
(()
=>
this
.
_onModelChange
()));
this
.
_globalToDispose
.
push
(
this
.
_editor
.
onDidChangeModelLanguage
(()
=>
this
.
_onModelChange
()));
this
.
_globalToDispose
.
push
(
this
.
_editor
.
onDidChangeConfiguration
(()
=>
{
this
.
_globalToDispose
.
push
(
this
.
_configService
.
onDidChangeConfiguration
(
e
=>
{
if
(
e
.
affectsConfiguration
(
'
editor.codeInsets
'
))
{
let
prevIsEnabled
=
this
.
_isEnabled
;
let
prevIsEnabled
=
this
.
_isEnabled
;
this
.
_isEnabled
=
this
.
_editor
.
getConfiguration
().
contribInfo
.
codeInsets
;
this
.
_isEnabled
=
this
.
_configService
.
getValue
<
boolean
>
(
'
editor.codeInsets
'
)
;
if
(
prevIsEnabled
!==
this
.
_isEnabled
)
{
if
(
prevIsEnabled
!==
this
.
_isEnabled
)
{
this
.
_onModelChange
();
this
.
_onModelChange
();
}
}
}
}));
}));
this
.
_globalToDispose
.
push
(
CodeInsetProviderRegistry
.
onDidChange
(
this
.
_onModelChange
,
this
));
this
.
_globalToDispose
.
push
(
CodeInsetProviderRegistry
.
onDidChange
(
this
.
_onModelChange
,
this
));
this
.
_onModelChange
();
this
.
_onModelChange
();
...
@@ -333,3 +340,15 @@ export class CodeInsetController implements editorCommon.IEditorContribution {
...
@@ -333,3 +340,15 @@ export class CodeInsetController implements editorCommon.IEditorContribution {
}
}
registerEditorContribution
(
CodeInsetController
);
registerEditorContribution
(
CodeInsetController
);
Registry
.
as
<
IConfigurationRegistry
>
(
ConfigurationExtensions
.
Configuration
).
registerConfiguration
({
id
:
'
editor
'
,
properties
:
{
[
'
editor.codeInsets
'
]:
{
description
:
localize
(
'
editor.codeInsets
'
,
"
Enable/disable editor code insets
"
),
type
:
'
boolean
'
,
default
:
false
}
}
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录