Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e50d2903
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,发现更多精彩内容 >>
提交
e50d2903
编写于
4月 05, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #10047: include `rangeOffset` in `TextDocumentContentChangeEvent`
上级
f26b9ef4
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
26 addition
and
5 deletion
+26
-5
src/vs/editor/common/model.ts
src/vs/editor/common/model.ts
+0
-1
src/vs/editor/common/model/textModel.ts
src/vs/editor/common/model/textModel.ts
+5
-4
src/vs/editor/common/model/textModelEvents.ts
src/vs/editor/common/model/textModelEvents.ts
+4
-0
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+4
-0
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+4
-0
src/vs/workbench/api/node/extHostDocuments.ts
src/vs/workbench/api/node/extHostDocuments.ts
+1
-0
src/vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts
...nch/test/electron-browser/api/extHostDocumentData.test.ts
+6
-0
src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts
...ectron-browser/api/extHostDocumentSaveParticipant.test.ts
+2
-0
未找到文件。
src/vs/editor/common/model.ts
浏览文件 @
e50d2903
...
@@ -1152,6 +1152,5 @@ export class ApplyEditsResult {
...
@@ -1152,6 +1152,5 @@ export class ApplyEditsResult {
*/
*/
export
interface
IInternalModelContentChange
extends
IModelContentChange
{
export
interface
IInternalModelContentChange
extends
IModelContentChange
{
range
:
Range
;
range
:
Range
;
rangeOffset
:
number
;
forceMoveMarkers
:
boolean
;
forceMoveMarkers
:
boolean
;
}
}
src/vs/editor/common/model/textModel.ts
浏览文件 @
e50d2903
...
@@ -386,10 +386,11 @@ export class TextModel extends Disposable implements model.ITextModel {
...
@@ -386,10 +386,11 @@ export class TextModel extends Disposable implements model.ITextModel {
this
.
setValueFromTextBuffer
(
textBuffer
);
this
.
setValueFromTextBuffer
(
textBuffer
);
}
}
private
_createContentChanged2
(
startLineNumber
:
number
,
startColumn
:
number
,
endLineNumber
:
number
,
endColumn
:
number
,
rangeLength
:
number
,
text
:
string
,
isUndoing
:
boolean
,
isRedoing
:
boolean
,
isFlush
:
boolean
):
IModelContentChangedEvent
{
private
_createContentChanged2
(
range
:
Range
,
rangeOffset
:
number
,
rangeLength
:
number
,
text
:
string
,
isUndoing
:
boolean
,
isRedoing
:
boolean
,
isFlush
:
boolean
):
IModelContentChangedEvent
{
return
{
return
{
changes
:
[{
changes
:
[{
range
:
new
Range
(
startLineNumber
,
startColumn
,
endLineNumber
,
endColumn
),
range
:
range
,
rangeOffset
:
rangeOffset
,
rangeLength
:
rangeLength
,
rangeLength
:
rangeLength
,
text
:
text
,
text
:
text
,
}],
}],
...
@@ -435,7 +436,7 @@ export class TextModel extends Disposable implements model.ITextModel {
...
@@ -435,7 +436,7 @@ export class TextModel extends Disposable implements model.ITextModel {
false
,
false
,
false
false
),
),
this
.
_createContentChanged2
(
1
,
1
,
endLineNumber
,
endColumn
,
oldModelValueLength
,
this
.
getValue
(),
false
,
false
,
true
)
this
.
_createContentChanged2
(
new
Range
(
1
,
1
,
endLineNumber
,
endColumn
),
0
,
oldModelValueLength
,
this
.
getValue
(),
false
,
false
,
true
)
);
);
}
}
...
@@ -466,7 +467,7 @@ export class TextModel extends Disposable implements model.ITextModel {
...
@@ -466,7 +467,7 @@ export class TextModel extends Disposable implements model.ITextModel {
false
,
false
,
false
false
),
),
this
.
_createContentChanged2
(
1
,
1
,
endLineNumber
,
endColumn
,
oldModelValueLength
,
this
.
getValue
(),
false
,
false
,
false
)
this
.
_createContentChanged2
(
new
Range
(
1
,
1
,
endLineNumber
,
endColumn
),
0
,
oldModelValueLength
,
this
.
getValue
(),
false
,
false
,
false
)
);
);
}
}
...
...
src/vs/editor/common/model/textModelEvents.ts
浏览文件 @
e50d2903
...
@@ -32,6 +32,10 @@ export interface IModelContentChange {
...
@@ -32,6 +32,10 @@ export interface IModelContentChange {
* The range that got replaced.
* The range that got replaced.
*/
*/
readonly
range
:
IRange
;
readonly
range
:
IRange
;
/**
* The offset of the range that got replaced.
*/
readonly
rangeOffset
:
number
;
/**
/**
* The length of the range that got replaced.
* The length of the range that got replaced.
*/
*/
...
...
src/vs/monaco.d.ts
浏览文件 @
e50d2903
...
@@ -2196,6 +2196,10 @@ declare namespace monaco.editor {
...
@@ -2196,6 +2196,10 @@ declare namespace monaco.editor {
* The range that got replaced.
* The range that got replaced.
*/
*/
readonly
range
:
IRange
;
readonly
range
:
IRange
;
/**
* The offset of the range that got replaced.
*/
readonly
rangeOffset
:
number
;
/**
/**
* The length of the range that got replaced.
* The length of the range that got replaced.
*/
*/
...
...
src/vs/vscode.d.ts
浏览文件 @
e50d2903
...
@@ -5511,6 +5511,10 @@ declare module 'vscode' {
...
@@ -5511,6 +5511,10 @@ declare module 'vscode' {
* The range that got replaced.
* The range that got replaced.
*/
*/
range
:
Range
;
range
:
Range
;
/**
* The offset of the range that got replaced.
*/
rangeOffset
:
number
;
/**
/**
* The length of the range that got replaced.
* The length of the range that got replaced.
*/
*/
...
...
src/vs/workbench/api/node/extHostDocuments.ts
浏览文件 @
e50d2903
...
@@ -137,6 +137,7 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
...
@@ -137,6 +137,7 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
contentChanges
:
events
.
changes
.
map
((
change
)
=>
{
contentChanges
:
events
.
changes
.
map
((
change
)
=>
{
return
{
return
{
range
:
TypeConverters
.
toRange
(
change
.
range
),
range
:
TypeConverters
.
toRange
(
change
.
range
),
rangeOffset
:
change
.
rangeOffset
,
rangeLength
:
change
.
rangeLength
,
rangeLength
:
change
.
rangeLength
,
text
:
change
.
text
text
:
change
.
text
};
};
...
...
src/vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts
浏览文件 @
e50d2903
...
@@ -101,6 +101,7 @@ suite('ExtHostDocumentData', () => {
...
@@ -101,6 +101,7 @@ suite('ExtHostDocumentData', () => {
data
.
onEvents
({
data
.
onEvents
({
changes
:
[{
changes
:
[{
range
:
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
1
},
range
:
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
1
},
rangeOffset
:
undefined
,
rangeLength
:
undefined
,
rangeLength
:
undefined
,
text
:
'
\t
'
text
:
'
\t
'
}],
}],
...
@@ -157,6 +158,7 @@ suite('ExtHostDocumentData', () => {
...
@@ -157,6 +158,7 @@ suite('ExtHostDocumentData', () => {
data
.
onEvents
({
data
.
onEvents
({
changes
:
[{
changes
:
[{
range
:
{
startLineNumber
:
1
,
startColumn
:
3
,
endLineNumber
:
1
,
endColumn
:
6
},
range
:
{
startLineNumber
:
1
,
startColumn
:
3
,
endLineNumber
:
1
,
endColumn
:
6
},
rangeOffset
:
undefined
,
rangeLength
:
undefined
,
rangeLength
:
undefined
,
text
:
''
text
:
''
}],
}],
...
@@ -174,6 +176,7 @@ suite('ExtHostDocumentData', () => {
...
@@ -174,6 +176,7 @@ suite('ExtHostDocumentData', () => {
data
.
onEvents
({
data
.
onEvents
({
changes
:
[{
changes
:
[{
range
:
{
startLineNumber
:
1
,
startColumn
:
3
,
endLineNumber
:
1
,
endColumn
:
6
},
range
:
{
startLineNumber
:
1
,
startColumn
:
3
,
endLineNumber
:
1
,
endColumn
:
6
},
rangeOffset
:
undefined
,
rangeLength
:
undefined
,
rangeLength
:
undefined
,
text
:
'
is could be
'
text
:
'
is could be
'
}],
}],
...
@@ -191,6 +194,7 @@ suite('ExtHostDocumentData', () => {
...
@@ -191,6 +194,7 @@ suite('ExtHostDocumentData', () => {
data
.
onEvents
({
data
.
onEvents
({
changes
:
[{
changes
:
[{
range
:
{
startLineNumber
:
1
,
startColumn
:
3
,
endLineNumber
:
1
,
endColumn
:
6
},
range
:
{
startLineNumber
:
1
,
startColumn
:
3
,
endLineNumber
:
1
,
endColumn
:
6
},
rangeOffset
:
undefined
,
rangeLength
:
undefined
,
rangeLength
:
undefined
,
text
:
'
is could be
\n
a line with number
'
text
:
'
is could be
\n
a line with number
'
}],
}],
...
@@ -211,6 +215,7 @@ suite('ExtHostDocumentData', () => {
...
@@ -211,6 +215,7 @@ suite('ExtHostDocumentData', () => {
data
.
onEvents
({
data
.
onEvents
({
changes
:
[{
changes
:
[{
range
:
{
startLineNumber
:
1
,
startColumn
:
3
,
endLineNumber
:
2
,
endColumn
:
6
},
range
:
{
startLineNumber
:
1
,
startColumn
:
3
,
endLineNumber
:
2
,
endColumn
:
6
},
rangeOffset
:
undefined
,
rangeLength
:
undefined
,
rangeLength
:
undefined
,
text
:
''
text
:
''
}],
}],
...
@@ -344,6 +349,7 @@ suite('ExtHostDocumentData updates line mapping', () => {
...
@@ -344,6 +349,7 @@ suite('ExtHostDocumentData updates line mapping', () => {
return
{
return
{
changes
:
[{
changes
:
[{
range
:
range
,
range
:
range
,
rangeOffset
:
undefined
,
rangeLength
:
undefined
,
rangeLength
:
undefined
,
text
:
text
text
:
text
}],
}],
...
...
src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts
浏览文件 @
e50d2903
...
@@ -302,6 +302,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
...
@@ -302,6 +302,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
documents
.
$acceptModelChanged
(
resource
,
{
documents
.
$acceptModelChanged
(
resource
,
{
changes
:
[{
changes
:
[{
range
:
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
1
},
range
:
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
1
},
rangeOffset
:
undefined
,
rangeLength
:
undefined
,
rangeLength
:
undefined
,
text
:
'
bar
'
text
:
'
bar
'
}],
}],
...
@@ -337,6 +338,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
...
@@ -337,6 +338,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
changes
:
[{
changes
:
[{
range
,
range
,
text
,
text
,
rangeOffset
:
undefined
,
rangeLength
:
undefined
,
rangeLength
:
undefined
,
}],
}],
eol
:
undefined
,
eol
:
undefined
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录