Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8b451a25
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,发现更多精彩内容 >>
提交
8b451a25
编写于
7月 15, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
getDescription(), return undefined instead of null
上级
2b078568
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
23 addition
and
22 deletion
+23
-22
src/vs/workbench/browser/labels.ts
src/vs/workbench/browser/labels.ts
+1
-1
src/vs/workbench/browser/parts/editor/editor.contribution.ts
src/vs/workbench/browser/parts/editor/editor.contribution.ts
+2
-1
src/vs/workbench/browser/parts/editor/editorPicker.ts
src/vs/workbench/browser/parts/editor/editorPicker.ts
+1
-1
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+2
-2
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
.../workbench/browser/parts/quickopen/quickOpenController.ts
+1
-1
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+5
-5
src/vs/workbench/common/editor/dataUriEditorInput.ts
src/vs/workbench/common/editor/dataUriEditorInput.ts
+2
-2
src/vs/workbench/common/editor/diffEditorInput.ts
src/vs/workbench/common/editor/diffEditorInput.ts
+1
-1
src/vs/workbench/common/editor/resourceEditorInput.ts
src/vs/workbench/common/editor/resourceEditorInput.ts
+2
-2
src/vs/workbench/common/editor/untitledEditorInput.ts
src/vs/workbench/common/editor/untitledEditorInput.ts
+2
-2
src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts
...ch/contrib/performance/electron-browser/perfviewEditor.ts
+1
-1
src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts
...s/workbench/contrib/webview/browser/webviewEditorInput.ts
+1
-1
src/vs/workbench/services/editor/browser/editorService.ts
src/vs/workbench/services/editor/browser/editorService.ts
+2
-2
未找到文件。
src/vs/workbench/browser/labels.ts
浏览文件 @
8b451a25
...
...
@@ -366,7 +366,7 @@ class ResourceLabelWidget extends IconLabel {
this
.
setResource
({
resource
:
toResource
(
editor
,
{
supportSideBySide
:
SideBySideEditor
.
MASTER
}),
name
:
withNullAsUndefined
(
editor
.
getName
()),
description
:
withNullAsUndefined
(
editor
.
getDescription
(
options
?
options
.
descriptionVerbosity
:
undefined
)
)
description
:
editor
.
getDescription
(
options
?
options
.
descriptionVerbosity
:
undefined
)
},
options
);
}
...
...
src/vs/workbench/browser/parts/editor/editor.contribution.ts
浏览文件 @
8b451a25
...
...
@@ -51,6 +51,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
import
{
toLocalResource
}
from
'
vs/base/common/resources
'
;
import
{
Extensions
as
WorkbenchExtensions
,
IWorkbenchContributionsRegistry
}
from
'
vs/workbench/common/contributions
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
// Register String Editor
Registry
.
as
<
IEditorRegistry
>
(
EditorExtensions
.
Editors
).
registerEditor
(
...
...
@@ -205,7 +206,7 @@ class SideBySideEditorInputFactory implements IEditorInputFactory {
const
masterInput
=
masterInputFactory
.
deserialize
(
instantiationService
,
deserialized
.
masterSerialized
);
if
(
detailsInput
&&
masterInput
)
{
return
new
SideBySideEditorInput
(
deserialized
.
name
,
deserialized
.
description
,
detailsInput
,
masterInput
);
return
new
SideBySideEditorInput
(
deserialized
.
name
,
withNullAsUndefined
(
deserialized
.
description
)
,
detailsInput
,
masterInput
);
}
}
...
...
src/vs/workbench/browser/parts/editor/editorPicker.ts
浏览文件 @
8b451a25
...
...
@@ -59,7 +59,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup {
}
getDescription
()
{
return
withNullAsUndefined
(
this
.
editor
.
getDescription
()
);
return
this
.
editor
.
getDescription
(
);
}
run
(
mode
:
Mode
,
context
:
IEntryRunContext
):
boolean
{
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
8b451a25
...
...
@@ -725,7 +725,7 @@ export class TabsTitleControl extends TitleControl {
const
labels
=
this
.
group
.
editors
.
map
(
editor
=>
({
editor
,
name
:
editor
.
getName
()
!
,
description
:
withNullAsUndefined
(
editor
.
getDescription
(
verbosity
)
),
description
:
editor
.
getDescription
(
verbosity
),
title
:
withNullAsUndefined
(
editor
.
getTitle
(
Verbosity
.
LONG
))
}));
...
...
@@ -778,7 +778,7 @@ export class TabsTitleControl extends TitleControl {
if
(
useLongDescriptions
)
{
mapDescriptionToDuplicates
.
clear
();
duplicateTitles
.
forEach
(
label
=>
{
label
.
description
=
withNullAsUndefined
(
label
.
editor
.
getDescription
(
Verbosity
.
LONG
)
);
label
.
description
=
label
.
editor
.
getDescription
(
Verbosity
.
LONG
);
getOrSet
(
mapDescriptionToDuplicates
,
label
.
description
,
[]).
push
(
label
);
});
}
...
...
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
浏览文件 @
8b451a25
...
...
@@ -745,7 +745,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
if
(
input
instanceof
EditorInput
)
{
this
.
resource
=
resourceForEditorHistory
(
input
,
fileService
);
this
.
label
=
types
.
withNullAsUndefined
(
input
.
getName
());
this
.
description
=
types
.
withNullAsUndefined
(
input
.
getDescription
()
);
this
.
description
=
input
.
getDescription
(
);
this
.
dirty
=
input
.
isDirty
();
}
else
{
const
resourceInput
=
input
as
IResourceInput
;
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
8b451a25
...
...
@@ -295,7 +295,7 @@ export interface IEditorInput extends IDisposable {
/**
* Returns the display description of this input.
*/
getDescription
(
verbosity
?:
Verbosity
):
string
|
null
;
getDescription
(
verbosity
?:
Verbosity
):
string
|
undefined
;
/**
* Returns the display title of this input.
...
...
@@ -364,8 +364,8 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
* Returns the description of this input that can be shown to the user. Examples include showing the description of
* the input above the editor area to the side of the name of the input.
*/
getDescription
(
verbosity
?:
Verbosity
):
string
|
null
{
return
null
;
getDescription
(
verbosity
?:
Verbosity
):
string
|
undefined
{
return
undefined
;
}
/**
...
...
@@ -552,7 +552,7 @@ export class SideBySideEditorInput extends EditorInput {
constructor
(
private
readonly
name
:
string
,
private
readonly
description
:
string
|
null
,
private
readonly
description
:
string
|
undefined
,
private
readonly
_details
:
EditorInput
,
private
readonly
_master
:
EditorInput
)
{
...
...
@@ -625,7 +625,7 @@ export class SideBySideEditorInput extends EditorInput {
return
this
.
name
;
}
getDescription
():
string
|
null
{
getDescription
():
string
|
undefined
{
return
this
.
description
;
}
...
...
src/vs/workbench/common/editor/dataUriEditorInput.ts
浏览文件 @
8b451a25
...
...
@@ -55,8 +55,8 @@ export class DataUriEditorInput extends EditorInput {
return
withUndefinedAsNull
(
this
.
name
);
}
getDescription
():
string
|
null
{
return
withUndefinedAsNull
(
this
.
description
)
;
getDescription
():
string
|
undefined
{
return
this
.
description
;
}
resolve
():
Promise
<
BinaryEditorModel
>
{
...
...
src/vs/workbench/common/editor/diffEditorInput.ts
浏览文件 @
8b451a25
...
...
@@ -18,7 +18,7 @@ export class DiffEditorInput extends SideBySideEditorInput {
private
cachedModel
:
DiffEditorModel
|
null
;
constructor
(
name
:
string
,
description
:
string
|
null
,
original
:
EditorInput
,
modified
:
EditorInput
,
private
readonly
forceOpenAsBinary
?:
boolean
)
{
constructor
(
name
:
string
,
description
:
string
|
undefined
,
original
:
EditorInput
,
modified
:
EditorInput
,
private
readonly
forceOpenAsBinary
?:
boolean
)
{
super
(
name
,
description
,
original
,
modified
);
}
...
...
src/vs/workbench/common/editor/resourceEditorInput.ts
浏览文件 @
8b451a25
...
...
@@ -22,7 +22,7 @@ export class ResourceEditorInput extends EditorInput implements IModeSupport {
constructor
(
private
name
:
string
,
private
description
:
string
|
null
,
private
description
:
string
|
undefined
,
private
readonly
resource
:
URI
,
private
preferredMode
:
string
|
undefined
,
@
ITextModelService
private
readonly
textModelResolverService
:
ITextModelService
...
...
@@ -53,7 +53,7 @@ export class ResourceEditorInput extends EditorInput implements IModeSupport {
}
}
getDescription
():
string
|
null
{
getDescription
():
string
|
undefined
{
return
this
.
description
;
}
...
...
src/vs/workbench/common/editor/untitledEditorInput.ts
浏览文件 @
8b451a25
...
...
@@ -77,9 +77,9 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport
return
this
.
labelService
.
getUriLabel
(
dirname
(
this
.
resource
));
}
getDescription
(
verbosity
:
Verbosity
=
Verbosity
.
MEDIUM
):
string
|
null
{
getDescription
(
verbosity
:
Verbosity
=
Verbosity
.
MEDIUM
):
string
|
undefined
{
if
(
!
this
.
hasAssociatedFilePath
)
{
return
null
;
return
undefined
;
}
switch
(
verbosity
)
{
...
...
src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts
浏览文件 @
8b451a25
...
...
@@ -49,7 +49,7 @@ export class PerfviewInput extends ResourceEditorInput {
)
{
super
(
localize
(
'
name
'
,
"
Startup Performance
"
),
null
,
undefined
,
PerfviewInput
.
Uri
,
undefined
,
textModelResolverService
...
...
src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts
浏览文件 @
8b451a25
...
...
@@ -130,7 +130,7 @@ export class WebviewEditorInput<State = any> extends EditorInput {
}
public
getDescription
()
{
return
null
;
return
undefined
;
}
public
setName
(
value
:
string
):
void
{
...
...
src/vs/workbench/services/editor/browser/editorService.ts
浏览文件 @
8b451a25
...
...
@@ -27,7 +27,7 @@ import { isCodeEditor, isDiffEditor, ICodeEditor, IDiffEditor } from 'vs/editor/
import
{
IEditorGroupView
,
IEditorOpeningEvent
,
EditorServiceImpl
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
withNullAsUndefined
,
withUndefinedAsNull
}
from
'
vs/base/common/types
'
;
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
type
ICachedEditorInput
=
ResourceEditorInput
|
IFileEditorInput
|
DataUriEditorInput
;
...
...
@@ -524,7 +524,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
const
rightInput
=
this
.
createInput
({
resource
:
resourceDiffInput
.
rightResource
,
forceFile
:
resourceDiffInput
.
forceFile
});
const
label
=
resourceDiffInput
.
label
||
localize
(
'
compareLabels
'
,
"
{0} ↔ {1}
"
,
this
.
toDiffLabel
(
leftInput
),
this
.
toDiffLabel
(
rightInput
));
return
new
DiffEditorInput
(
label
,
withUndefinedAsNull
(
resourceDiffInput
.
description
)
,
leftInput
,
rightInput
);
return
new
DiffEditorInput
(
label
,
resourceDiffInput
.
description
,
leftInput
,
rightInput
);
}
// Untitled file support
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录