Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
01423e45
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
01423e45
编写于
6月 05, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - move status message into notification status
上级
fa3b4d7c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
53 addition
and
59 deletion
+53
-59
src/vs/editor/contrib/goToDefinition/goToDefinitionResultsNavigation.ts
...contrib/goToDefinition/goToDefinitionResultsNavigation.ts
+3
-3
src/vs/platform/statusbar/common/statusbar.ts
src/vs/platform/statusbar/common/statusbar.ts
+2
-7
src/vs/workbench/api/browser/mainThreadWorkspace.ts
src/vs/workbench/api/browser/mainThreadWorkspace.ts
+3
-3
src/vs/workbench/browser/parts/notifications/notificationsStatus.ts
...kbench/browser/parts/notifications/notificationsStatus.ts
+44
-4
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
+0
-39
src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts
...workbench/contrib/format/browser/formatActionsMultiple.ts
+1
-3
未找到文件。
src/vs/editor/contrib/goToDefinition/goToDefinitionResultsNavigation.ts
浏览文件 @
01423e45
...
...
@@ -15,9 +15,9 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Disposable
,
dispose
,
IDisposable
,
combinedDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
IStatusbarService
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
export
const
ctxHasSymbols
=
new
RawContextKey
(
'
hasSymbols
'
,
false
);
...
...
@@ -45,7 +45,7 @@ class SymbolNavigationService implements ISymbolNavigationService {
constructor
(
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
ICodeEditorService
private
readonly
_editorService
:
ICodeEditorService
,
@
I
StatusbarService
private
readonly
_statusbarService
:
IStatusbar
Service
,
@
I
NotificationService
private
readonly
_notificationService
:
INotification
Service
,
@
IKeybindingService
private
readonly
_keybindingService
:
IKeybindingService
,
)
{
this
.
_ctxHasSymbols
=
ctxHasSymbols
.
bindTo
(
contextKeyService
);
...
...
@@ -143,7 +143,7 @@ class SymbolNavigationService implements ISymbolNavigationService {
?
localize
(
'
location.kb
'
,
"
Symbol {0} of {1}, {2} for next
"
,
this
.
_currentIdx
+
1
,
this
.
_currentModel
!
.
references
.
length
,
kb
.
getLabel
())
:
localize
(
'
location
'
,
"
Symbol {0} of {1}
"
,
this
.
_currentIdx
+
1
,
this
.
_currentModel
!
.
references
.
length
);
this
.
_currentMessage
=
this
.
_
statusbarService
.
setStatusMessage
(
message
);
this
.
_currentMessage
=
this
.
_
notificationService
.
status
(
message
);
}
}
...
...
src/vs/platform/statusbar/common/statusbar.ts
浏览文件 @
01423e45
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
createDecorator
,
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ThemeColor
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
ExtensionIdentifier
}
from
'
vs/platform/extensions/common/extensions
'
;
...
...
@@ -64,18 +64,13 @@ export interface IStatusbarEntry {
export
interface
IStatusbarService
{
_serviceBrand
:
any
;
_serviceBrand
:
ServiceIdentifier
<
IStatusbarService
>
;
/**
* Adds an entry to the statusbar with the given alignment and priority. Use the returned accessor
* to update or remove the statusbar entry.
*/
addEntry
(
entry
:
IStatusbarEntry
,
alignment
:
StatusbarAlignment
,
priority
?:
number
):
IStatusbarEntryAccessor
;
/**
* Prints something to the status bar area with optional auto dispose and delay.
*/
setStatusMessage
(
message
:
string
,
autoDisposeAfter
?:
number
,
delayBy
?:
number
):
IDisposable
;
}
export
interface
IStatusbarEntryAccessor
extends
IDisposable
{
...
...
src/vs/workbench/api/browser/mainThreadWorkspace.ts
浏览文件 @
01423e45
...
...
@@ -13,7 +13,6 @@ import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
IFileMatch
,
IPatternInfo
,
ISearchProgressItem
,
ISearchService
}
from
'
vs/workbench/services/search/common/search
'
;
import
{
IStatusbarService
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
,
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
extHostNamedCustomer
}
from
'
vs/workbench/api/common/extHostCustomers
'
;
...
...
@@ -24,6 +23,7 @@ import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common
import
{
ExtHostContext
,
ExtHostWorkspaceShape
,
IExtHostContext
,
MainContext
,
MainThreadWorkspaceShape
,
IWorkspaceData
,
ITextSearchComplete
}
from
'
../common/extHost.protocol
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
isEqualOrParent
}
from
'
vs/base/common/resources
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadWorkspace
)
export
class
MainThreadWorkspace
implements
MainThreadWorkspaceShape
{
...
...
@@ -39,7 +39,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape {
@
IWorkspaceContextService
private
readonly
_contextService
:
IWorkspaceContextService
,
@
ITextFileService
private
readonly
_textFileService
:
ITextFileService
,
@
IWorkspaceEditingService
private
readonly
_workspaceEditingService
:
IWorkspaceEditingService
,
@
I
StatusbarService
private
readonly
_statusbarService
:
IStatusbar
Service
,
@
I
NotificationService
private
readonly
_notificationService
:
INotification
Service
,
@
IWindowService
private
readonly
_windowService
:
IWindowService
,
@
IInstantiationService
private
readonly
_instantiationService
:
IInstantiationService
,
@
ILabelService
private
readonly
_labelService
:
ILabelService
,
...
...
@@ -66,7 +66,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape {
const
workspaceFoldersToAdd
=
foldersToAdd
.
map
(
f
=>
({
uri
:
URI
.
revive
(
f
.
uri
),
name
:
f
.
name
}));
// Indicate in status message
this
.
_
statusbarService
.
setStatusMessage
(
this
.
getStatusMessage
(
extensionName
,
workspaceFoldersToAdd
.
length
,
deleteCount
),
10
*
1000
/* 10s */
);
this
.
_
notificationService
.
status
(
this
.
getStatusMessage
(
extensionName
,
workspaceFoldersToAdd
.
length
,
deleteCount
),
{
hideAfter
:
10
*
1000
/* 10s */
}
);
return
this
.
_workspaceEditingService
.
updateFolders
(
index
,
deleteCount
,
workspaceFoldersToAdd
,
true
);
}
...
...
src/vs/workbench/browser/parts/notifications/notificationsStatus.ts
浏览文件 @
01423e45
...
...
@@ -5,18 +5,20 @@
import
{
INotificationsModel
,
INotificationChangeEvent
,
NotificationChangeType
,
INotificationViewItem
,
IStatusMessageChangeEvent
,
StatusMessageChangeType
,
IStatusMessageViewItem
}
from
'
vs/workbench/common/notifications
'
;
import
{
IStatusbarService
,
StatusbarAlignment
,
IStatusbarEntryAccessor
,
IStatusbarEntry
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
Disposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposable
,
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
HIDE_NOTIFICATIONS_CENTER
,
SHOW_NOTIFICATIONS_CENTER
}
from
'
vs/workbench/browser/parts/notifications/notificationsCommands
'
;
import
{
localize
}
from
'
vs/nls
'
;
export
class
NotificationsStatus
extends
Disposable
{
private
notificationsCenterStatusItem
:
IStatusbarEntryAccessor
;
private
isNotificationsCenterVisible
:
boolean
;
private
notificationsCenterStatusItem
:
IStatusbarEntryAccessor
;
private
currentNotifications
=
new
Set
<
INotificationViewItem
>
();
private
statusMessageDispose
:
IDisposable
;
private
currentStatusMessage
:
[
IStatusMessageViewItem
,
IDisposable
]
|
undefined
;
private
isNotificationsCenterVisible
:
boolean
;
constructor
(
private
model
:
INotificationsModel
,
@
IStatusbarService
private
readonly
statusbarService
:
IStatusbarService
...
...
@@ -108,7 +110,7 @@ export class NotificationsStatus extends Disposable {
this
.
currentStatusMessage
=
[
statusItem
,
this
.
statusbarService
.
s
etStatusMessage
(
statusItem
.
message
,
hideAfter
,
showAfter
)
this
.
doS
etStatusMessage
(
statusItem
.
message
,
hideAfter
,
showAfter
)
];
break
;
...
...
@@ -123,4 +125,42 @@ export class NotificationsStatus extends Disposable {
break
;
}
}
private
doSetStatusMessage
(
message
:
string
,
autoDisposeAfter
:
number
=
-
1
,
delayBy
:
number
=
0
):
IDisposable
{
// Dismiss any previous
dispose
(
this
.
statusMessageDispose
);
// Create new
let
statusMessageEntry
:
IStatusbarEntryAccessor
;
let
showHandle
:
any
=
setTimeout
(()
=>
{
statusMessageEntry
=
this
.
statusbarService
.
addEntry
({
text
:
message
},
StatusbarAlignment
.
LEFT
,
-
Number
.
MAX_VALUE
/* far right on left hand side */
);
showHandle
=
null
;
},
delayBy
);
// Dispose function takes care of timeouts and actual entry
let
hideHandle
:
any
;
const
statusMessageDispose
=
{
dispose
:
()
=>
{
if
(
showHandle
)
{
clearTimeout
(
showHandle
);
}
if
(
hideHandle
)
{
clearTimeout
(
hideHandle
);
}
if
(
statusMessageEntry
)
{
statusMessageEntry
.
dispose
();
}
}
};
this
.
statusMessageDispose
=
statusMessageDispose
;
if
(
typeof
autoDisposeAfter
===
'
number
'
&&
autoDisposeAfter
>
0
)
{
hideHandle
=
setTimeout
(()
=>
statusMessageDispose
.
dispose
(),
autoDisposeAfter
);
}
return
statusMessageDispose
;
}
}
\ No newline at end of file
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
浏览文件 @
01423e45
...
...
@@ -51,7 +51,6 @@ export class StatusbarPart extends Part implements IStatusbarService {
//#endregion
private
statusMessageDispose
:
IDisposable
;
private
styleElement
:
HTMLStyleElement
;
private
pendingEntries
:
PendingEntry
[]
=
[];
...
...
@@ -285,44 +284,6 @@ export class StatusbarPart extends Part implements IStatusbarService {
return
el
;
}
setStatusMessage
(
message
:
string
,
autoDisposeAfter
:
number
=
-
1
,
delayBy
:
number
=
0
):
IDisposable
{
// Dismiss any previous
dispose
(
this
.
statusMessageDispose
);
// Create new
let
statusMessageEntry
:
IStatusbarEntryAccessor
;
let
showHandle
:
any
=
setTimeout
(()
=>
{
statusMessageEntry
=
this
.
addEntry
({
text
:
message
},
StatusbarAlignment
.
LEFT
,
-
Number
.
MAX_VALUE
/* far right on left hand side */
);
showHandle
=
null
;
},
delayBy
);
// Dispose function takes care of timeouts and actual entry
let
hideHandle
:
any
;
const
statusMessageDispose
=
{
dispose
:
()
=>
{
if
(
showHandle
)
{
clearTimeout
(
showHandle
);
}
if
(
hideHandle
)
{
clearTimeout
(
hideHandle
);
}
if
(
statusMessageEntry
)
{
statusMessageEntry
.
dispose
();
}
}
};
this
.
statusMessageDispose
=
statusMessageDispose
;
if
(
typeof
autoDisposeAfter
===
'
number
'
&&
autoDisposeAfter
>
0
)
{
hideHandle
=
setTimeout
(()
=>
statusMessageDispose
.
dispose
(),
autoDisposeAfter
);
}
return
statusMessageDispose
;
}
layout
(
width
:
number
,
height
:
number
):
void
{
super
.
layoutContents
(
width
,
height
);
}
...
...
src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts
浏览文件 @
01423e45
...
...
@@ -26,7 +26,6 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
import
{
INotificationService
,
Severity
}
from
'
vs/platform/notification/common/notification
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IStatusbarService
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
IExtensionEnablementService
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
...
...
@@ -46,7 +45,6 @@ class DefaultFormatter extends Disposable implements IWorkbenchContribution {
@
INotificationService
private
readonly
_notificationService
:
INotificationService
,
@
IQuickInputService
private
readonly
_quickInputService
:
IQuickInputService
,
@
IModeService
private
readonly
_modeService
:
IModeService
,
@
IStatusbarService
private
readonly
_statusbarService
:
IStatusbarService
,
@
ILabelService
private
readonly
_labelService
:
ILabelService
,
)
{
super
();
...
...
@@ -97,7 +95,7 @@ class DefaultFormatter extends Disposable implements IWorkbenchContribution {
// formatter does not target this file
const
label
=
this
.
_labelService
.
getUriLabel
(
document
.
uri
,
{
relative
:
true
});
const
message
=
nls
.
localize
(
'
miss
'
,
"
Extension '{0}' cannot format '{1}'
"
,
extension
.
displayName
||
extension
.
name
,
label
);
this
.
_
statusbarService
.
setStatusMessage
(
message
,
4000
);
this
.
_
notificationService
.
status
(
message
,
{
hideAfter
:
4000
}
);
return
undefined
;
}
}
else
if
(
formatter
.
length
===
1
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录