Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5b8dc569
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,发现更多精彩内容 >>
提交
5b8dc569
编写于
3月 08, 2017
作者:
B
Benjamin Pasero
提交者:
GitHub
3月 08, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22178 from hoovercj/openWithContentLipstick
Follow up to PR #22021 to respond to feedback
上级
ee075329
ee4473f1
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
10 addition
and
10 deletion
+10
-10
extensions/vscode-api-tests/src/workspace.test.ts
extensions/vscode-api-tests/src/workspace.test.ts
+2
-2
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+2
-2
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+2
-2
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostDocuments.ts
src/vs/workbench/api/node/extHostDocuments.ts
+1
-1
src/vs/workbench/api/node/mainThreadDocuments.ts
src/vs/workbench/api/node/mainThreadDocuments.ts
+2
-2
未找到文件。
extensions/vscode-api-tests/src/workspace.test.ts
浏览文件 @
5b8dc569
...
...
@@ -100,8 +100,8 @@ suite('workspace-namespace', () => {
});
});
test
(
'
openTextDocument, untitled without path but language ID and content
s
'
,
function
()
{
return
workspace
.
openTextDocument
({
language
:
'
html
'
,
content
s
:
'
<h1>Hello world!</h1>
'
}).
then
(
doc
=>
{
test
(
'
openTextDocument, untitled without path but language ID and content
'
,
function
()
{
return
workspace
.
openTextDocument
({
language
:
'
html
'
,
content
:
'
<h1>Hello world!</h1>
'
}).
then
(
doc
=>
{
assert
.
equal
(
doc
.
uri
.
scheme
,
'
untitled
'
);
assert
.
equal
(
doc
.
languageId
,
'
html
'
);
assert
.
ok
(
doc
.
isDirty
);
...
...
src/vs/vscode.d.ts
浏览文件 @
5b8dc569
...
...
@@ -4080,12 +4080,12 @@ declare module 'vscode' {
/**
* Opens an untitled text document. The editor will prompt the user for a file
* path when the document is to be saved. The `options` parameter allows to
* specify the *language* of the document.
* specify the *language*
and/or the *content*
of the document.
*
* @param options Options to control how the document will be created.
* @return A promise that resolves to a [document](#TextDocument).
*/
export
function
openTextDocument
(
options
?:
{
language
?:
string
;
content
s
?:
string
;
}):
Thenable
<
TextDocument
>
;
export
function
openTextDocument
(
options
?:
{
language
?:
string
;
content
?:
string
;
}):
Thenable
<
TextDocument
>
;
/**
* Register a text document content provider.
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
5b8dc569
...
...
@@ -368,10 +368,10 @@ export function createApiFactory(initData: IInitData, threadService: IThreadServ
set
textDocuments
(
value
)
{
throw
errors
.
readonly
();
},
openTextDocument
(
uriOrFileNameOrOptions
?:
vscode
.
Uri
|
string
|
{
language
?:
string
;
content
s
?:
string
;
})
{
openTextDocument
(
uriOrFileNameOrOptions
?:
vscode
.
Uri
|
string
|
{
language
?:
string
;
content
?:
string
;
})
{
let
uriPromise
:
TPromise
<
URI
>
;
let
options
=
uriOrFileNameOrOptions
as
{
language
?:
string
;
content
s
?:
string
;
};
let
options
=
uriOrFileNameOrOptions
as
{
language
?:
string
;
content
?:
string
;
};
if
(
!
options
||
typeof
options
.
language
===
'
string
'
)
{
uriPromise
=
extHostDocuments
.
createDocumentData
(
options
);
}
else
if
(
typeof
uriOrFileNameOrOptions
===
'
string
'
)
{
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
5b8dc569
...
...
@@ -120,7 +120,7 @@ export abstract class MainThreadDiagnosticsShape {
}
export
abstract
class
MainThreadDocumentsShape
{
$tryCreateDocument
(
options
?:
{
language
?:
string
;
content
s
?:
string
;
}):
TPromise
<
any
>
{
throw
ni
();
}
$tryCreateDocument
(
options
?:
{
language
?:
string
;
content
?:
string
;
}):
TPromise
<
any
>
{
throw
ni
();
}
$tryOpenDocument
(
uri
:
URI
):
TPromise
<
any
>
{
throw
ni
();
}
$registerTextContentProvider
(
handle
:
number
,
scheme
:
string
):
void
{
throw
ni
();
}
$onVirtualDocumentChange
(
uri
:
URI
,
value
:
ITextSource
):
void
{
throw
ni
();
}
...
...
src/vs/workbench/api/node/extHostDocuments.ts
浏览文件 @
5b8dc569
...
...
@@ -101,7 +101,7 @@ export class ExtHostDocuments extends ExtHostDocumentsShape {
return
promise
;
}
public
createDocumentData
(
options
?:
{
language
?:
string
;
content
s
?:
string
}):
TPromise
<
URI
>
{
public
createDocumentData
(
options
?:
{
language
?:
string
;
content
?:
string
}):
TPromise
<
URI
>
{
return
this
.
_proxy
.
$tryCreateDocument
(
options
);
}
...
...
src/vs/workbench/api/node/mainThreadDocuments.ts
浏览文件 @
5b8dc569
...
...
@@ -228,8 +228,8 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
});
}
$tryCreateDocument
(
options
?:
{
language
?:
string
,
content
s
?:
string
}):
TPromise
<
URI
>
{
return
this
.
_doCreateUntitled
(
void
0
,
options
?
options
.
language
:
void
0
,
options
?
options
.
content
s
:
void
0
);
$tryCreateDocument
(
options
?:
{
language
?:
string
,
content
?:
string
}):
TPromise
<
URI
>
{
return
this
.
_doCreateUntitled
(
void
0
,
options
?
options
.
language
:
void
0
,
options
?
options
.
content
:
void
0
);
}
private
_handleAsResourceInput
(
uri
:
URI
):
TPromise
<
boolean
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录