Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b26d4316
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,发现更多精彩内容 >>
提交
b26d4316
编写于
9月 30, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
editors - add a bit more clarifying docs
上级
0c50e1db
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
8 deletion
+18
-8
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+18
-8
未找到文件。
src/vs/workbench/common/editor.ts
浏览文件 @
b26d4316
...
...
@@ -394,15 +394,15 @@ export interface IEditorInput extends IDisposable {
readonly
onDidChangeLabel
:
Event
<
void
>
;
/**
* Returns the optional associated
canonical
resource of this input.
* Returns the optional associated resource of this input.
*
* This resource should be unique for all editors of the same
* kind and is often used to identify the editor input among
* kind and i
nput and i
s often used to identify the editor input among
* others.
*
*
Note: use `EditorResourceAccessor` to access the resource
*
of editors with support for side-by-side editors and
*
canonical vs original resources
.
*
**Note:** DO NOT use this property for anything but identity
*
checks. DO NOT use this property to present as label to the user.
*
Please refer to `EditorResourceAccessor` documentation in that case
.
*/
readonly
resource
:
URI
|
undefined
;
...
...
@@ -677,6 +677,10 @@ export interface IEditorInputWithPreferredResource {
* "normalize" the URIs so that only one editor opens for different
* URIs. But when displaying the editor label to the user, the
* preferred URI should be used.
*
* Not all editors have a `preferredResouce`. The `EditorResourceAccessor`
* utility can be used to always get the right resource without having
* to do instanceof checks.
*/
readonly
preferredResource
:
URI
;
}
...
...
@@ -767,6 +771,10 @@ export class SideBySideEditorInput extends EditorInput {
this
.
_register
(
this
.
primary
.
onDidChangeLabel
(()
=>
this
.
_onDidChangeLabel
.
fire
()));
}
/**
* Use `EditorResourceAccessor` utility method to access the resources
* of both sides of the diff editor.
*/
get
resource
():
URI
|
undefined
{
return
undefined
;
}
...
...
@@ -1313,9 +1321,10 @@ class EditorResourceAccessorImpl {
* be used whenever the URI is used to e.g. compare with other editors or when
* caching certain data based on the URI.
*
*
For example: on Windows and macOS, the same file URI with different casing may
* For example: on Windows and macOS, the same file URI with different casing may
* point to the same file. The editor may chose to "normalize" the URI into a canonical
* form so that only one editor opens for same file URIs with different casing.
* form so that only one editor opens for same file URIs with different casing. As
* such, the original URI and the canonical URI can be different.
*/
getOriginalUri
(
editor
:
IEditorInput
|
undefined
|
null
):
URI
|
undefined
;
getOriginalUri
(
editor
:
IEditorInput
|
undefined
|
null
,
options
:
IEditorResourceAccessorOptions
&
{
supportSideBySide
?:
SideBySideEditor
.
PRIMARY
|
SideBySideEditor
.
SECONDARY
}):
URI
|
undefined
;
...
...
@@ -1356,7 +1365,8 @@ class EditorResourceAccessorImpl {
*
* For example: on Windows and macOS, the same file URI with different casing may
* point to the same file. The editor may chose to "normalize" the URI into a canonical
* form so that only one editor opens for same file URIs with different casing.
* form so that only one editor opens for same file URIs with different casing. As
* such, the original URI and the canonical URI can be different.
*/
getCanonicalUri
(
editor
:
IEditorInput
|
undefined
|
null
):
URI
|
undefined
;
getCanonicalUri
(
editor
:
IEditorInput
|
undefined
|
null
,
options
:
IEditorResourceAccessorOptions
&
{
supportSideBySide
?:
SideBySideEditor
.
PRIMARY
|
SideBySideEditor
.
SECONDARY
}):
URI
|
undefined
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录