Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0054a890
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,发现更多精彩内容 >>
未验证
提交
0054a890
编写于
3月 18, 2020
作者:
P
Peng Lyu
提交者:
GitHub
3月 18, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into rebornix/notebook
上级
d5ef90d4
73044c5e
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
89 addition
and
222 deletion
+89
-222
.github/commands.yml
.github/commands.yml
+0
-142
.github/workflows/commands.yml
.github/workflows/commands.yml
+5
-5
.github/workflows/copycat.yml
.github/workflows/copycat.yml
+12
-12
src/vs/platform/progress/common/progress.ts
src/vs/platform/progress/common/progress.ts
+1
-0
src/vs/workbench/contrib/debug/browser/debug.contribution.ts
src/vs/workbench/contrib/debug/browser/debug.contribution.ts
+2
-0
src/vs/workbench/contrib/debug/browser/debugProgress.ts
src/vs/workbench/contrib/debug/browser/debugProgress.ts
+51
-0
src/vs/workbench/contrib/debug/browser/debugViewlet.ts
src/vs/workbench/contrib/debug/browser/debugViewlet.ts
+7
-56
src/vs/workbench/services/progress/browser/progressService.ts
...vs/workbench/services/progress/browser/progressService.ts
+11
-7
未找到文件。
.github/commands.yml
浏览文件 @
0054a890
# {
# perform: true,
# commands: [
# {
# type: 'comment',
# name: 'findDuplicates',
# allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
# action: 'comment',
# comment: "Potential duplicates:\n${potentialDuplicates}"
# }
# ]
# }
{
perform
:
true
,
commands
:
[
{
type
:
'
comment'
,
name
:
'
question'
,
allowUsers
:
[
'
cleidigh'
,
'
usernamehw'
,
'
gjsjohnmurray'
,
'
IllusionMH'
],
action
:
'
updateLabels'
,
addLabel
:
'
*question'
},
{
type
:
'
label'
,
name
:
'
*question'
,
allowTriggerByBot
:
true
,
action
:
'
close'
,
comment
:
"
Please
ask
your
question
on
[StackOverflow](https://aka.ms/vscodestackoverflow).
We
have
a
great
community
over
[there](https://aka.ms/vscodestackoverflow).
They
have
already
answered
thousands
of
questions
and
are
happy
to
answer
yours
as
well.
See
also
our
[issue
reporting](https://aka.ms/vscodeissuereporting)
guidelines.
\n\n
Happy
Coding!"
},
{
type
:
'
label'
,
name
:
'
*dev-question'
,
allowTriggerByBot
:
true
,
action
:
'
close'
,
comment
:
"
We
have
a
great
developer
community
[over
on
slack](https://aka.ms/vscode-dev-community)
where
extension
authors
help
each
other.
This
is
a
great
place
for
you
to
ask
questions
and
find
support.
\n\n
Happy
Coding!"
},
{
type
:
'
label'
,
name
:
'
*extension-candidate'
,
allowTriggerByBot
:
true
,
action
:
'
close'
,
comment
:
"
We
try
to
keep
VS
Code
lean
and
we
think
the
functionality
you're
asking
for
is
great
for
a
VS
Code
extension.
Maybe
you
can
already
find
one
that
suits
you
in
the
[VS
Code
Marketplace](https://aka.ms/vscodemarketplace).
Just
in
case,
in
a
few
simple
steps
you
can
get
started
[writing
your
own
extension](https://aka.ms/vscodewritingextensions).
See
also
our
[issue
reporting](https://aka.ms/vscodeissuereporting)
guidelines.
\n\n
Happy
Coding!"
},
{
type
:
'
label'
,
name
:
'
*not-reproducible'
,
allowTriggerByBot
:
true
,
action
:
'
close'
,
comment
:
"
We
closed
this
issue
because
we
are
unable
to
reproduce
the
problem
with
the
steps
you
describe.
Chances
are
we've
already
fixed
your
problem
in
a
recent
version
of
VS
Code.
If
not,
please
ask
us
to
reopen
the
issue
and
provide
us
with
more
detail.
Our
[issue
reporting](https://aka.ms/vscodeissuereporting)
guidelines
might
help
you
with
that.
\n\n
Happy
Coding!"
},
{
type
:
'
label'
,
name
:
'
*out-of-scope'
,
allowTriggerByBot
:
true
,
action
:
'
close'
,
comment
:
"
We
closed
this
issue
because
we
don't
plan
to
address
it
in
the
foreseeable
future.
You
can
find
more
detailed
information
about
our
decision-making
process
[here](https://aka.ms/vscode-out-of-scope).
If
you
disagree
and
feel
that
this
issue
is
crucial:
We
are
happy
to
listen
and
to
reconsider.
\n\n
If
you
wonder
what
we
are
up
to,
please
see
our
[roadmap](https://aka.ms/vscoderoadmap)
and
[issue
reporting](https://aka.ms/vscodeissuereporting)
guidelines.
\n\n
Thanks
for
your
understanding
and
happy
coding!"
},
{
type
:
'
comment'
,
name
:
'
causedByExtension'
,
allowUsers
:
[
'
cleidigh'
,
'
usernamehw'
,
'
gjsjohnmurray'
,
'
IllusionMH'
],
action
:
'
updateLabels'
,
addLabel
:
'
*caused-by-extension'
},
{
type
:
'
label'
,
name
:
'
*caused-by-extension'
,
allowTriggerByBot
:
true
,
action
:
'
close'
,
comment
:
"
This
issue
is
caused
by
an
extension,
please
file
it
with
the
repository
(or
contact)
the
extension
has
linked
in
its
overview
in
VS
Code
or
the
[marketplace](https://aka.ms/vscodemarketplace)
for
VS
Code.
See
also
our
[issue
reporting](https://aka.ms/vscodeissuereporting)
guidelines.
\n\n
Happy
Coding!"
},
{
type
:
'
label'
,
name
:
'
*as-designed'
,
allowTriggerByBot
:
true
,
action
:
'
close'
,
comment
:
"
The
described
behavior
is
how
it
is
expected
to
work.
If
you
disagree,
please
explain
what
is
expected
and
what
is
not
in
more
detail.
See
also
our
[issue
reporting](https://aka.ms/vscodeissuereporting)
guidelines.
\n\n
Happy
Coding!"
},
{
type
:
'
label'
,
name
:
'
*english-please'
,
allowTriggerByBot
:
true
,
action
:
'
close'
,
comment
:
"
This
issue
is
being
closed
because
its
description
is
not
in
English,
that
makes
it
hard
for
us
to
work
on
it.
Please
open
a
new
issue
with
an
English
description.
You
might
find
[Bing
Translator](https://www.bing.com/translator)
useful."
},
{
type
:
'
comment'
,
name
:
'
duplicate'
,
allowUsers
:
[
'
cleidigh'
,
'
usernamehw'
,
'
gjsjohnmurray'
,
'
IllusionMH'
],
action
:
'
updateLabels'
,
addLabel
:
'
*duplicate'
},
{
type
:
'
label'
,
name
:
'
*duplicate'
,
allowTriggerByBot
:
true
,
action
:
'
close'
,
comment
:
"
Thanks
for
creating
this
issue!
We
figured
it's
covering
the
same
as
another
one
we
already
have.
Thus,
we
closed
this
one
as
a
duplicate.
You
can
search
for
existing
issues
[here](https://aka.ms/vscodeissuesearch).
See
also
our
[issue
reporting](https://aka.ms/vscodeissuereporting)
guidelines.
\n\n
Happy
Coding!"
},
{
type
:
'
comment'
,
name
:
'
confirm'
,
allowUsers
:
[
'
cleidigh'
,
'
usernamehw'
,
'
gjsjohnmurray'
,
'
IllusionMH'
],
action
:
'
updateLabels'
,
addLabel
:
'
confirmed'
,
removeLabel
:
'
confirmation-pending'
},
{
type
:
'
comment'
,
name
:
'
confirmationPending'
,
allowUsers
:
[
'
cleidigh'
,
'
usernamehw'
,
'
gjsjohnmurray'
,
'
IllusionMH'
],
action
:
'
updateLabels'
,
addLabel
:
'
confirmation-pending'
,
removeLabel
:
'
confirmed'
},
{
type
:
'
comment'
,
name
:
'
findDuplicates'
,
allowUsers
:
[
'
cleidigh'
,
'
usernamehw'
,
'
gjsjohnmurray'
,
'
IllusionMH'
],
action
:
'
comment'
,
comment
:
"
Potential
duplicates:
\n
${potentialDuplicates}"
},
{
type
:
'
comment'
,
name
:
'
needsMoreInfo'
,
allowUsers
:
[
'
cleidigh'
,
'
usernamehw'
,
'
gjsjohnmurray'
,
'
IllusionMH'
],
action
:
'
updateLabels'
,
addLabel
:
'
needs
more
info'
,
comment
:
"
Thanks
for
creating
this
issue!
We
figured
it's
missing
some
basic
information
or
in
some
other
way
doesn't
follow
our
[issue
reporting](https://aka.ms/vscodeissuereporting)
guidelines.
Please
take
the
time
to
review
these
and
update
the
issue.
\n\n
Happy
Coding!"
},
{
type
:
'
label'
,
name
:
'
~needs
more
info'
,
action
:
'
updateLabels'
,
addLabel
:
'
needs
more
info'
,
removeLabel
:
'
~needs
more
info'
,
comment
:
"
Thanks
for
creating
this
issue!
We
figured
it's
missing
some
basic
information
or
in
some
other
way
doesn't
follow
our
[issue
reporting](https://aka.ms/vscodeissuereporting)
guidelines.
Please
take
the
time
to
review
these
and
update
the
issue.
\n\n
Happy
Coding!"
},
{
type
:
'
comment'
,
name
:
'
a11ymas'
,
allowUsers
:
[
'
AccessibilityTestingTeam-TCS'
,
'
dixitsonali95'
,
'
Mohini78'
,
'
ChitrarupaSharma'
,
'
mspatil110'
,
'
umasarath52'
,
'
v-umnaik'
],
action
:
'
updateLabels'
,
addLabel
:
'
a11ymas'
},
{
type
:
'
label'
,
name
:
'
*off-topic'
,
action
:
'
close'
,
comment
:
"
Thanks
for
creating
this
issue.
We
think
this
issue
is
unactionable
or
unrelated
to
the
goals
of
this
project.
Please
follow
our
[issue
reporting](https://aka.ms/vscodeissuereporting)
guidelines.
\n\n
Happy
Coding!"
}
]
}
.github/workflows/commands.yml
浏览文件 @
0054a890
...
...
@@ -14,8 +14,8 @@ jobs:
with
:
repository
:
'
JacksonKearl/vscode-triage-github-actions'
ref
:
v2
#
- name: Run Commands
#
uses: ./commands
#
with:
#
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
#
config-path: commands
-
name
:
Run Commands
uses
:
./commands
with
:
token
:
${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
config-path
:
commands
.github/workflows/copycat.yml
浏览文件 @
0054a890
...
...
@@ -12,15 +12,15 @@ jobs:
with
:
repository
:
'
JacksonKearl/vscode-triage-github-actions'
ref
:
v2
#
- name: Run CopyCat (JacksonKearl/testissues)
#
uses: ./copycat
#
with:
#
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
#
owner: JacksonKearl
#
repo: testissues
#
- name: Run CopyCat (chrmarti/testissues)
#
uses: ./copycat
#
with:
#
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
#
owner: chrmarti
#
repo: testissues
-
name
:
Run CopyCat (JacksonKearl/testissues)
uses
:
./copycat
with
:
token
:
${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
owner
:
JacksonKearl
repo
:
testissues
-
name
:
Run CopyCat (chrmarti/testissues)
uses
:
./copycat
with
:
token
:
${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
owner
:
chrmarti
repo
:
testissues
src/vs/platform/progress/common/progress.ts
浏览文件 @
0054a890
...
...
@@ -62,6 +62,7 @@ export interface IProgressNotificationOptions extends IProgressOptions {
readonly
primaryActions
?:
ReadonlyArray
<
IAction
>
;
readonly
secondaryActions
?:
ReadonlyArray
<
IAction
>
;
readonly
delay
?:
number
;
readonly
silent
?:
boolean
;
}
export
interface
IProgressWindowOptions
extends
IProgressOptions
{
...
...
src/vs/workbench/contrib/debug/browser/debug.contribution.ts
浏览文件 @
0054a890
...
...
@@ -54,6 +54,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import
{
ViewPaneContainer
}
from
'
vs/workbench/browser/parts/views/viewPaneContainer
'
;
import
{
IQuickAccessRegistry
,
Extensions
as
QuickAccessExtensions
}
from
'
vs/platform/quickinput/common/quickAccess
'
;
import
{
StartDebugQuickAccessProvider
}
from
'
vs/workbench/contrib/debug/browser/debugQuickAccess
'
;
import
{
DebugProgressContribution
}
from
'
vs/workbench/contrib/debug/browser/debugProgress
'
;
class
OpenDebugViewletAction
extends
ShowViewletAction
{
public
static
readonly
ID
=
VIEWLET_ID
;
...
...
@@ -298,6 +299,7 @@ configurationRegistry.registerConfiguration({
// Register Debug Status
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
).
registerWorkbenchContribution
(
DebugStatusContribution
,
LifecyclePhase
.
Eventually
);
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
).
registerWorkbenchContribution
(
DebugProgressContribution
,
LifecyclePhase
.
Eventually
);
// Debug toolbar
...
...
src/vs/workbench/contrib/debug/browser/debugProgress.ts
0 → 100644
浏览文件 @
0054a890
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
IDebugService
,
VIEWLET_ID
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IProgressService
,
ProgressLocation
}
from
'
vs/platform/progress/common/progress
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
export
class
DebugProgressContribution
implements
IWorkbenchContribution
{
private
toDispose
:
IDisposable
[]
=
[];
constructor
(
@
IDebugService
private
readonly
debugService
:
IDebugService
,
@
IProgressService
private
readonly
progressService
:
IProgressService
)
{
let
progressListener
:
IDisposable
;
this
.
toDispose
.
push
(
this
.
debugService
.
getViewModel
().
onDidFocusSession
(
session
=>
{
if
(
progressListener
)
{
progressListener
.
dispose
();
}
if
(
session
)
{
progressListener
=
session
.
onDidProgressStart
(
async
progressStartEvent
=>
{
const
promise
=
new
Promise
<
void
>
(
r
=>
{
// Show progress until a progress end event comes or the session ends
const
listener
=
Event
.
any
(
Event
.
filter
(
session
.
onDidProgressEnd
,
e
=>
e
.
body
.
progressId
===
progressStartEvent
.
body
.
progressId
),
session
.
onDidEndAdapter
)(()
=>
{
listener
.
dispose
();
r
();
});
});
this
.
progressService
.
withProgress
({
location
:
VIEWLET_ID
},
()
=>
promise
);
this
.
progressService
.
withProgress
({
location
:
ProgressLocation
.
Notification
,
title
:
progressStartEvent
.
body
.
title
,
cancellable
:
progressStartEvent
.
body
.
cancellable
,
silent
:
true
},
()
=>
promise
,
()
=>
session
.
cancel
(
progressStartEvent
.
body
.
progressId
));
});
}
}));
}
dispose
():
void
{
dispose
(
this
.
toDispose
);
}
}
src/vs/workbench/contrib/debug/browser/debugViewlet.ts
浏览文件 @
0054a890
...
...
@@ -5,11 +5,10 @@
import
'
vs/css!./media/debugViewlet
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
IAction
,
Action
}
from
'
vs/base/common/actions
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
IActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IDebugService
,
VIEWLET_ID
,
State
,
BREAKPOINTS_VIEW_ID
,
IDebugConfiguration
,
DEBUG_PANEL_ID
,
CONTEXT_DEBUG_UX
,
CONTEXT_DEBUG_UX_KEY
,
IDebugSession
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IDebugService
,
VIEWLET_ID
,
State
,
BREAKPOINTS_VIEW_ID
,
IDebugConfiguration
,
DEBUG_PANEL_ID
,
CONTEXT_DEBUG_UX
,
CONTEXT_DEBUG_UX_KEY
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
StartAction
,
ConfigureAction
,
SelectAndStartAction
,
FocusSessionAction
}
from
'
vs/workbench/contrib/debug/browser/debugActions
'
;
import
{
StartDebugActionViewItem
,
FocusSessionActionViewItem
}
from
'
vs/workbench/contrib/debug/browser/debugActionViewItems
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -44,7 +43,6 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
private
paneListeners
=
new
Map
<
string
,
IDisposable
>
();
private
debugToolBarMenu
:
IMenu
|
undefined
;
private
disposeOnTitleUpdate
:
IDisposable
|
undefined
;
private
progressEvents
:
{
event
:
DebugProtocol
.
ProgressStartEvent
,
session
:
IDebugSession
}[]
=
[];
constructor
(
@
IWorkbenchLayoutService
layoutService
:
IWorkbenchLayoutService
,
...
...
@@ -81,38 +79,6 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
this
.
updateTitleArea
();
}
}));
let
progressListener
:
IDisposable
;
this
.
_register
(
this
.
debugService
.
getViewModel
().
onDidFocusSession
(
session
=>
{
if
(
progressListener
)
{
progressListener
.
dispose
();
}
if
(
session
)
{
progressListener
=
session
.
onDidProgressStart
(
async
progressStartEvent
=>
{
// Update title area to show the cancel progress action
this
.
progressEvents
.
push
({
session
:
session
,
event
:
progressStartEvent
});
if
(
progressStartEvent
.
body
.
cancellable
)
{
this
.
cancelAction
.
tooltip
=
nls
.
localize
(
'
cancelProgress
'
,
"
Cancel {0}
"
,
progressStartEvent
.
body
.
title
);
this
.
updateTitleArea
();
}
await
this
.
progressService
.
withProgress
({
location
:
VIEWLET_ID
},
()
=>
{
return
new
Promise
(
r
=>
{
// Show progress until a progress end event comes or the session ends
const
listener
=
Event
.
any
(
Event
.
filter
(
session
.
onDidProgressEnd
,
e
=>
e
.
body
.
progressId
===
progressStartEvent
.
body
.
progressId
),
session
.
onDidEndAdapter
)(()
=>
{
listener
.
dispose
();
r
();
});
});
});
this
.
progressEvents
=
this
.
progressEvents
.
filter
(
pe
=>
pe
.
event
.
body
.
progressId
!==
progressStartEvent
.
body
.
progressId
);
if
(
progressStartEvent
.
body
.
cancellable
)
{
this
.
cancelAction
.
tooltip
=
nls
.
localize
(
'
cancel
'
,
"
Cancel
"
);
this
.
updateTitleArea
();
}
});
}
}));
}
create
(
parent
:
HTMLElement
):
void
{
...
...
@@ -145,16 +111,6 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
return
this
.
_register
(
this
.
instantiationService
.
createInstance
(
OpenDebugPanelAction
,
OpenDebugPanelAction
.
ID
,
OpenDebugPanelAction
.
LABEL
));
}
@
memoize
private
get
cancelAction
():
Action
{
return
this
.
_register
(
new
Action
(
'
debug.cancelProgress
'
,
nls
.
localize
(
'
cancel
'
,
"
Cancel
"
),
'
debug-action codicon codicon-stop
'
,
true
,
async
()
=>
{
const
progressEvent
=
this
.
progressEvents
.
filter
(
e
=>
e
.
event
.
body
.
cancellable
).
pop
();
if
(
progressEvent
)
{
await
progressEvent
.
session
.
cancel
(
progressEvent
.
event
.
body
.
progressId
);
}
}));
}
@
memoize
private
get
selectAndStartAction
():
SelectAndStartAction
{
return
this
.
_register
(
this
.
instantiationService
.
createInstance
(
SelectAndStartAction
,
SelectAndStartAction
.
ID
,
nls
.
localize
(
'
startAdditionalSession
'
,
"
Start Additional Session
"
)));
...
...
@@ -165,7 +121,6 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
return
[];
}
let
result
:
IAction
[];
if
(
!
this
.
showInitialDebugActions
)
{
if
(
!
this
.
debugToolBarMenu
)
{
...
...
@@ -179,18 +134,14 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
}
this
.
disposeOnTitleUpdate
=
disposable
;
result
=
actions
;
}
else
if
(
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
)
{
result
=
[
this
.
toggleReplAction
];
}
else
{
result
=
[
this
.
startAction
,
this
.
configureAction
,
this
.
toggleReplAction
];
return
actions
;
}
if
(
this
.
progressEvents
.
filter
(
e
=>
e
.
event
.
body
.
cancellable
).
length
)
{
re
sult
.
unshift
(
this
.
cancelAction
)
;
if
(
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
)
{
re
turn
[
this
.
toggleReplAction
]
;
}
return
result
;
return
[
this
.
startAction
,
this
.
configureAction
,
this
.
toggleReplAction
]
;
}
get
showInitialDebugActions
():
boolean
{
...
...
@@ -235,7 +186,7 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
}
if
(
state
===
State
.
Initializing
)
{
this
.
progressService
.
withProgress
({
location
:
VIEWLET_ID
},
_progress
=>
{
this
.
progressService
.
withProgress
({
location
:
VIEWLET_ID
,
},
_progress
=>
{
return
new
Promise
(
resolve
=>
this
.
progressResolve
=
resolve
);
});
}
...
...
src/vs/workbench/services/progress/browser/progressService.ts
浏览文件 @
0054a890
...
...
@@ -251,7 +251,7 @@ export class ProgressService extends Disposable implements IProgressService {
return
toDisposable
(()
=>
promiseResolve
());
};
const
createNotification
=
(
message
:
string
,
increment
?:
number
):
INotificationHandle
=>
{
const
createNotification
=
(
message
:
string
,
silent
:
boolean
,
increment
?:
number
):
INotificationHandle
=>
{
const
notificationDisposables
=
new
DisposableStore
();
const
primaryActions
=
options
.
primaryActions
?
Array
.
from
(
options
.
primaryActions
)
:
[];
...
...
@@ -294,7 +294,8 @@ export class ProgressService extends Disposable implements IProgressService {
message
,
source
:
options
.
source
,
actions
:
{
primary
:
primaryActions
,
secondary
:
secondaryActions
},
progress
:
typeof
increment
===
'
number
'
&&
increment
>=
0
?
{
total
:
100
,
worked
:
increment
}
:
{
infinite
:
true
}
progress
:
typeof
increment
===
'
number
'
&&
increment
>=
0
?
{
total
:
100
,
worked
:
increment
}
:
{
infinite
:
true
},
silent
});
// Switch to window based progress once the notification
...
...
@@ -302,8 +303,7 @@ export class ProgressService extends Disposable implements IProgressService {
// Remove that window based progress once the notification
// shows again.
let
windowProgressDisposable
:
IDisposable
|
undefined
=
undefined
;
notificationDisposables
.
add
(
notification
.
onDidChangeVisibility
(
visible
=>
{
const
onVisibilityChange
=
(
visible
:
boolean
)
=>
{
// Clear any previous running window progress
dispose
(
windowProgressDisposable
);
...
...
@@ -311,7 +311,11 @@ export class ProgressService extends Disposable implements IProgressService {
if
(
!
visible
&&
!
progressStateModel
.
done
)
{
windowProgressDisposable
=
createWindowProgress
();
}
}));
};
notificationDisposables
.
add
(
notification
.
onDidChangeVisibility
(
onVisibilityChange
));
if
(
silent
)
{
onVisibilityChange
(
false
);
}
// Clear upon dispose
Event
.
once
(
notification
.
onDidClose
)(()
=>
notificationDisposables
.
dispose
());
...
...
@@ -346,10 +350,10 @@ export class ProgressService extends Disposable implements IProgressService {
// create notification now or after a delay
if
(
typeof
options
.
delay
===
'
number
'
&&
options
.
delay
>
0
)
{
if
(
typeof
notificationTimeout
!==
'
number
'
)
{
notificationTimeout
=
setTimeout
(()
=>
notificationHandle
=
createNotification
(
titleAndMessage
!
,
step
?.
increment
),
options
.
delay
);
notificationTimeout
=
setTimeout
(()
=>
notificationHandle
=
createNotification
(
titleAndMessage
!
,
!!
options
.
silent
,
step
?.
increment
),
options
.
delay
);
}
}
else
{
notificationHandle
=
createNotification
(
titleAndMessage
,
step
?.
increment
);
notificationHandle
=
createNotification
(
titleAndMessage
,
!!
options
.
silent
,
step
?.
increment
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录