Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9d40b240
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,发现更多精彩内容 >>
提交
9d40b240
编写于
1月 17, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
untitled - clarify associated resource capabilities
上级
d63738e1
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
31 addition
and
20 deletion
+31
-20
src/vs/base/common/network.ts
src/vs/base/common/network.ts
+15
-15
src/vs/workbench/services/untitled/common/untitledTextEditorService.ts
...nch/services/untitled/common/untitledTextEditorService.ts
+16
-5
未找到文件。
src/vs/base/common/network.ts
浏览文件 @
9d40b240
...
...
@@ -12,47 +12,47 @@ export namespace Schemas {
* A schema that is used for models that exist in memory
* only and that have no correspondence on a server or such.
*/
export
const
inMemory
:
string
=
'
inmemory
'
;
export
const
inMemory
=
'
inmemory
'
;
/**
* A schema that is used for setting files
*/
export
const
vscode
:
string
=
'
vscode
'
;
export
const
vscode
=
'
vscode
'
;
/**
* A schema that is used for internal private files
*/
export
const
internal
:
string
=
'
private
'
;
export
const
internal
=
'
private
'
;
/**
* A walk-through document.
*/
export
const
walkThrough
:
string
=
'
walkThrough
'
;
export
const
walkThrough
=
'
walkThrough
'
;
/**
* An embedded code snippet.
*/
export
const
walkThroughSnippet
:
string
=
'
walkThroughSnippet
'
;
export
const
walkThroughSnippet
=
'
walkThroughSnippet
'
;
export
const
http
:
string
=
'
http
'
;
export
const
http
=
'
http
'
;
export
const
https
:
string
=
'
https
'
;
export
const
https
=
'
https
'
;
export
const
file
:
string
=
'
file
'
;
export
const
file
=
'
file
'
;
export
const
mailto
:
string
=
'
mailto
'
;
export
const
mailto
=
'
mailto
'
;
export
const
untitled
:
string
=
'
untitled
'
;
export
const
untitled
=
'
untitled
'
;
export
const
data
:
string
=
'
data
'
;
export
const
data
=
'
data
'
;
export
const
command
:
string
=
'
command
'
;
export
const
command
=
'
command
'
;
export
const
vscodeRemote
:
string
=
'
vscode-remote
'
;
export
const
vscodeRemote
=
'
vscode-remote
'
;
export
const
vscodeRemoteResource
:
string
=
'
vscode-remote-resource
'
;
export
const
vscodeRemoteResource
=
'
vscode-remote-resource
'
;
export
const
userData
:
string
=
'
vscode-userdata
'
;
export
const
userData
=
'
vscode-userdata
'
;
}
class
RemoteAuthoritiesImpl
{
...
...
src/vs/workbench/services/untitled/common/untitledTextEditorService.ts
浏览文件 @
9d40b240
...
...
@@ -23,15 +23,20 @@ export interface IUntitledTextEditorOptions {
/**
* An optional resource to identify the untitled resource to create or return
* if already existing.
*
* Note: the resource will not be used unless the scheme is `untitled`.
*/
untitledResource
?:
URI
;
/**
*
An optional resource
to associate with the untitled file. When saving
* the untitled file, the associated
resource
will be used and the user
*
Optional resource components
to associate with the untitled file. When saving
* the untitled file, the associated
components
will be used and the user
* is not being asked to provide a file path.
*
* Note: currently it is not possible to specify the `scheme` to use. The
* untitled file will saved to the default local or remote resource.
*/
associatedResource
?:
URI
;
associatedResource
?:
{
authority
:
string
;
path
:
string
;
query
:
string
;
fragment
:
string
;
}
/**
* Initial value of the untitled file. An untitled file with initial
...
...
@@ -158,7 +163,13 @@ export class UntitledTextEditorService extends Disposable implements IUntitledTe
// Figure out associated and untitled resource
if
(
options
.
associatedResource
)
{
massagedOptions
.
untitledResource
=
options
.
associatedResource
.
with
({
scheme
:
Schemas
.
untitled
});
massagedOptions
.
untitledResource
=
URI
.
from
({
scheme
:
Schemas
.
untitled
,
authority
:
options
.
associatedResource
.
authority
,
fragment
:
options
.
associatedResource
.
fragment
,
path
:
options
.
associatedResource
.
path
,
query
:
options
.
associatedResource
.
query
});
massagedOptions
.
associatedResource
=
options
.
associatedResource
;
}
else
{
if
(
options
.
untitledResource
?.
scheme
===
Schemas
.
untitled
)
{
...
...
@@ -188,7 +199,7 @@ export class UntitledTextEditorService extends Disposable implements IUntitledTe
// Create a new untitled resource if none is provided
let
untitledResource
=
options
.
untitledResource
;
if
(
!
untitledResource
)
{
let
counter
=
this
.
mapResourceToInput
.
size
+
1
;
let
counter
=
1
;
do
{
untitledResource
=
URI
.
from
({
scheme
:
Schemas
.
untitled
,
path
:
`Untitled-
${
counter
}
`
});
counter
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录