Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cebddf21
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,发现更多精彩内容 >>
提交
cebddf21
编写于
1月 10, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: remove disabled state and tune viewlet ux for no folder workspace
上级
1c38df78
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
42 addition
and
60 deletion
+42
-60
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+13
-4
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
+1
-1
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
.../workbench/parts/debug/browser/debugEditorModelManager.ts
+1
-1
src/vs/workbench/parts/debug/browser/debugViewlet.ts
src/vs/workbench/parts/debug/browser/debugViewlet.ts
+17
-48
src/vs/workbench/parts/debug/browser/media/debugViewlet.css
src/vs/workbench/parts/debug/browser/media/debugViewlet.css
+9
-0
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+0
-1
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+1
-5
未找到文件。
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
cebddf21
...
...
@@ -10,6 +10,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IDebugService
,
State
,
IProcess
,
SessionRequestType
,
IThread
,
IEnablement
,
IBreakpoint
,
IStackFrame
,
IFunctionBreakpoint
,
IDebugEditorContribution
,
EDITOR_CONTRIBUTION_ID
,
IExpression
,
REPL_ID
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Variable
,
Expression
,
Thread
,
Breakpoint
,
Process
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
...
...
@@ -18,7 +19,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
TogglePanelAction
}
from
'
vs/workbench/browser/panel
'
;
export
class
AbstractDebugAction
extends
Action
{
export
abstract
class
AbstractDebugAction
extends
Action
{
protected
toDispose
:
lifecycle
.
IDisposable
[];
...
...
@@ -56,7 +57,7 @@ export class AbstractDebugAction extends Action {
}
protected
isEnabled
(
state
:
State
):
boolean
{
return
state
!==
State
.
Disabled
;
return
true
;
}
public
dispose
():
void
{
...
...
@@ -69,7 +70,11 @@ export class ConfigureAction extends AbstractDebugAction {
static
ID
=
'
workbench.action.debug.configure
'
;
static
LABEL
=
nls
.
localize
(
'
openLaunchJson
'
,
"
Open {0}
"
,
'
launch.json
'
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
)
{
super
(
id
,
label
,
'
debug-action configure
'
,
debugService
,
keybindingService
);
this
.
toDispose
.
push
(
debugService
.
getViewModel
().
onDidSelectConfiguration
(
configurationName
=>
this
.
updateClass
()));
this
.
updateClass
();
...
...
@@ -87,6 +92,10 @@ export class ConfigureAction extends AbstractDebugAction {
this
.
class
=
this
.
debugService
.
getViewModel
().
selectedConfigurationName
?
'
debug-action configure
'
:
'
debug-action configure notification
'
;
}
protected
isEnabled
():
boolean
{
return
!!
this
.
contextService
.
getWorkspace
();
}
public
run
(
event
?:
any
):
TPromise
<
any
>
{
const
sideBySide
=
!!
(
event
&&
(
event
.
ctrlKey
||
event
.
metaKey
));
return
this
.
debugService
.
getConfigurationManager
().
openConfigFile
(
sideBySide
);
...
...
@@ -440,7 +449,7 @@ export class ReapplyBreakpointsAction extends AbstractDebugAction {
protected
isEnabled
(
state
:
State
):
boolean
{
const
model
=
this
.
debugService
.
getModel
();
return
super
.
isEnabled
(
state
)
&&
state
!==
State
.
Disabled
&&
state
!==
State
.
Inactive
&&
return
super
.
isEnabled
(
state
)
&&
state
!==
State
.
Inactive
&&
(
model
.
getFunctionBreakpoints
().
length
+
model
.
getBreakpoints
().
length
+
model
.
getExceptionBreakpoints
().
length
>
0
);
}
}
...
...
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
浏览文件 @
cebddf21
...
...
@@ -156,7 +156,7 @@ export class DebugActionsWidget implements IWorkbenchContribution {
private
update
():
void
{
const
state
=
this
.
debugService
.
state
;
if
(
state
===
debug
.
State
.
Disabled
||
state
===
debug
.
State
.
Inactive
)
{
if
(
state
===
debug
.
State
.
Inactive
)
{
return
this
.
hide
();
}
...
...
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
浏览文件 @
cebddf21
...
...
@@ -202,7 +202,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
});
}
}
modelData
.
dirty
=
this
.
debugService
.
state
!==
State
.
Inactive
&&
this
.
debugService
.
state
!==
State
.
Disabled
;
modelData
.
dirty
=
this
.
debugService
.
state
!==
State
.
Inactive
;
const
toRemove
=
this
.
debugService
.
getModel
().
getBreakpoints
()
.
filter
(
bp
=>
bp
.
uri
.
toString
()
===
modelUri
.
toString
());
...
...
src/vs/workbench/parts/debug/browser/debugViewlet.ts
浏览文件 @
cebddf21
...
...
@@ -4,9 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
'
vs/css!./media/debugViewlet
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
$
,
Builder
,
Dimension
}
from
'
vs/base/browser/builder
'
;
import
{
Builder
,
Dimension
}
from
'
vs/base/browser/builder
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
lifecycle
from
'
vs/base/common/lifecycle
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
...
...
@@ -23,9 +21,7 @@ import { IProgressService, IProgressRunner } from 'vs/platform/progress/common/p
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
env
=
require
(
'
vs/base/common/platform
'
);
import
{
Button
}
from
'
vs/base/browser/ui/button/button
'
;
import
{
OpenFolderAction
,
OpenFileFolderAction
}
from
'
vs/workbench/browser/actions/fileActions
'
;
export
class
DebugViewlet
extends
Viewlet
{
...
...
@@ -65,7 +61,6 @@ export class DebugViewlet extends Viewlet {
super
.
create
(
parent
);
this
.
$el
=
parent
.
div
().
addClass
(
'
debug-viewlet
'
);
if
(
this
.
contextService
.
hasWorkspace
())
{
const
actionRunner
=
this
.
getActionRunner
();
this
.
views
=
DebugViewRegistry
.
getDebugViews
().
map
(
viewConstructor
=>
this
.
instantiationService
.
createInstance
(
viewConstructor
,
...
...
@@ -76,29 +71,6 @@ export class DebugViewlet extends Viewlet {
this
.
splitView
=
new
SplitView
(
this
.
$el
.
getHTMLElement
());
this
.
toDispose
.
push
(
this
.
splitView
);
this
.
views
.
forEach
(
v
=>
this
.
splitView
.
addView
(
v
));
}
else
{
const
noworkspace
=
$
([
'
<div class="noworkspace-view">
'
,
'
<p>
'
,
nls
.
localize
(
'
noWorkspaceHelp
'
,
"
You have not yet opened a folder.
"
),
'
</p>
'
,
'
<p>
'
,
nls
.
localize
(
'
pleaseRestartToDebug
'
,
"
Open a folder in order to start debugging.
"
),
'
</p>
'
,
'
</div>
'
].
join
(
''
));
this
.
openFolderButton
=
new
Button
(
noworkspace
);
this
.
openFolderButton
.
label
=
nls
.
localize
(
'
openFolder
'
,
"
Open Folder
"
);
this
.
openFolderButton
.
addListener2
(
'
click
'
,
()
=>
{
const
actionClass
=
env
.
isMacintosh
?
OpenFileFolderAction
:
OpenFolderAction
;
const
action
=
this
.
instantiationService
.
createInstance
<
string
,
string
,
IAction
>
(
actionClass
,
actionClass
.
ID
,
actionClass
.
LABEL
);
this
.
actionRunner
.
run
(
action
).
done
(()
=>
{
action
.
dispose
();
},
err
=>
{
action
.
dispose
();
errors
.
onUnexpectedError
(
err
);
});
});
this
.
$el
.
append
(
noworkspace
);
}
return
TPromise
.
as
(
null
);
}
...
...
@@ -129,16 +101,13 @@ export class DebugViewlet extends Viewlet {
}
public
getActions
():
IAction
[]
{
if
(
this
.
debugService
.
state
===
State
.
Disabled
)
{
return
[];
}
if
(
!
this
.
actions
)
{
this
.
actions
=
[
this
.
instantiationService
.
createInstance
(
StartAction
,
StartAction
.
ID
,
StartAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
ConfigureAction
,
ConfigureAction
.
ID
,
ConfigureAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
ToggleReplAction
,
ToggleReplAction
.
ID
,
ToggleReplAction
.
LABEL
)
];
this
.
actions
=
[];
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
StartAction
,
StartAction
.
ID
,
StartAction
.
LABEL
));
if
(
this
.
contextService
.
getWorkspace
())
{
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
ConfigureAction
,
ConfigureAction
.
ID
,
ConfigureAction
.
LABEL
));
}
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
ToggleReplAction
,
ToggleReplAction
.
ID
,
ToggleReplAction
.
LABEL
));
this
.
actions
.
forEach
(
a
=>
{
this
.
toDispose
.
push
(
a
);
...
...
@@ -149,7 +118,7 @@ export class DebugViewlet extends Viewlet {
}
public
getActionItem
(
action
:
IAction
):
IActionItem
{
if
(
action
.
id
===
StartAction
.
ID
)
{
if
(
action
.
id
===
StartAction
.
ID
&&
this
.
contextService
.
getWorkspace
()
)
{
if
(
!
this
.
startDebugActionItem
)
{
this
.
startDebugActionItem
=
this
.
instantiationService
.
createInstance
(
StartDebugActionItem
,
null
,
action
);
}
...
...
src/vs/workbench/parts/debug/browser/media/debugViewlet.css
浏览文件 @
cebddf21
...
...
@@ -15,6 +15,10 @@
background
:
url('configure.svg')
center
center
no-repeat
;
}
.monaco-workbench
.debug-action.start
{
background
:
url('continue.svg')
center
center
no-repeat
;
}
.monaco-workbench
.debug-action.toggle-repl
{
background
:
url('repl.svg')
center
center
no-repeat
;
}
...
...
@@ -31,6 +35,11 @@
border
:
1px
solid
white
;
}
.vs-dark
.monaco-workbench
.debug-action.start
,
.hc-black
.monaco-workbench
.debug-action.start
{
background
:
url('continue-inverse.svg')
center
center
no-repeat
;
}
.vs-dark
.monaco-workbench
.debug-action.configure
,
.hc-black
.monaco-workbench
.debug-action.configure
{
background
:
url('configure-inverse.svg')
center
center
no-repeat
;
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
cebddf21
...
...
@@ -263,7 +263,6 @@ export interface IModel extends ITreeElement {
// Debug enums
export
enum
State
{
Disabled
,
Inactive
,
Initializing
,
Stopped
,
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
cebddf21
...
...
@@ -359,7 +359,7 @@ export class DebugService implements debug.IDebugService {
this
.
toDisposeOnSessionEnd
.
get
(
session
.
getId
()).
push
(
session
.
onDidExitAdapter
(
event
=>
{
// 'Run without debugging' mode VSCode must terminate the extension host. More details: #3905
if
(
session
&&
session
.
configuration
.
type
===
'
extensionHost
'
&&
this
.
sessionStates
.
get
(
session
.
getId
())
===
debug
.
State
.
RunningNoDebug
)
{
if
(
session
&&
session
.
configuration
.
type
===
'
extensionHost
'
&&
this
.
sessionStates
.
get
(
session
.
getId
())
===
debug
.
State
.
RunningNoDebug
&&
this
.
contextService
.
getWorkspace
()
)
{
this
.
windowsService
.
closeExtensionHostWindow
(
this
.
contextService
.
getWorkspace
().
resource
.
fsPath
);
}
if
(
session
&&
session
.
getId
()
===
event
.
body
.
sessionId
)
{
...
...
@@ -426,10 +426,6 @@ export class DebugService implements debug.IDebugService {
}
public
get
state
():
debug
.
State
{
if
(
!
this
.
contextService
.
hasWorkspace
())
{
return
debug
.
State
.
Disabled
;
}
const
focusedProcess
=
this
.
viewModel
.
focusedProcess
;
if
(
focusedProcess
)
{
return
this
.
sessionStates
.
get
(
focusedProcess
.
getId
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录