Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
ad3289c0
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,发现更多精彩内容 >>
提交
ad3289c0
编写于
9月 05, 2019
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove IEditorOption.equals
上级
bcd154cc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
147 deletion
+17
-147
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+17
-1
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+0
-146
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
ad3289c0
...
...
@@ -7,6 +7,7 @@ import * as nls from 'vs/nls';
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
*
as
arrays
from
'
vs/base/common/arrays
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
IEditorOptions
,
editorOptionsRegistry
,
ValidatedEditorOptions
,
IEnvironmentalOptions
,
ComputedEditorOptions
,
ConfigurationChangedEvent
,
EDITOR_FONT_DEFAULTS
,
EditorOptions
,
EDITOR_MODEL_DEFAULTS
,
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
EditorZoom
}
from
'
vs/editor/common/config/editorZoom
'
;
...
...
@@ -97,11 +98,26 @@ class EditorConfiguration2 {
return
result
;
}
private
static
_deepEquals
<
T
>
(
a
:
T
,
b
:
T
):
boolean
{
if
(
typeof
a
!==
'
object
'
||
typeof
b
!==
'
object
'
)
{
return
(
a
===
b
);
}
if
(
Array
.
isArray
(
a
)
||
Array
.
isArray
(
b
))
{
return
(
Array
.
isArray
(
a
)
&&
Array
.
isArray
(
b
)
?
arrays
.
equals
(
a
,
b
)
:
false
);
}
for
(
let
key
in
a
)
{
if
(
!
EditorConfiguration2
.
_deepEquals
(
a
[
key
],
b
[
key
]))
{
return
false
;
}
}
return
true
;
}
public
static
checkEquals
(
a
:
ComputedEditorOptions
,
b
:
ComputedEditorOptions
):
ConfigurationChangedEvent
|
null
{
const
result
:
boolean
[]
=
[];
let
somethingChanged
=
false
;
for
(
const
editorOption
of
editorOptionsRegistry
)
{
const
changed
=
!
editorOption
.
e
quals
(
a
.
_read
(
editorOption
.
id
),
b
.
_read
(
editorOption
.
id
));
const
changed
=
!
EditorConfiguration2
.
_deepE
quals
(
a
.
_read
(
editorOption
.
id
),
b
.
_read
(
editorOption
.
id
));
result
[
editorOption
.
id
]
=
changed
;
if
(
changed
)
{
somethingChanged
=
true
;
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
ad3289c0
...
...
@@ -5,8 +5,6 @@
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
assert
from
'
vs/base/common/assert
'
;
import
*
as
arrays
from
'
vs/base/common/arrays
'
;
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
ScrollbarVisibility
}
from
'
vs/base/common/scrollable
'
;
import
{
FontInfo
}
from
'
vs/editor/common/config/fontInfo
'
;
...
...
@@ -1144,10 +1142,6 @@ export interface IEditorOption<K1 extends EditorOption, K2 extends keyof IExtend
* @internal
*/
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
T2
):
T3
;
/**
* @internal
*/
equals
(
a
:
T3
,
b
:
T3
):
boolean
;
}
/**
...
...
@@ -1169,9 +1163,6 @@ abstract class BaseEditorOption<K1 extends EditorOption, K2 extends keyof IExten
}
public
abstract
validate
(
input
:
IExtendedEditorOptions
[
K2
]
|
undefined
):
T2
;
public
abstract
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
T2
):
T3
;
public
equals
(
a
:
T3
,
b
:
T3
):
boolean
{
return
(
a
===
b
);
}
}
class
EditorBooleanOption
<
K1
extends
EditorOption
,
K2
extends
PossibleKeyName
<
boolean
>>
extends
BaseEditorOption
<
K1
,
K2
,
boolean
>
{
...
...
@@ -1296,12 +1287,6 @@ class EditorRenderLineNumbersOption<K1 extends EditorOption, K2 extends Possible
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
InternalEditorRenderLineNumbersOptions
):
InternalEditorRenderLineNumbersOptions
{
return
value
;
}
public
equals
(
a
:
InternalEditorRenderLineNumbersOptions
,
b
:
InternalEditorRenderLineNumbersOptions
):
boolean
{
return
(
a
.
renderType
===
b
.
renderType
&&
a
.
renderFn
===
b
.
renderFn
);
}
}
//#endregion
...
...
@@ -1332,15 +1317,6 @@ class EditorMinimap<K1 extends EditorOption, K2 extends PossibleKeyName<IEditorM
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
InternalEditorMinimapOptions
):
InternalEditorMinimapOptions
{
return
value
;
}
public
equals
(
a
:
InternalEditorMinimapOptions
,
b
:
InternalEditorMinimapOptions
):
boolean
{
return
(
a
.
enabled
===
b
.
enabled
&&
a
.
side
===
b
.
side
&&
a
.
showSlider
===
b
.
showSlider
&&
a
.
renderCharacters
===
b
.
renderCharacters
&&
a
.
maxColumn
===
b
.
maxColumn
);
}
}
//#endregion
...
...
@@ -1367,13 +1343,6 @@ class EditorHover<K1 extends EditorOption, K2 extends PossibleKeyName<IEditorHov
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
InternalEditorHoverOptions
):
InternalEditorHoverOptions
{
return
value
;
}
public
equals
(
a
:
InternalEditorHoverOptions
,
b
:
InternalEditorHoverOptions
):
boolean
{
return
(
a
.
enabled
===
b
.
enabled
&&
a
.
delay
===
b
.
delay
&&
a
.
sticky
===
b
.
sticky
);
}
}
//#endregion
...
...
@@ -1403,22 +1372,6 @@ class EditorQuickSuggestions<K1 extends EditorOption, K2 extends PossibleKeyName
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
ValidQuickSuggestionsOptions
):
ValidQuickSuggestionsOptions
{
return
value
;
}
public
equals
(
a
:
ValidQuickSuggestionsOptions
,
b
:
ValidQuickSuggestionsOptions
):
boolean
{
if
(
typeof
a
===
'
boolean
'
)
{
if
(
typeof
b
!==
'
boolean
'
)
{
return
false
;
}
return
a
===
b
;
}
if
(
typeof
b
===
'
boolean
'
)
{
return
false
;
}
return
(
a
.
comments
===
b
.
comments
&&
a
.
other
===
b
.
other
&&
a
.
strings
===
b
.
strings
);
}
}
//#endregion
...
...
@@ -1460,9 +1413,6 @@ class EditorRulers<K1 extends EditorOption, K2 extends PossibleKeyName<number[]>
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
number
[]):
number
[]
{
return
value
;
}
public
equals
(
a
:
number
[],
b
:
number
[]):
boolean
{
return
arrays
.
equals
(
a
,
b
);
}
}
//#endregion
...
...
@@ -1593,9 +1543,6 @@ class EditorFontInfo<K1 extends EditorOption, K2 extends PossibleKeyName<undefin
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
undefined
):
FontInfo
{
return
env
.
fontInfo
;
}
public
equals
(
a
:
FontInfo
,
b
:
FontInfo
):
boolean
{
return
a
.
equals
(
b
);
}
}
//#endregion
...
...
@@ -1626,11 +1573,6 @@ class EditorLightbulb<K1 extends EditorOption, K2 extends PossibleKeyName<IEdito
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
ValidEditorLightbulbOptions
):
ValidEditorLightbulbOptions
{
return
value
;
}
public
equals
(
a
:
ValidEditorLightbulbOptions
,
b
:
ValidEditorLightbulbOptions
):
boolean
{
return
(
a
.
enabled
===
b
.
enabled
);
}
}
//#endregion
...
...
@@ -1675,21 +1617,6 @@ class EditorScrollbar<K1 extends EditorOption, K2 extends PossibleKeyName<IEdito
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
InternalEditorScrollbarOptions
):
InternalEditorScrollbarOptions
{
return
value
;
}
public
equals
(
a
:
InternalEditorScrollbarOptions
,
b
:
InternalEditorScrollbarOptions
):
boolean
{
return
(
a
.
arrowSize
===
b
.
arrowSize
&&
a
.
vertical
===
b
.
vertical
&&
a
.
horizontal
===
b
.
horizontal
&&
a
.
useShadows
===
b
.
useShadows
&&
a
.
verticalHasArrows
===
b
.
verticalHasArrows
&&
a
.
horizontalHasArrows
===
b
.
horizontalHasArrows
&&
a
.
handleMouseWheel
===
b
.
handleMouseWheel
&&
a
.
horizontalScrollbarSize
===
b
.
horizontalScrollbarSize
&&
a
.
horizontalSliderSize
===
b
.
horizontalSliderSize
&&
a
.
verticalScrollbarSize
===
b
.
verticalScrollbarSize
&&
a
.
verticalSliderSize
===
b
.
verticalSliderSize
);
}
}
//#endregion
...
...
@@ -1737,18 +1664,6 @@ class EditorSuggest<K1 extends EditorOption, K2 extends PossibleKeyName<ISuggest
filteredTypes
:
value
.
filteredTypes
,
};
}
public
equals
(
a
:
InternalSuggestOptions
,
b
:
InternalSuggestOptions
):
boolean
{
return
(
a
.
filterGraceful
===
b
.
filterGraceful
&&
a
.
snippets
===
b
.
snippets
&&
a
.
snippetsPreventQuickSuggestions
===
b
.
snippetsPreventQuickSuggestions
&&
a
.
localityBonus
===
b
.
localityBonus
&&
a
.
shareSuggestSelections
===
b
.
shareSuggestSelections
&&
a
.
showIcons
===
b
.
showIcons
&&
a
.
maxVisibleSuggestions
===
b
.
maxVisibleSuggestions
&&
objects
.
equals
(
a
.
filteredTypes
,
b
.
filteredTypes
)
);
}
}
//#endregion
...
...
@@ -1773,12 +1688,6 @@ class EditorParameterHints<K1 extends EditorOption, K2 extends PossibleKeyName<I
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
InternalParameterHintOptions
):
InternalParameterHintOptions
{
return
value
;
}
public
equals
(
a
:
InternalParameterHintOptions
,
b
:
InternalParameterHintOptions
):
boolean
{
return
(
a
.
enabled
===
b
.
enabled
&&
a
.
cycle
===
b
.
cycle
);
}
}
//#endregion
...
...
@@ -1810,14 +1719,6 @@ class EditorFind<K1 extends EditorOption, K2 extends PossibleKeyName<IEditorFind
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
InternalEditorFindOptions
):
InternalEditorFindOptions
{
return
value
;
}
public
equals
(
a
:
InternalEditorFindOptions
,
b
:
InternalEditorFindOptions
):
boolean
{
return
(
a
.
seedSearchStringFromSelection
===
b
.
seedSearchStringFromSelection
&&
a
.
autoFindInSelection
===
b
.
autoFindInSelection
&&
a
.
globalFindClipboard
===
b
.
globalFindClipboard
&&
a
.
addExtraSpaceOnTop
===
b
.
addExtraSpaceOnTop
);
}
}
//#endregion
...
...
@@ -1840,11 +1741,6 @@ class EditorGoToLocation<K1 extends EditorOption, K2 extends PossibleKeyName<IGo
public
compute
(
env
:
IEnvironmentalOptions
,
options
:
IComputedEditorOptions
,
value
:
InternalGoToLocationOptions
):
InternalGoToLocationOptions
{
return
value
;
}
public
equals
(
a
:
InternalGoToLocationOptions
,
b
:
InternalGoToLocationOptions
):
boolean
{
return
(
a
.
multiple
===
b
.
multiple
);
}
}
//#endregion
...
...
@@ -2022,40 +1918,6 @@ export class EditorLayoutInfoComputer<K1 extends EditorOption, K2 extends Possib
pixelRatio
:
env
.
pixelRatio
});
}
public
equals
(
a
:
EditorLayoutInfo
,
b
:
EditorLayoutInfo
):
boolean
{
return
(
a
.
width
===
b
.
width
&&
a
.
height
===
b
.
height
&&
a
.
glyphMarginLeft
===
b
.
glyphMarginLeft
&&
a
.
glyphMarginWidth
===
b
.
glyphMarginWidth
&&
a
.
glyphMarginHeight
===
b
.
glyphMarginHeight
&&
a
.
lineNumbersLeft
===
b
.
lineNumbersLeft
&&
a
.
lineNumbersWidth
===
b
.
lineNumbersWidth
&&
a
.
lineNumbersHeight
===
b
.
lineNumbersHeight
&&
a
.
decorationsLeft
===
b
.
decorationsLeft
&&
a
.
decorationsWidth
===
b
.
decorationsWidth
&&
a
.
decorationsHeight
===
b
.
decorationsHeight
&&
a
.
contentLeft
===
b
.
contentLeft
&&
a
.
contentWidth
===
b
.
contentWidth
&&
a
.
contentHeight
===
b
.
contentHeight
&&
a
.
renderMinimap
===
b
.
renderMinimap
&&
a
.
minimapLeft
===
b
.
minimapLeft
&&
a
.
minimapWidth
===
b
.
minimapWidth
&&
a
.
viewportColumn
===
b
.
viewportColumn
&&
a
.
verticalScrollbarWidth
===
b
.
verticalScrollbarWidth
&&
a
.
horizontalScrollbarHeight
===
b
.
horizontalScrollbarHeight
&&
EditorLayoutInfoComputer
.
_equalsOverviewRuler
(
a
.
overviewRuler
,
b
.
overviewRuler
)
);
}
private
static
_equalsOverviewRuler
(
a
:
OverviewRulerPosition
,
b
:
OverviewRulerPosition
):
boolean
{
return
(
a
.
width
===
b
.
width
&&
a
.
height
===
b
.
height
&&
a
.
top
===
b
.
top
&&
a
.
right
===
b
.
right
);
}
public
static
compute
(
_opts
:
IEditorLayoutProviderOpts
):
EditorLayoutInfo
{
const
outerWidth
=
_opts
.
outerWidth
|
0
;
...
...
@@ -2265,14 +2127,6 @@ class EditorWrappingInfoComputer<K1 extends EditorOption, K2 extends PossibleKey
wrappingColumn
:
bareWrappingInfo
.
wrappingColumn
,
};
}
public
equals
(
a
:
EditorWrappingInfo
,
b
:
EditorWrappingInfo
):
boolean
{
return
(
a
.
isDominatedByLongLines
===
b
.
isDominatedByLongLines
&&
a
.
isWordWrapMinified
===
b
.
isWordWrapMinified
&&
a
.
isViewportWrapping
===
b
.
isViewportWrapping
&&
a
.
wrappingColumn
===
b
.
wrappingColumn
);
}
}
//#endregion
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录