Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c7bf5103
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,发现更多精彩内容 >>
提交
c7bf5103
编写于
2月 27, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Take uri as argument instead of string version of uri
上级
09905893
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
16 deletion
+12
-16
src/vs/workbench/api/node/extHostDocumentContentProviders.ts
src/vs/workbench/api/node/extHostDocumentContentProviders.ts
+2
-2
src/vs/workbench/api/node/extHostDocuments.ts
src/vs/workbench/api/node/extHostDocuments.ts
+7
-11
src/vs/workbench/api/node/extHostDocumentsAndEditors.ts
src/vs/workbench/api/node/extHostDocumentsAndEditors.ts
+2
-2
src/vs/workbench/api/node/extHostTypeConverters.ts
src/vs/workbench/api/node/extHostTypeConverters.ts
+1
-1
未找到文件。
src/vs/workbench/api/node/extHostDocumentContentProviders.ts
浏览文件 @
c7bf5103
...
...
@@ -52,13 +52,13 @@ export class ExtHostDocumentContentProvider implements ExtHostDocumentContentPro
this
.
_logService
.
warn
(
`Provider for scheme '
${
scheme
}
' is firing event for schema '
${
uri
.
scheme
}
' which will be IGNORED`
);
return
;
}
if
(
this
.
_documentsAndEditors
.
getDocument
(
uri
.
toString
()
))
{
if
(
this
.
_documentsAndEditors
.
getDocument
(
uri
))
{
this
.
$provideTextDocumentContent
(
handle
,
uri
).
then
(
value
=>
{
if
(
!
value
)
{
return
;
}
const
document
=
this
.
_documentsAndEditors
.
getDocument
(
uri
.
toString
()
);
const
document
=
this
.
_documentsAndEditors
.
getDocument
(
uri
);
if
(
!
document
)
{
// disposed in the meantime
return
;
...
...
src/vs/workbench/api/node/extHostDocuments.ts
浏览文件 @
c7bf5103
...
...
@@ -60,7 +60,7 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
if
(
!
resource
)
{
return
undefined
;
}
const
data
=
this
.
_documentsAndEditors
.
getDocument
(
resource
.
toString
()
);
const
data
=
this
.
_documentsAndEditors
.
getDocument
(
resource
);
if
(
data
)
{
return
data
;
}
...
...
@@ -77,7 +77,7 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
public
ensureDocumentData
(
uri
:
URI
):
Promise
<
ExtHostDocumentData
>
{
let
cached
=
this
.
_documentsAndEditors
.
getDocument
(
uri
.
toString
()
);
let
cached
=
this
.
_documentsAndEditors
.
getDocument
(
uri
);
if
(
cached
)
{
return
Promise
.
resolve
(
cached
);
}
...
...
@@ -86,7 +86,7 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
if
(
!
promise
)
{
promise
=
this
.
_proxy
.
$tryOpenDocument
(
uri
).
then
(()
=>
{
this
.
_documentLoader
.
delete
(
uri
.
toString
());
return
this
.
_documentsAndEditors
.
getDocument
(
uri
.
toString
()
);
return
this
.
_documentsAndEditors
.
getDocument
(
uri
);
},
err
=>
{
this
.
_documentLoader
.
delete
(
uri
.
toString
());
return
Promise
.
reject
(
err
);
...
...
@@ -103,8 +103,7 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
public
$acceptModelModeChanged
(
uriComponents
:
UriComponents
,
oldModeId
:
string
,
newModeId
:
string
):
void
{
const
uri
=
URI
.
revive
(
uriComponents
);
const
strURL
=
uri
.
toString
();
let
data
=
this
.
_documentsAndEditors
.
getDocument
(
strURL
);
let
data
=
this
.
_documentsAndEditors
.
getDocument
(
uri
);
// Treat a mode change as a remove + add
...
...
@@ -115,16 +114,14 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
public
$acceptModelSaved
(
uriComponents
:
UriComponents
):
void
{
const
uri
=
URI
.
revive
(
uriComponents
);
const
strURL
=
uri
.
toString
();
let
data
=
this
.
_documentsAndEditors
.
getDocument
(
strURL
);
let
data
=
this
.
_documentsAndEditors
.
getDocument
(
uri
);
this
.
$acceptDirtyStateChanged
(
uriComponents
,
false
);
this
.
_onDidSaveDocument
.
fire
(
data
.
document
);
}
public
$acceptDirtyStateChanged
(
uriComponents
:
UriComponents
,
isDirty
:
boolean
):
void
{
const
uri
=
URI
.
revive
(
uriComponents
);
const
strURL
=
uri
.
toString
();
let
data
=
this
.
_documentsAndEditors
.
getDocument
(
strURL
);
let
data
=
this
.
_documentsAndEditors
.
getDocument
(
uri
);
data
.
_acceptIsDirty
(
isDirty
);
this
.
_onDidChangeDocument
.
fire
({
document
:
data
.
document
,
...
...
@@ -134,8 +131,7 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
public
$acceptModelChanged
(
uriComponents
:
UriComponents
,
events
:
IModelChangedEvent
,
isDirty
:
boolean
):
void
{
const
uri
=
URI
.
revive
(
uriComponents
);
const
strURL
=
uri
.
toString
();
let
data
=
this
.
_documentsAndEditors
.
getDocument
(
strURL
);
let
data
=
this
.
_documentsAndEditors
.
getDocument
(
uri
);
data
.
_acceptIsDirty
(
isDirty
);
data
.
onEvents
(
events
);
this
.
_onDidChangeDocument
.
fire
({
...
...
src/vs/workbench/api/node/extHostDocumentsAndEditors.ts
浏览文件 @
c7bf5103
...
...
@@ -131,8 +131,8 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha
}
}
getDocument
(
strUrl
:
string
):
ExtHostDocumentData
{
return
this
.
_documents
.
get
(
strUrl
);
getDocument
(
uri
:
URI
):
ExtHostDocumentData
{
return
this
.
_documents
.
get
(
uri
.
toString
()
);
}
allDocuments
():
ExtHostDocumentData
[]
{
...
...
src/vs/workbench/api/node/extHostTypeConverters.ts
浏览文件 @
c7bf5103
...
...
@@ -457,7 +457,7 @@ export namespace WorkspaceEdit {
const
[
uri
,
uriOrEdits
]
=
entry
;
if
(
Array
.
isArray
(
uriOrEdits
))
{
// text edits
const
doc
=
documents
&&
uri
?
documents
.
getDocument
(
uri
.
toString
()
)
:
undefined
;
const
doc
=
documents
&&
uri
?
documents
.
getDocument
(
uri
)
:
undefined
;
result
.
edits
.
push
(
<
ResourceTextEditDto
>
{
resource
:
uri
,
modelVersionId
:
doc
&&
doc
.
version
,
edits
:
uriOrEdits
.
map
(
TextEdit
.
from
)
});
}
else
{
// resource edits
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录