Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
df9d8e28
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,发现更多精彩内容 >>
提交
df9d8e28
编写于
2月 09, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove warnings you cannot prevent, #18797
上级
dd039c37
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
42 deletion
+30
-42
src/vs/workbench/api/node/mainThreadEditorsTracker.ts
src/vs/workbench/api/node/mainThreadEditorsTracker.ts
+30
-42
未找到文件。
src/vs/workbench/api/node/mainThreadEditorsTracker.ts
浏览文件 @
df9d8e28
...
...
@@ -199,7 +199,6 @@ export class MainThreadTextEditor {
return
;
}
this
.
_lastSelection
=
selections
.
map
(
Selection
.
liftSelection
);
console
.
warn
(
'
setSelections on invisble editor
'
);
}
public
getConfiguration
():
IResolvedTextEditorConfiguration
{
...
...
@@ -239,26 +238,18 @@ export class MainThreadTextEditor {
public
setConfiguration
(
newConfiguration
:
ITextEditorConfigurationUpdate
):
void
{
this
.
_setIndentConfiguration
(
newConfiguration
);
if
(
!
this
.
_codeEditor
)
{
return
;
}
if
(
newConfiguration
.
cursorStyle
)
{
let
newCursorStyle
=
EditorCommon
.
cursorStyleToString
(
newConfiguration
.
cursorStyle
);
if
(
!
this
.
_codeEditor
)
{
console
.
warn
(
'
setConfiguration on invisible editor
'
);
return
;
}
this
.
_codeEditor
.
updateOptions
({
cursorStyle
:
newCursorStyle
});
}
if
(
typeof
newConfiguration
.
lineNumbers
!==
'
undefined
'
)
{
if
(
!
this
.
_codeEditor
)
{
console
.
warn
(
'
setConfiguration on invisible editor
'
);
return
;
}
let
lineNumbers
:
'
on
'
|
'
off
'
|
'
relative
'
;
switch
(
newConfiguration
.
lineNumbers
)
{
case
TextEditorLineNumbersStyle
.
On
:
...
...
@@ -278,7 +269,6 @@ export class MainThreadTextEditor {
public
setDecorations
(
key
:
string
,
ranges
:
EditorCommon
.
IDecorationOptions
[]):
void
{
if
(
!
this
.
_codeEditor
)
{
console
.
warn
(
'
setDecorations on invisible editor
'
);
return
;
}
this
.
_codeEditor
.
setDecorations
(
key
,
ranges
);
...
...
@@ -286,7 +276,6 @@ export class MainThreadTextEditor {
public
revealRange
(
range
:
EditorCommon
.
IRange
,
revealType
:
TextEditorRevealType
):
void
{
if
(
!
this
.
_codeEditor
)
{
console
.
warn
(
'
revealRange on invisible editor
'
);
return
;
}
switch
(
revealType
)
{
...
...
@@ -303,7 +292,7 @@ export class MainThreadTextEditor {
this
.
_codeEditor
.
revealRangeAtTop
(
range
);
break
;
default
:
console
.
warn
(
'
Unknown revealType
'
);
console
.
warn
(
`Unknown revealType:
${
revealType
}
`
);
break
;
}
}
...
...
@@ -361,40 +350,39 @@ export class MainThreadTextEditor {
public
applyEdits
(
versionIdCheck
:
number
,
edits
:
EditorCommon
.
ISingleEditOperation
[],
opts
:
IApplyEditsOptions
):
boolean
{
if
(
this
.
_model
.
getVersionId
()
!==
versionIdCheck
)
{
console
.
warn
(
'
Model has changed in the meantime!
'
);
// throw new Error('Model has changed in the meantime!');
// model changed in the meantime
return
false
;
}
if
(
this
.
_codeEditor
)
{
if
(
opts
.
setEndOfLine
===
EndOfLine
.
CRLF
)
{
this
.
_model
.
setEOL
(
EditorCommon
.
EndOfLineSequence
.
CRLF
);
}
else
if
(
opts
.
setEndOfLine
===
EndOfLine
.
LF
)
{
this
.
_model
.
setEOL
(
EditorCommon
.
EndOfLineSequence
.
LF
);
}
let
transformedEdits
=
edits
.
map
((
edit
):
EditorCommon
.
IIdentifiedSingleEditOperation
=>
{
return
{
identifier
:
null
,
range
:
Range
.
lift
(
edit
.
range
),
text
:
edit
.
text
,
forceMoveMarkers
:
edit
.
forceMoveMarkers
};
});
if
(
!
this
.
_codeEditor
)
{
// console.warn('applyEdits on invisible editor');
return
false
;
}
if
(
opts
.
undoStopBefore
)
{
this
.
_codeEditor
.
pushUndoStop
();
}
this
.
_codeEditor
.
executeEdits
(
'
MainThreadTextEditor
'
,
transformedEdits
);
if
(
opts
.
undoStopAfter
)
{
this
.
_codeEditor
.
pushUndoStop
();
}
return
true
;
if
(
opts
.
setEndOfLine
===
EndOfLine
.
CRLF
)
{
this
.
_model
.
setEOL
(
EditorCommon
.
EndOfLineSequence
.
CRLF
);
}
else
if
(
opts
.
setEndOfLine
===
EndOfLine
.
LF
)
{
this
.
_model
.
setEOL
(
EditorCommon
.
EndOfLineSequence
.
LF
);
}
console
.
warn
(
'
applyEdits on invisible editor
'
);
return
false
;
let
transformedEdits
=
edits
.
map
((
edit
):
EditorCommon
.
IIdentifiedSingleEditOperation
=>
{
return
{
identifier
:
null
,
range
:
Range
.
lift
(
edit
.
range
),
text
:
edit
.
text
,
forceMoveMarkers
:
edit
.
forceMoveMarkers
};
});
if
(
opts
.
undoStopBefore
)
{
this
.
_codeEditor
.
pushUndoStop
();
}
this
.
_codeEditor
.
executeEdits
(
'
MainThreadTextEditor
'
,
transformedEdits
);
if
(
opts
.
undoStopAfter
)
{
this
.
_codeEditor
.
pushUndoStop
();
}
return
true
;
}
insertSnippet
(
template
:
string
,
ranges
:
EditorCommon
.
IRange
[],
opts
:
IUndoStopOptions
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录