Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0ac0c45b
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,发现更多精彩内容 >>
提交
0ac0c45b
编写于
11月 16, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
strict null work in extHostTypes, #61543
上级
917a2c58
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
13 addition
and
17 deletion
+13
-17
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+1
-1
src/vs/editor/common/services/editorSimpleWorker.ts
src/vs/editor/common/services/editorSimpleWorker.ts
+3
-3
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+0
-4
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+7
-7
src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts
.../workbench/test/electron-browser/api/extHostTypes.test.ts
+2
-2
未找到文件。
src/vs/editor/common/modes.ts
浏览文件 @
0ac0c45b
...
...
@@ -876,7 +876,7 @@ export interface DocumentSymbolProvider {
provideDocumentSymbols
(
model
:
model
.
ITextModel
,
token
:
CancellationToken
):
ProviderResult
<
DocumentSymbol
[]
>
;
}
export
type
TextEdit
=
{
range
:
IRange
;
text
:
string
;
eol
?:
model
.
EndOfLineSequence
;
}
|
{
range
:
undefined
;
text
:
undefined
;
eol
:
model
.
EndOfLineSequence
;
}
;
export
type
TextEdit
=
{
range
:
IRange
;
text
:
string
;
eol
?:
model
.
EndOfLineSequence
;
};
/**
* Interface used to format a model
...
...
src/vs/editor/common/services/editorSimpleWorker.ts
浏览文件 @
0ac0c45b
...
...
@@ -425,8 +425,8 @@ export abstract class BaseEditorSimpleWorker {
lastEol
=
eol
;
}
if
(
!
range
)
{
// e
ol-change only
if
(
Range
.
isEmpty
(
range
)
&&
!
text
)
{
// e
mpty change
continue
;
}
...
...
@@ -463,7 +463,7 @@ export abstract class BaseEditorSimpleWorker {
}
if
(
typeof
lastEol
===
'
number
'
)
{
result
.
push
({
eol
:
lastEol
,
text
:
undefined
,
range
:
undefined
});
result
.
push
({
eol
:
lastEol
,
text
:
''
,
range
:
{
startLineNumber
:
0
,
startColumn
:
0
,
endLineNumber
:
0
,
endColumn
:
0
}
});
}
return
Promise
.
resolve
(
result
);
...
...
src/vs/monaco.d.ts
浏览文件 @
0ac0c45b
...
...
@@ -5148,10 +5148,6 @@ declare namespace monaco.languages {
range
:
IRange
;
text
:
string
;
eol
?:
editor
.
EndOfLineSequence
;
}
|
{
range
:
undefined
;
text
:
undefined
;
eol
:
editor
.
EndOfLineSequence
;
};
/**
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
0ac0c45b
...
...
@@ -447,7 +447,7 @@ export class TextEdit {
}
static
setEndOfLine
(
eol
:
EndOfLine
):
TextEdit
{
let
ret
=
new
TextEdit
(
undefined
,
undefined
);
let
ret
=
new
TextEdit
(
new
Range
(
new
Position
(
0
,
0
),
new
Position
(
0
,
0
)),
''
);
ret
.
newEol
=
eol
;
return
ret
;
}
...
...
@@ -513,8 +513,8 @@ export interface IFileOperationOptions {
export
interface
IFileOperation
{
_type
:
1
;
from
:
URI
;
to
:
URI
;
from
?
:
URI
;
to
?
:
URI
;
options
?:
IFileOperationOptions
;
}
...
...
@@ -567,7 +567,7 @@ export class WorkspaceEdit implements vscode.WorkspaceEdit {
for
(
let
i
=
0
;
i
<
this
.
_edits
.
length
;
i
++
)
{
const
element
=
this
.
_edits
[
i
];
if
(
element
.
_type
===
2
&&
element
.
uri
.
toString
()
===
uri
.
toString
())
{
this
.
_edits
[
i
]
=
undefined
;
this
.
_edits
[
i
]
=
undefined
!
;
// will be coalesced down below
}
}
this
.
_edits
=
coalesce
(
this
.
_edits
);
...
...
@@ -606,8 +606,8 @@ export class WorkspaceEdit implements vscode.WorkspaceEdit {
return
values
(
textEdits
);
}
_allEntries
():
([
URI
,
TextEdit
[]]
|
[
URI
,
URI
,
IFileOperationOptions
])[]
{
let
res
:
([
URI
,
TextEdit
[]]
|
[
URI
,
URI
,
IFileOperationOptions
])[]
=
[];
_allEntries
():
([
URI
,
TextEdit
[]]
|
[
URI
?,
URI
?,
IFileOperationOptions
?
])[]
{
let
res
:
([
URI
,
TextEdit
[]]
|
[
URI
?,
URI
?,
IFileOperationOptions
?
])[]
=
[];
for
(
let
edit
of
this
.
_edits
)
{
if
(
edit
.
_type
===
1
)
{
res
.
push
([
edit
.
from
,
edit
.
to
,
edit
.
options
]);
...
...
@@ -938,7 +938,7 @@ export class SymbolInformation {
if
(
locationOrUri
instanceof
Location
)
{
this
.
location
=
locationOrUri
;
}
else
if
(
rangeOrContainer
instanceof
Range
)
{
this
.
location
=
new
Location
(
locationOrUri
,
rangeOrContainer
);
this
.
location
=
new
Location
(
locationOrUri
!
,
rangeOrContainer
);
}
SymbolInformation
.
validate
(
this
);
...
...
src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts
浏览文件 @
0ac0c45b
...
...
@@ -384,12 +384,12 @@ suite('ExtHostTypes', function () {
const
all
=
edit
.
_allEntries
();
assert
.
equal
(
all
.
length
,
4
);
function
isFileChange
(
thing
:
[
URI
,
types
.
TextEdit
[]]
|
[
URI
,
URI
,
{
overwrite
?:
boolean
}]):
thing
is
[
URI
,
URI
,
{
overwrite
?:
boolean
}
]
{
function
isFileChange
(
thing
:
[
URI
,
types
.
TextEdit
[]]
|
[
URI
?,
URI
?,
{
overwrite
?:
boolean
}?]):
thing
is
[
URI
?,
URI
?,
{
overwrite
?:
boolean
}?
]
{
const
[
f
,
s
]
=
thing
;
return
URI
.
isUri
(
f
)
&&
URI
.
isUri
(
s
);
}
function
isTextChange
(
thing
:
[
URI
,
types
.
TextEdit
[]]
|
[
URI
,
URI
,
{
overwrite
?:
boolean
}
]):
thing
is
[
URI
,
types
.
TextEdit
[]]
{
function
isTextChange
(
thing
:
[
URI
,
types
.
TextEdit
[]]
|
[
URI
?,
URI
?,
{
overwrite
?:
boolean
}?
]):
thing
is
[
URI
,
types
.
TextEdit
[]]
{
const
[
f
,
s
]
=
thing
;
return
URI
.
isUri
(
f
)
&&
Array
.
isArray
(
s
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录