Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2a2f8179
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,发现更多精彩内容 >>
提交
2a2f8179
编写于
3月 06, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use the updateOpen TS api to sync multiple changes in a single file
Fixes #69492
上级
01350195
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
31 addition
and
10 deletion
+31
-10
extensions/package.json
extensions/package.json
+1
-1
extensions/typescript-language-features/src/features/bufferSyncSupport.ts
...cript-language-features/src/features/bufferSyncSupport.ts
+19
-5
extensions/typescript-language-features/src/typescriptService.ts
...ons/typescript-language-features/src/typescriptService.ts
+1
-0
extensions/typescript-language-features/src/utils/api.ts
extensions/typescript-language-features/src/utils/api.ts
+1
-0
extensions/typescript-language-features/src/utils/typeConverters.ts
.../typescript-language-features/src/utils/typeConverters.ts
+5
-0
extensions/yarn.lock
extensions/yarn.lock
+4
-4
未找到文件。
extensions/package.json
浏览文件 @
2a2f8179
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
"version"
:
"0.0.1"
,
"version"
:
"0.0.1"
,
"description"
:
"Dependencies shared by all extensions"
,
"description"
:
"Dependencies shared by all extensions"
,
"dependencies"
:
{
"dependencies"
:
{
"typescript"
:
"3.
3.3
"
"typescript"
:
"3.
4.0-dev.20190306
"
},
},
"scripts"
:
{
"scripts"
:
{
"postinstall"
:
"node ./postinstall"
"postinstall"
:
"node ./postinstall"
...
...
extensions/typescript-language-features/src/features/bufferSyncSupport.ts
浏览文件 @
2a2f8179
...
@@ -108,6 +108,19 @@ class SyncedBuffer {
...
@@ -108,6 +108,19 @@ class SyncedBuffer {
console
.
error
(
`Unexpected buffer state:
${
this
.
state
}
`
);
console
.
error
(
`Unexpected buffer state:
${
this
.
state
}
`
);
}
}
if
(
this
.
client
.
apiVersion
.
gte
(
API
.
v340
))
{
const
args
:
Proto
.
UpdateOpenRequestArgs
=
{
changedFiles
:
[{
fileName
:
this
.
filepath
,
textChanges
:
events
.
map
((
change
):
Proto
.
CodeEdit
=>
({
newText
:
change
.
text
,
start
:
typeConverters
.
Position
.
toLocation
(
change
.
range
.
start
),
end
:
typeConverters
.
Position
.
toLocation
(
change
.
range
.
end
),
})).
reverse
(),
// Send the edits end of document to start of document order
}],
};
this
.
client
.
executeWithoutWaitingForResponse
(
'
updateOpen
'
,
args
);
}
else
{
for
(
const
{
range
,
text
}
of
events
)
{
for
(
const
{
range
,
text
}
of
events
)
{
const
args
:
Proto
.
ChangeRequestArgs
=
{
const
args
:
Proto
.
ChangeRequestArgs
=
{
insertString
:
text
,
insertString
:
text
,
...
@@ -116,6 +129,7 @@ class SyncedBuffer {
...
@@ -116,6 +129,7 @@ class SyncedBuffer {
this
.
client
.
executeWithoutWaitingForResponse
(
'
change
'
,
args
);
this
.
client
.
executeWithoutWaitingForResponse
(
'
change
'
,
args
);
}
}
}
}
}
}
}
class
SyncedBufferMap
extends
ResourceMap
<
SyncedBuffer
>
{
class
SyncedBufferMap
extends
ResourceMap
<
SyncedBuffer
>
{
...
...
extensions/typescript-language-features/src/typescriptService.ts
浏览文件 @
2a2f8179
...
@@ -110,6 +110,7 @@ export interface ITypeScriptServiceClient {
...
@@ -110,6 +110,7 @@ export interface ITypeScriptServiceClient {
executeWithoutWaitingForResponse
(
command
:
'
open
'
,
args
:
Proto
.
OpenRequestArgs
):
void
;
executeWithoutWaitingForResponse
(
command
:
'
open
'
,
args
:
Proto
.
OpenRequestArgs
):
void
;
executeWithoutWaitingForResponse
(
command
:
'
close
'
,
args
:
Proto
.
FileRequestArgs
):
void
;
executeWithoutWaitingForResponse
(
command
:
'
close
'
,
args
:
Proto
.
FileRequestArgs
):
void
;
executeWithoutWaitingForResponse
(
command
:
'
change
'
,
args
:
Proto
.
ChangeRequestArgs
):
void
;
executeWithoutWaitingForResponse
(
command
:
'
change
'
,
args
:
Proto
.
ChangeRequestArgs
):
void
;
executeWithoutWaitingForResponse
(
command
:
'
updateOpen
'
,
args
:
Proto
.
UpdateOpenRequestArgs
):
void
;
executeWithoutWaitingForResponse
(
command
:
'
compilerOptionsForInferredProjects
'
,
args
:
Proto
.
SetCompilerOptionsForInferredProjectsArgs
):
void
;
executeWithoutWaitingForResponse
(
command
:
'
compilerOptionsForInferredProjects
'
,
args
:
Proto
.
SetCompilerOptionsForInferredProjectsArgs
):
void
;
executeWithoutWaitingForResponse
(
command
:
'
reloadProjects
'
,
args
:
null
):
void
;
executeWithoutWaitingForResponse
(
command
:
'
reloadProjects
'
,
args
:
null
):
void
;
...
...
extensions/typescript-language-features/src/utils/api.ts
浏览文件 @
2a2f8179
...
@@ -35,6 +35,7 @@ export default class API {
...
@@ -35,6 +35,7 @@ export default class API {
public
static
readonly
v320
=
API
.
fromSimpleString
(
'
3.2.0
'
);
public
static
readonly
v320
=
API
.
fromSimpleString
(
'
3.2.0
'
);
public
static
readonly
v330
=
API
.
fromSimpleString
(
'
3.3.0
'
);
public
static
readonly
v330
=
API
.
fromSimpleString
(
'
3.3.0
'
);
public
static
readonly
v333
=
API
.
fromSimpleString
(
'
3.3.3
'
);
public
static
readonly
v333
=
API
.
fromSimpleString
(
'
3.3.3
'
);
public
static
readonly
v340
=
API
.
fromSimpleString
(
'
3.4.0
'
);
public
static
fromVersionString
(
versionString
:
string
):
API
{
public
static
fromVersionString
(
versionString
:
string
):
API
{
...
...
extensions/typescript-language-features/src/utils/typeConverters.ts
浏览文件 @
2a2f8179
...
@@ -38,6 +38,11 @@ export namespace Position {
...
@@ -38,6 +38,11 @@ export namespace Position {
export
const
fromLocation
=
(
tslocation
:
Proto
.
Location
):
vscode
.
Position
=>
export
const
fromLocation
=
(
tslocation
:
Proto
.
Location
):
vscode
.
Position
=>
new
vscode
.
Position
(
tslocation
.
line
-
1
,
tslocation
.
offset
-
1
);
new
vscode
.
Position
(
tslocation
.
line
-
1
,
tslocation
.
offset
-
1
);
export
const
toLocation
=
(
vsPosition
:
vscode
.
Position
):
Proto
.
Location
=>
({
line
:
vsPosition
.
line
+
1
,
offset
:
vsPosition
.
character
+
1
,
});
export
const
toFileLocationRequestArgs
=
(
file
:
string
,
position
:
vscode
.
Position
):
Proto
.
FileLocationRequestArgs
=>
({
export
const
toFileLocationRequestArgs
=
(
file
:
string
,
position
:
vscode
.
Position
):
Proto
.
FileLocationRequestArgs
=>
({
file
,
file
,
line
:
position
.
line
+
1
,
line
:
position
.
line
+
1
,
...
...
extensions/yarn.lock
浏览文件 @
2a2f8179
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# yarn lockfile v1
# yarn lockfile v1
typescript@3.
3.3
:
typescript@3.
4.0-dev.20190306
:
version "3.
3.3
"
version "3.
4.0-dev.20190306
"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.
3.3.tgz#f1657fc7daa27e1a8930758ace9ae8da31403221
"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.
4.0-dev.20190306.tgz#6431063ef07e642aac44504a7ea1b59c38f7d935
"
integrity sha512-
Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A
==
integrity sha512-
fnIi34ml8qtAqrT27zWPV5eBX9eAMVLqHCl/MZ4qHzLNWj98vp70Dde8ObNlOmuGIjumGQDHFgk7fowXJaq9gw
==
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录