Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
ad85d6bb
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,发现更多精彩内容 >>
提交
ad85d6bb
编写于
12月 14, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ExtHostDocumentsAndEditorsShape, #40169
上级
2e6578fc
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
18 addition
and
15 deletion
+18
-15
src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts
...nch/api/electron-browser/mainThreadDocumentsAndEditors.ts
+2
-2
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+3
-3
src/vs/workbench/api/node/extHostDocumentsAndEditors.ts
src/vs/workbench/api/node/extHostDocumentsAndEditors.ts
+8
-5
src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts
...ench/test/electron-browser/api/extHostApiCommands.test.ts
+1
-1
src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts
...ectron-browser/api/extHostDocumentSaveParticipant.test.ts
+1
-1
src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts
...t/electron-browser/api/extHostDocumentsAndEditors.test.ts
+1
-1
src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts
...test/electron-browser/api/extHostLanguageFeatures.test.ts
+1
-1
src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts
...ench/test/electron-browser/api/extHostTextEditors.test.ts
+1
-1
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts
浏览文件 @
ad85d6bb
...
...
@@ -398,7 +398,7 @@ export class MainThreadDocumentsAndEditors {
private
_toModelAddData
(
model
:
IModel
):
IModelAddedData
{
return
{
ur
l
:
model
.
uri
,
ur
i
:
model
.
uri
,
versionId
:
model
.
getVersionId
(),
lines
:
model
.
getLinesContent
(),
EOL
:
model
.
getEOL
(),
...
...
@@ -410,7 +410,7 @@ export class MainThreadDocumentsAndEditors {
private
_toTextEditorAddData
(
textEditor
:
MainThreadTextEditor
):
ITextEditorAddData
{
return
{
id
:
textEditor
.
getId
(),
document
:
textEditor
.
getModel
().
uri
,
document
Uri
:
textEditor
.
getModel
().
uri
,
options
:
textEditor
.
getConfiguration
(),
selections
:
textEditor
.
getSelections
(),
editorPosition
:
this
.
_findEditorPosition
(
textEditor
)
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
ad85d6bb
...
...
@@ -436,7 +436,7 @@ export interface ExtHostDocumentContentProvidersShape {
}
export
interface
IModelAddedData
{
ur
l
:
URI
;
ur
i
:
UriComponents
;
versionId
:
number
;
lines
:
string
[];
EOL
:
string
;
...
...
@@ -456,7 +456,7 @@ export interface ExtHostDocumentSaveParticipantShape {
export
interface
ITextEditorAddData
{
id
:
string
;
document
:
URI
;
document
Uri
:
UriComponents
;
options
:
IResolvedTextEditorConfiguration
;
selections
:
ISelection
[];
editorPosition
:
EditorPosition
;
...
...
@@ -699,7 +699,7 @@ export const ExtHostContext = {
ExtHostDiagnostics
:
createExtId
<
ExtHostDiagnosticsShape
>
(
'
ExtHostDiagnostics
'
),
ExtHostDebugService
:
createExtId
<
ExtHostDebugServiceShape
>
(
'
ExtHostDebugService
'
,
ProxyType
.
CustomMarshaller
),
ExtHostDecorations
:
createExtId
<
ExtHostDecorationsShape
>
(
'
ExtHostDecorations
'
),
ExtHostDocumentsAndEditors
:
createExtId
<
ExtHostDocumentsAndEditorsShape
>
(
'
ExtHostDocumentsAndEditors
'
,
ProxyType
.
CustomMarshaller
),
ExtHostDocumentsAndEditors
:
createExtId
<
ExtHostDocumentsAndEditorsShape
>
(
'
ExtHostDocumentsAndEditors
'
),
ExtHostDocuments
:
createExtId
<
ExtHostDocumentsShape
>
(
'
ExtHostDocuments
'
),
ExtHostDocumentContentProviders
:
createExtId
<
ExtHostDocumentContentProvidersShape
>
(
'
ExtHostDocumentContentProviders
'
),
ExtHostDocumentSaveParticipant
:
createExtId
<
ExtHostDocumentSaveParticipantShape
>
(
'
ExtHostDocumentSaveParticipant
'
),
...
...
src/vs/workbench/api/node/extHostDocumentsAndEditors.ts
浏览文件 @
ad85d6bb
...
...
@@ -11,6 +11,7 @@ import { ExtHostDocumentData } from './extHostDocumentData';
import
{
ExtHostTextEditor
}
from
'
./extHostTextEditor
'
;
import
*
as
assert
from
'
assert
'
;
import
*
as
typeConverters
from
'
./extHostTypeConverters
'
;
import
URI
from
'
vs/base/common/uri
'
;
export
class
ExtHostDocumentsAndEditors
implements
ExtHostDocumentsAndEditorsShape
{
...
...
@@ -49,18 +50,19 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha
if
(
delta
.
addedDocuments
)
{
for
(
const
data
of
delta
.
addedDocuments
)
{
assert
.
ok
(
!
this
.
_documents
.
has
(
data
.
url
.
toString
()),
`document '
${
data
.
url
}
already exists!'`
);
const
resource
=
URI
.
revive
(
data
.
uri
);
assert
.
ok
(
!
this
.
_documents
.
has
(
resource
.
toString
()),
`document '
${
resource
}
already exists!'`
);
const
documentData
=
new
ExtHostDocumentData
(
this
.
_mainContext
.
getProxy
(
MainContext
.
MainThreadDocuments
),
data
.
url
,
resource
,
data
.
lines
,
data
.
EOL
,
data
.
modeId
,
data
.
versionId
,
data
.
isDirty
);
this
.
_documents
.
set
(
data
.
url
.
toString
(),
documentData
);
this
.
_documents
.
set
(
resource
.
toString
(),
documentData
);
addedDocuments
.
push
(
documentData
);
}
}
...
...
@@ -75,10 +77,11 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha
if
(
delta
.
addedEditors
)
{
for
(
const
data
of
delta
.
addedEditors
)
{
assert
.
ok
(
this
.
_documents
.
has
(
data
.
document
.
toString
()),
`document '
${
data
.
document
}
' does not exist`
);
const
resource
=
URI
.
revive
(
data
.
documentUri
);
assert
.
ok
(
this
.
_documents
.
has
(
resource
.
toString
()),
`document '
${
resource
}
' does not exist`
);
assert
.
ok
(
!
this
.
_editors
.
has
(
data
.
id
),
`editor '
${
data
.
id
}
' already exists!`
);
const
documentData
=
this
.
_documents
.
get
(
data
.
document
.
toString
());
const
documentData
=
this
.
_documents
.
get
(
resource
.
toString
());
const
editor
=
new
ExtHostTextEditor
(
this
.
_mainContext
.
getProxy
(
MainContext
.
MainThreadEditors
),
data
.
id
,
...
...
src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts
浏览文件 @
ad85d6bb
...
...
@@ -104,7 +104,7 @@ suite('ExtHostLanguageFeatureCommands', function () {
isDirty
:
false
,
versionId
:
model
.
getVersionId
(),
modeId
:
model
.
getLanguageIdentifier
().
language
,
ur
l
:
model
.
uri
,
ur
i
:
model
.
uri
,
lines
:
model
.
getValue
().
split
(
model
.
getEOL
()),
EOL
:
model
.
getEOL
(),
}]
...
...
src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts
浏览文件 @
ad85d6bb
...
...
@@ -42,7 +42,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
addedDocuments
:
[{
isDirty
:
false
,
modeId
:
'
foo
'
,
ur
l
:
resource
,
ur
i
:
resource
,
versionId
:
1
,
lines
:
[
'
foo
'
],
EOL
:
'
\n
'
,
...
...
src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts
浏览文件 @
ad85d6bb
...
...
@@ -28,7 +28,7 @@ suite('ExtHostDocumentsAndEditors', () => {
EOL
:
'
\n
'
,
isDirty
:
true
,
modeId
:
'
fooLang
'
,
ur
l
:
URI
.
parse
(
'
foo:bar
'
),
ur
i
:
URI
.
parse
(
'
foo:bar
'
),
versionId
:
1
,
lines
:
[
'
first
'
,
...
...
src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts
浏览文件 @
ad85d6bb
...
...
@@ -93,7 +93,7 @@ suite('ExtHostLanguageFeatures', function () {
isDirty
:
false
,
versionId
:
model
.
getVersionId
(),
modeId
:
model
.
getLanguageIdentifier
().
language
,
ur
l
:
model
.
uri
,
ur
i
:
model
.
uri
,
lines
:
model
.
getValue
().
split
(
model
.
getEOL
()),
EOL
:
model
.
getEOL
(),
}]
...
...
src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts
浏览文件 @
ad85d6bb
...
...
@@ -35,7 +35,7 @@ suite('ExtHostTextEditors.applyWorkspaceEdit', () => {
addedDocuments
:
[{
isDirty
:
false
,
modeId
:
'
foo
'
,
ur
l
:
resource
,
ur
i
:
resource
,
versionId
:
1337
,
lines
:
[
'
foo
'
],
EOL
:
'
\n
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录