Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
843facb1
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,发现更多精彩内容 >>
提交
843facb1
编写于
4月 05, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Introduce and adopt IModelDecorationOptions.zIndex (#46995)
上级
b07b786e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
35 addition
and
18 deletion
+35
-18
src/vs/editor/browser/viewParts/decorations/decorations.ts
src/vs/editor/browser/viewParts/decorations/decorations.ts
+8
-2
src/vs/editor/common/model.ts
src/vs/editor/common/model.ts
+6
-1
src/vs/editor/common/model/intervalTree.ts
src/vs/editor/common/model/intervalTree.ts
+4
-7
src/vs/editor/common/model/textModel.ts
src/vs/editor/common/model/textModel.ts
+5
-7
src/vs/editor/common/services/modelServiceImpl.ts
src/vs/editor/common/services/modelServiceImpl.ts
+7
-1
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+5
-0
未找到文件。
src/vs/editor/browser/viewParts/decorations/decorations.ts
浏览文件 @
843facb1
...
...
@@ -85,8 +85,14 @@ export class DecorationsOverlay extends DynamicViewOverlay {
// Sort decorations for consistent render output
decorations
=
decorations
.
sort
((
a
,
b
)
=>
{
let
aClassName
=
a
.
options
.
className
;
let
bClassName
=
b
.
options
.
className
;
if
(
a
.
options
.
zIndex
<
b
.
options
.
zIndex
)
{
return
-
1
;
}
if
(
a
.
options
.
zIndex
>
b
.
options
.
zIndex
)
{
return
1
;
}
const
aClassName
=
a
.
options
.
className
;
const
bClassName
=
b
.
options
.
className
;
if
(
aClassName
<
bClassName
)
{
return
-
1
;
...
...
src/vs/editor/common/model.ts
浏览文件 @
843facb1
...
...
@@ -81,7 +81,12 @@ export interface IModelDecorationOptions {
* Always render the decoration (even when the range it encompasses is collapsed).
* @internal
*/
readonly
showIfCollapsed
?:
boolean
;
showIfCollapsed
?:
boolean
;
/**
* Specifies the stack order of a decoration.
* A decoration with greater stack order is always in front of a decoration with a lower stack order.
*/
zIndex
?:
number
;
/**
* If set, render this decoration in the overview ruler.
*/
...
...
src/vs/editor/common/model/intervalTree.ts
浏览文件 @
843facb1
...
...
@@ -12,14 +12,11 @@ import { IModelDecoration } from 'vs/editor/common/model';
// The red-black tree is based on the "Introduction to Algorithms" by Cormen, Leiserson and Rivest.
//
/**
* The class name sort order must match the severity order. Highest severity last.
*/
export
const
ClassName
=
{
EditorHintDecoration
:
'
squiggly-
a-
hint
'
,
EditorInfoDecoration
:
'
squiggly-
b-
info
'
,
EditorWarningDecoration
:
'
squiggly-
c-
warning
'
,
EditorErrorDecoration
:
'
squiggly-
d-
error
'
EditorHintDecoration
:
'
squiggly-hint
'
,
EditorInfoDecoration
:
'
squiggly-info
'
,
EditorWarningDecoration
:
'
squiggly-warning
'
,
EditorErrorDecoration
:
'
squiggly-error
'
};
/**
...
...
src/vs/editor/common/model/textModel.ts
浏览文件 @
843facb1
...
...
@@ -2585,22 +2585,20 @@ export class ModelDecorationOverviewRulerOptions implements model.IModelDecorati
}
}
let
lastStaticId
=
0
;
export
class
ModelDecorationOptions
implements
model
.
IModelDecorationOptions
{
public
static
EMPTY
:
ModelDecorationOptions
;
public
static
register
(
options
:
model
.
IModelDecorationOptions
):
ModelDecorationOptions
{
return
new
ModelDecorationOptions
(
++
lastStaticId
,
options
);
return
new
ModelDecorationOptions
(
options
);
}
public
static
createDynamic
(
options
:
model
.
IModelDecorationOptions
):
ModelDecorationOptions
{
return
new
ModelDecorationOptions
(
0
,
options
);
return
new
ModelDecorationOptions
(
options
);
}
readonly
staticId
:
number
;
readonly
stickiness
:
model
.
TrackedRangeStickiness
;
readonly
zIndex
:
number
;
readonly
className
:
string
;
readonly
hoverMessage
:
IMarkdownString
|
IMarkdownString
[];
readonly
glyphMarginHoverMessage
:
IMarkdownString
|
IMarkdownString
[];
...
...
@@ -2614,9 +2612,9 @@ export class ModelDecorationOptions implements model.IModelDecorationOptions {
readonly
beforeContentClassName
:
string
;
readonly
afterContentClassName
:
string
;
private
constructor
(
staticId
:
number
,
options
:
model
.
IModelDecorationOptions
)
{
this
.
staticId
=
staticId
;
private
constructor
(
options
:
model
.
IModelDecorationOptions
)
{
this
.
stickiness
=
options
.
stickiness
||
model
.
TrackedRangeStickiness
.
AlwaysGrowsWhenTypingAtEdges
;
this
.
zIndex
=
options
.
zIndex
||
0
;
this
.
className
=
options
.
className
?
cleanClassName
(
options
.
className
)
:
strings
.
empty
;
this
.
hoverMessage
=
options
.
hoverMessage
||
[];
this
.
glyphMarginHoverMessage
=
options
.
glyphMarginHoverMessage
||
[];
...
...
src/vs/editor/common/services/modelServiceImpl.ts
浏览文件 @
843facb1
...
...
@@ -118,26 +118,31 @@ class ModelMarkerHandler {
let
className
:
string
;
let
color
:
ThemeColor
;
let
darkColor
:
ThemeColor
;
let
zIndex
:
number
;
switch
(
marker
.
severity
)
{
case
MarkerSeverity
.
Hint
:
className
=
ClassName
.
EditorHintDecoration
;
zIndex
=
0
;
break
;
case
MarkerSeverity
.
Warning
:
className
=
ClassName
.
EditorWarningDecoration
;
color
=
themeColorFromId
(
overviewRulerWarning
);
darkColor
=
themeColorFromId
(
overviewRulerWarning
);
zIndex
=
20
;
break
;
case
MarkerSeverity
.
Info
:
className
=
ClassName
.
EditorInfoDecoration
;
color
=
themeColorFromId
(
overviewRulerInfo
);
darkColor
=
themeColorFromId
(
overviewRulerInfo
);
zIndex
=
10
;
break
;
case
MarkerSeverity
.
Error
:
default
:
className
=
ClassName
.
EditorErrorDecoration
;
color
=
themeColorFromId
(
overviewRulerError
);
darkColor
=
themeColorFromId
(
overviewRulerError
);
zIndex
=
30
;
break
;
}
...
...
@@ -177,7 +182,8 @@ class ModelMarkerHandler {
color
,
darkColor
,
position
:
OverviewRulerLane
.
Right
}
},
zIndex
};
}
}
...
...
src/vs/monaco.d.ts
浏览文件 @
843facb1
...
...
@@ -1193,6 +1193,11 @@ declare namespace monaco.editor {
* Should the decoration expand to encompass a whole line.
*/
isWholeLine
?:
boolean
;
/**
* Specifies the stack order of a decoration.
* A decoration with greater stack order is always in front of a decoration with a lower stack order.
*/
zIndex
?:
number
;
/**
* If set, render this decoration in the overview ruler.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录