Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4f433ed0
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,发现更多精彩内容 >>
提交
4f433ed0
编写于
12月 13, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more native json, #40169
上级
5bccdeab
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
14 deletion
+20
-14
src/vs/base/common/uri.ts
src/vs/base/common/uri.ts
+10
-4
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+4
-4
src/vs/workbench/api/node/extHostDecorations.ts
src/vs/workbench/api/node/extHostDecorations.ts
+3
-3
src/vs/workbench/api/node/extHostDocumentContentProviders.ts
src/vs/workbench/api/node/extHostDocumentContentProviders.ts
+3
-3
未找到文件。
src/vs/base/common/uri.ts
浏览文件 @
4f433ed0
...
...
@@ -315,10 +315,16 @@ export default class URI implements UriComponents {
}
static
revive
(
data
:
UriComponents
|
any
):
URI
{
let
result
=
new
_URI
(
data
);
result
.
_fsPath
=
(
<
UriState
>
data
).
fsPath
;
result
.
_formatted
=
(
<
UriState
>
data
).
external
;
return
result
;
if
(
!
data
)
{
return
data
;
}
else
if
(
data
instanceof
URI
)
{
return
data
;
}
else
{
let
result
=
new
_URI
(
data
);
result
.
_fsPath
=
(
<
UriState
>
data
).
fsPath
;
result
.
_formatted
=
(
<
UriState
>
data
).
external
;
return
result
;
}
}
}
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
4f433ed0
...
...
@@ -433,7 +433,7 @@ export interface ExtHostDiagnosticsShape {
}
export
interface
ExtHostDocumentContentProvidersShape
{
$provideTextDocumentContent
(
handle
:
number
,
uri
:
U
RI
):
TPromise
<
string
>
;
$provideTextDocumentContent
(
handle
:
number
,
uri
:
U
riComponents
):
TPromise
<
string
>
;
}
export
interface
IModelAddedData
{
...
...
@@ -655,7 +655,7 @@ export interface ExtHostDebugServiceShape {
export
type
DecorationData
=
[
number
,
boolean
,
string
,
string
,
ThemeColor
,
string
];
export
interface
ExtHostDecorationsShape
{
$providerDecorations
(
handle
:
number
,
uri
:
U
RI
):
TPromise
<
DecorationData
>
;
$providerDecorations
(
handle
:
number
,
uri
:
U
riComponents
):
TPromise
<
DecorationData
>
;
}
export
interface
ExtHostWindowShape
{
...
...
@@ -699,10 +699,10 @@ export const ExtHostContext = {
ExtHostConfiguration
:
createExtId
<
ExtHostConfigurationShape
>
(
'
ExtHostConfiguration
'
,
ProxyType
.
CustomMarshaller
),
ExtHostDiagnostics
:
createExtId
<
ExtHostDiagnosticsShape
>
(
'
ExtHostDiagnostics
'
),
ExtHostDebugService
:
createExtId
<
ExtHostDebugServiceShape
>
(
'
ExtHostDebugService
'
,
ProxyType
.
CustomMarshaller
),
ExtHostDecorations
:
createExtId
<
ExtHostDecorationsShape
>
(
'
ExtHostDecorations
'
,
ProxyType
.
CustomMarshaller
),
ExtHostDecorations
:
createExtId
<
ExtHostDecorationsShape
>
(
'
ExtHostDecorations
'
),
ExtHostDocumentsAndEditors
:
createExtId
<
ExtHostDocumentsAndEditorsShape
>
(
'
ExtHostDocumentsAndEditors
'
,
ProxyType
.
CustomMarshaller
),
ExtHostDocuments
:
createExtId
<
ExtHostDocumentsShape
>
(
'
ExtHostDocuments
'
),
ExtHostDocumentContentProviders
:
createExtId
<
ExtHostDocumentContentProvidersShape
>
(
'
ExtHostDocumentContentProviders
'
,
ProxyType
.
CustomMarshaller
),
ExtHostDocumentContentProviders
:
createExtId
<
ExtHostDocumentContentProvidersShape
>
(
'
ExtHostDocumentContentProviders
'
),
ExtHostDocumentSaveParticipant
:
createExtId
<
ExtHostDocumentSaveParticipantShape
>
(
'
ExtHostDocumentSaveParticipant
'
,
ProxyType
.
CustomMarshaller
),
ExtHostEditors
:
createExtId
<
ExtHostEditorsShape
>
(
'
ExtHostEditors
'
,
ProxyType
.
CustomMarshaller
),
ExtHostTreeViews
:
createExtId
<
ExtHostTreeViewsShape
>
(
'
ExtHostTreeViews
'
),
...
...
src/vs/workbench/api/node/extHostDecorations.ts
浏览文件 @
4f433ed0
...
...
@@ -5,7 +5,7 @@
'
use strict
'
;
import
*
as
vscode
from
'
vscode
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
,
{
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
MainContext
,
IMainContext
,
ExtHostDecorationsShape
,
MainThreadDecorationsShape
,
DecorationData
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Disposable
}
from
'
vs/workbench/api/node/extHostTypes
'
;
...
...
@@ -38,9 +38,9 @@ export class ExtHostDecorations implements ExtHostDecorationsShape {
});
}
$providerDecorations
(
handle
:
number
,
uri
:
URI
):
TPromise
<
DecorationData
>
{
$providerDecorations
(
handle
:
number
,
data
:
UriComponents
):
TPromise
<
DecorationData
>
{
const
provider
=
this
.
_provider
.
get
(
handle
);
return
asWinJsPromise
(
token
=>
provider
.
provideDecoration
(
uri
,
token
)).
then
(
data
=>
{
return
asWinJsPromise
(
token
=>
provider
.
provideDecoration
(
URI
.
revive
(
data
)
,
token
)).
then
(
data
=>
{
return
data
&&
<
DecorationData
>
[
data
.
priority
,
data
.
bubble
,
data
.
title
,
data
.
abbreviation
,
data
.
color
,
data
.
source
];
});
}
...
...
src/vs/workbench/api/node/extHostDocumentContentProviders.ts
浏览文件 @
4f433ed0
...
...
@@ -6,7 +6,7 @@
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
,
{
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposable
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
...
...
@@ -78,11 +78,11 @@ export class ExtHostDocumentContentProvider implements ExtHostDocumentContentPro
});
}
$provideTextDocumentContent
(
handle
:
number
,
uri
:
U
RI
):
TPromise
<
string
>
{
$provideTextDocumentContent
(
handle
:
number
,
uri
:
U
riComponents
):
TPromise
<
string
>
{
const
provider
=
this
.
_documentContentProviders
.
get
(
handle
);
if
(
!
provider
)
{
return
TPromise
.
wrapError
<
string
>
(
new
Error
(
`unsupported uri-scheme:
${
uri
.
scheme
}
`
));
}
return
asWinJsPromise
(
token
=>
provider
.
provideTextDocumentContent
(
uri
,
token
));
return
asWinJsPromise
(
token
=>
provider
.
provideTextDocumentContent
(
URI
.
revive
(
uri
)
,
token
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录