Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
f886259e
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,发现更多精彩内容 >>
提交
f886259e
编写于
3月 01, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #5351: Add editor.occurrencesHighlight option
上级
e7292265
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
38 addition
and
0 deletion
+38
-0
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+6
-0
src/vs/editor/common/config/defaultConfig.ts
src/vs/editor/common/config/defaultConfig.ts
+1
-0
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+9
-0
src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts
.../editor/contrib/wordHighlighter/common/wordHighlighter.ts
+15
-0
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+6
-0
src/vs/platform/telemetry/common/telemetryUtils.ts
src/vs/platform/telemetry/common/telemetryUtils.ts
+1
-0
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
f886259e
...
...
@@ -315,6 +315,7 @@ class InternalEditorOptionsHelper {
suggestFontSize
:
opts
.
suggestFontSize
,
suggestLineHeight
:
opts
.
suggestLineHeight
,
selectionHighlight
:
toBoolean
(
opts
.
selectionHighlight
),
occurrencesHighlight
:
toBoolean
(
opts
.
occurrencesHighlight
),
codeLens
:
opts
.
referenceInfos
&&
opts
.
codeLens
,
folding
:
toBoolean
(
opts
.
folding
),
matchBrackets
:
toBoolean
(
opts
.
matchBrackets
),
...
...
@@ -797,6 +798,11 @@ const editorConfiguration: IConfigurationNode = {
'
default
'
:
DefaultConfig
.
editor
.
selectionHighlight
,
'
description
'
:
nls
.
localize
(
'
selectionHighlight
'
,
"
Controls whether the editor should highlight similar matches to the selection
"
)
},
'
editor.occurrencesHighlight
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
DefaultConfig
.
editor
.
occurrencesHighlight
,
'
description
'
:
nls
.
localize
(
'
occurrencesHighlight
'
,
"
Controls whether the editor should highlight semantic symbol occurrences
"
)
},
'
editor.overviewRulerLanes
'
:
{
'
type
'
:
'
integer
'
,
'
default
'
:
3
,
...
...
src/vs/editor/common/config/defaultConfig.ts
浏览文件 @
f886259e
...
...
@@ -100,6 +100,7 @@ class ConfigClass implements IConfiguration {
suggestFontSize
:
0
,
suggestLineHeight
:
0
,
selectionHighlight
:
true
,
occurrencesHighlight
:
true
,
codeLens
:
true
,
referenceInfos
:
true
,
folding
:
true
,
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
f886259e
...
...
@@ -485,6 +485,11 @@ export interface IEditorOptions {
* Defaults to true.
*/
selectionHighlight
?:
boolean
;
/**
* Enable semantic occurrences highlight.
* Defaults to true.
*/
occurrencesHighlight
?:
boolean
;
/**
* Show code lens
* Defaults to true.
...
...
@@ -996,6 +1001,7 @@ export class EditorContribOptions {
readonly
suggestFontSize
:
number
;
readonly
suggestLineHeight
:
number
;
readonly
selectionHighlight
:
boolean
;
readonly
occurrencesHighlight
:
boolean
;
readonly
codeLens
:
boolean
;
readonly
folding
:
boolean
;
readonly
matchBrackets
:
boolean
;
...
...
@@ -1022,6 +1028,7 @@ export class EditorContribOptions {
suggestFontSize
:
number
;
suggestLineHeight
:
number
;
selectionHighlight
:
boolean
;
occurrencesHighlight
:
boolean
;
codeLens
:
boolean
;
folding
:
boolean
;
matchBrackets
:
boolean
;
...
...
@@ -1044,6 +1051,7 @@ export class EditorContribOptions {
this
.
suggestFontSize
=
source
.
suggestFontSize
;
this
.
suggestLineHeight
=
source
.
suggestLineHeight
;
this
.
selectionHighlight
=
Boolean
(
source
.
selectionHighlight
);
this
.
occurrencesHighlight
=
Boolean
(
source
.
occurrencesHighlight
);
this
.
codeLens
=
Boolean
(
source
.
codeLens
);
this
.
folding
=
Boolean
(
source
.
folding
);
this
.
matchBrackets
=
Boolean
(
source
.
matchBrackets
);
...
...
@@ -1072,6 +1080,7 @@ export class EditorContribOptions {
&&
this
.
suggestFontSize
===
other
.
suggestFontSize
&&
this
.
suggestLineHeight
===
other
.
suggestLineHeight
&&
this
.
selectionHighlight
===
other
.
selectionHighlight
&&
this
.
occurrencesHighlight
===
other
.
occurrencesHighlight
&&
this
.
codeLens
===
other
.
codeLens
&&
this
.
folding
===
other
.
folding
&&
this
.
matchBrackets
===
other
.
matchBrackets
...
...
src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts
浏览文件 @
f886259e
...
...
@@ -49,6 +49,7 @@ CommonEditorRegistry.registerDefaultLanguageCommand('_executeDocumentHighlights'
class
WordHighlighter
{
private
editor
:
editorCommon
.
ICommonCodeEditor
;
private
occurrencesHighlight
:
boolean
;
private
model
:
editorCommon
.
IModel
;
private
_lastWordRange
:
Range
;
private
_decorationIds
:
string
[];
...
...
@@ -64,6 +65,7 @@ class WordHighlighter {
constructor
(
editor
:
editorCommon
.
ICommonCodeEditor
)
{
this
.
editor
=
editor
;
this
.
occurrencesHighlight
=
this
.
editor
.
getConfiguration
().
contribInfo
.
occurrencesHighlight
;
this
.
model
=
this
.
editor
.
getModel
();
this
.
toUnhook
=
[];
this
.
toUnhook
.
push
(
editor
.
onDidChangeCursorPosition
((
e
:
editorCommon
.
ICursorPositionChangedEvent
)
=>
{
...
...
@@ -76,6 +78,13 @@ class WordHighlighter {
this
.
toUnhook
.
push
(
editor
.
onDidChangeModelContent
((
e
)
=>
{
this
.
_stopAll
();
}));
this
.
toUnhook
.
push
(
editor
.
onDidChangeConfiguration
((
e
)
=>
{
let
newValue
=
this
.
editor
.
getConfiguration
().
contribInfo
.
occurrencesHighlight
;
if
(
this
.
occurrencesHighlight
!==
newValue
)
{
this
.
occurrencesHighlight
=
newValue
;
this
.
_stopAll
();
}
}));
this
.
_lastWordRange
=
null
;
this
.
_decorationIds
=
[];
...
...
@@ -121,6 +130,12 @@ class WordHighlighter {
private
_onPositionChanged
(
e
:
editorCommon
.
ICursorPositionChangedEvent
):
void
{
// disabled
if
(
!
this
.
occurrencesHighlight
)
{
this
.
_stopAll
();
return
;
}
// ignore typing & other
if
(
e
.
reason
!==
editorCommon
.
CursorChangeReason
.
Explicit
)
{
this
.
_stopAll
();
...
...
src/vs/monaco.d.ts
浏览文件 @
f886259e
...
...
@@ -1409,6 +1409,11 @@ declare module monaco.editor {
* Defaults to true.
*/
selectionHighlight
?:
boolean
;
/**
* Enable semantic occurrences highlight.
* Defaults to true.
*/
occurrencesHighlight
?:
boolean
;
/**
* Show code lens
* Defaults to true.
...
...
@@ -1612,6 +1617,7 @@ declare module monaco.editor {
readonly
suggestFontSize
:
number
;
readonly
suggestLineHeight
:
number
;
readonly
selectionHighlight
:
boolean
;
readonly
occurrencesHighlight
:
boolean
;
readonly
codeLens
:
boolean
;
readonly
folding
:
boolean
;
readonly
matchBrackets
:
boolean
;
...
...
src/vs/platform/telemetry/common/telemetryUtils.ts
浏览文件 @
f886259e
...
...
@@ -243,6 +243,7 @@ const configurationValueWhitelist = [
'
editor.quickSuggestionsDelay
'
,
'
editor.snippetSuggestions
'
,
'
editor.selectionHighlight
'
,
'
editor.occurrencesHighlight
'
,
'
editor.glyphMargin
'
,
'
editor.wordSeparators
'
,
'
editor.mouseWheelScrollSensitivity
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录