Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2274768d
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,发现更多精彩内容 >>
未验证
提交
2274768d
编写于
12月 27, 2018
作者:
I
Isidor Nikolic
提交者:
GitHub
12月 27, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #65226 from Microsoft/rmacfarlane/debug
Simplify start debug command handler
上级
e2cfa3ae
959669be
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
65 deletion
+18
-65
src/vs/code/electron-browser/processExplorer/processExplorerMain.ts
...e/electron-browser/processExplorer/processExplorerMain.ts
+2
-2
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+2
-6
src/vs/workbench/parts/debug/browser/debugCommands.ts
src/vs/workbench/parts/debug/browser/debugCommands.ts
+11
-1
src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts
...kbench/parts/debug/electron-browser/debug.contribution.ts
+3
-56
未找到文件。
src/vs/code/electron-browser/processExplorer/processExplorerMain.ts
浏览文件 @
2274768d
...
@@ -96,7 +96,7 @@ function attachTo(item: ProcessItem) {
...
@@ -96,7 +96,7 @@ function attachTo(item: ProcessItem) {
config
.
port
=
parseInt
(
matches
[
2
]);
config
.
port
=
parseInt
(
matches
[
2
]);
}
}
ipcRenderer
.
send
(
'
vscode:workbenchCommand
'
,
{
id
:
'
workbench.action.debug.start
'
,
from
:
'
processExplorer
'
,
args
:
[
config
]
});
ipcRenderer
.
send
(
'
vscode:workbenchCommand
'
,
{
id
:
'
debug.startFromConfig
'
,
from
:
'
processExplorer
'
,
args
:
[
config
]
});
}
}
function
getProcessIdWithHighestProperty
(
processList
,
propertyName
:
string
)
{
function
getProcessIdWithHighestProperty
(
processList
,
propertyName
:
string
)
{
...
@@ -299,4 +299,4 @@ export function startup(data: ProcessExplorerData): void {
...
@@ -299,4 +299,4 @@ export function startup(data: ProcessExplorerData): void {
applyZoom
(
webFrame
.
getZoomLevel
()
-
1
);
applyZoom
(
webFrame
.
getZoomLevel
()
-
1
);
}
}
};
};
}
}
\ No newline at end of file
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
2274768d
...
@@ -10,7 +10,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
...
@@ -10,7 +10,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IDebugService
,
State
,
IDebugSession
,
IThread
,
IEnablement
,
IBreakpoint
,
IStackFrame
,
REPL_ID
,
IConfig
}
import
{
IDebugService
,
State
,
IDebugSession
,
IThread
,
IEnablement
,
IBreakpoint
,
IStackFrame
,
REPL_ID
}
from
'
vs/workbench/parts/debug/common/debug
'
;
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Variable
,
Expression
,
Thread
,
Breakpoint
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
import
{
Variable
,
Expression
,
Thread
,
Breakpoint
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
...
@@ -135,11 +135,7 @@ export class StartAction extends AbstractDebugAction {
...
@@ -135,11 +135,7 @@ export class StartAction extends AbstractDebugAction {
// Note: When this action is executed from the process explorer, a config is passed. For all
// Note: When this action is executed from the process explorer, a config is passed. For all
// other cases it is run with no arguments.
// other cases it is run with no arguments.
public
run
(
config
?:
IConfig
):
Promise
<
any
>
{
public
run
():
Promise
<
any
>
{
if
(
config
&&
'
type
'
in
config
&&
'
request
'
in
config
)
{
return
this
.
debugService
.
startDebugging
(
undefined
,
config
,
this
.
isNoDebug
());
}
const
configurationManager
=
this
.
debugService
.
getConfigurationManager
();
const
configurationManager
=
this
.
debugService
.
getConfigurationManager
();
let
launch
=
configurationManager
.
selectedConfiguration
.
launch
;
let
launch
=
configurationManager
.
selectedConfiguration
.
launch
;
if
(
!
launch
||
launch
.
getConfigurationNames
().
length
===
0
)
{
if
(
!
launch
||
launch
.
getConfigurationNames
().
length
===
0
)
{
...
...
src/vs/workbench/parts/debug/browser/debugCommands.ts
浏览文件 @
2274768d
...
@@ -9,7 +9,7 @@ import { List } from 'vs/base/browser/ui/list/listWidget';
...
@@ -9,7 +9,7 @@ import { List } from 'vs/base/browser/ui/list/listWidget';
import
{
KeybindingsRegistry
,
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
KeybindingsRegistry
,
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
IListService
}
from
'
vs/platform/list/browser/listService
'
;
import
{
IListService
}
from
'
vs/platform/list/browser/listService
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IDebugService
,
IEnablement
,
CONTEXT_BREAKPOINTS_FOCUSED
,
CONTEXT_WATCH_EXPRESSIONS_FOCUSED
,
CONTEXT_VARIABLES_FOCUSED
,
EDITOR_CONTRIBUTION_ID
,
IDebugEditorContribution
,
CONTEXT_IN_DEBUG_MODE
,
CONTEXT_EXPRESSION_SELECTED
,
CONTEXT_BREAKPOINT_SELECTED
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IDebugService
,
IEnablement
,
CONTEXT_BREAKPOINTS_FOCUSED
,
CONTEXT_WATCH_EXPRESSIONS_FOCUSED
,
CONTEXT_VARIABLES_FOCUSED
,
EDITOR_CONTRIBUTION_ID
,
IDebugEditorContribution
,
CONTEXT_IN_DEBUG_MODE
,
CONTEXT_EXPRESSION_SELECTED
,
CONTEXT_BREAKPOINT_SELECTED
,
IConfig
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Expression
,
Variable
,
Breakpoint
,
FunctionBreakpoint
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
import
{
Expression
,
Variable
,
Breakpoint
,
FunctionBreakpoint
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
import
{
IExtensionsViewlet
,
VIEWLET_ID
as
EXTENSIONS_VIEWLET_ID
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
IExtensionsViewlet
,
VIEWLET_ID
as
EXTENSIONS_VIEWLET_ID
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
...
@@ -23,12 +23,22 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
...
@@ -23,12 +23,22 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import
{
InputFocusedContext
}
from
'
vs/platform/workbench/common/contextkeys
'
;
import
{
InputFocusedContext
}
from
'
vs/platform/workbench/common/contextkeys
'
;
import
{
ServicesAccessor
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
ServicesAccessor
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
PanelFocusContext
}
from
'
vs/workbench/browser/parts/panel/panelPart
'
;
import
{
PanelFocusContext
}
from
'
vs/workbench/browser/parts/panel/panelPart
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
export
const
ADD_CONFIGURATION_ID
=
'
debug.addConfiguration
'
;
export
const
ADD_CONFIGURATION_ID
=
'
debug.addConfiguration
'
;
export
const
TOGGLE_INLINE_BREAKPOINT_ID
=
'
editor.debug.action.toggleInlineBreakpoint
'
;
export
const
TOGGLE_INLINE_BREAKPOINT_ID
=
'
editor.debug.action.toggleInlineBreakpoint
'
;
export
function
registerCommands
():
void
{
export
function
registerCommands
():
void
{
CommandsRegistry
.
registerCommand
({
id
:
'
debug.startFromConfig
'
,
handler
:
(
accessor
,
config
:
IConfig
)
=>
{
const
debugService
=
accessor
.
get
(
IDebugService
);
debugService
.
startDebugging
(
undefined
,
config
).
then
(
undefined
,
onUnexpectedError
);
}
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
debug.toggleBreakpoint
'
,
id
:
'
debug.toggleBreakpoint
'
,
weight
:
KeybindingWeight
.
WorkbenchContrib
+
5
,
weight
:
KeybindingWeight
.
WorkbenchContrib
+
5
,
...
...
src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts
浏览文件 @
2274768d
...
@@ -10,7 +10,7 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
...
@@ -10,7 +10,7 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import
{
SyncActionDescriptor
,
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
SyncActionDescriptor
,
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
KeybindingWeight
,
IKeybindings
,
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
KeybindingWeight
,
IKeybindings
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
as
WorkbenchActionRegistryExtensions
}
from
'
vs/workbench/common/actions
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
as
WorkbenchActionRegistryExtensions
}
from
'
vs/workbench/common/actions
'
;
import
{
ShowViewletAction
,
Extensions
as
ViewletExtensions
,
ViewletRegistry
,
ViewletDescriptor
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
ShowViewletAction
,
Extensions
as
ViewletExtensions
,
ViewletRegistry
,
ViewletDescriptor
}
from
'
vs/workbench/browser/viewlet
'
;
...
@@ -49,13 +49,11 @@ import { DebugViewlet } from 'vs/workbench/parts/debug/browser/debugViewlet';
...
@@ -49,13 +49,11 @@ import { DebugViewlet } from 'vs/workbench/parts/debug/browser/debugViewlet';
import
{
Repl
,
ClearReplAction
}
from
'
vs/workbench/parts/debug/electron-browser/repl
'
;
import
{
Repl
,
ClearReplAction
}
from
'
vs/workbench/parts/debug/electron-browser/repl
'
;
import
{
DebugQuickOpenHandler
}
from
'
vs/workbench/parts/debug/browser/debugQuickOpen
'
;
import
{
DebugQuickOpenHandler
}
from
'
vs/workbench/parts/debug/browser/debugQuickOpen
'
;
import
{
DebugStatus
}
from
'
vs/workbench/parts/debug/browser/debugStatus
'
;
import
{
DebugStatus
}
from
'
vs/workbench/parts/debug/browser/debugStatus
'
;
import
{
LifecyclePhase
,
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
launchSchemaId
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
launchSchemaId
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
import
{
LoadedScriptsView
}
from
'
vs/workbench/parts/debug/browser/loadedScriptsView
'
;
import
{
LoadedScriptsView
}
from
'
vs/workbench/parts/debug/browser/loadedScriptsView
'
;
import
{
TOGGLE_LOG_POINT_ID
,
TOGGLE_CONDITIONAL_BREAKPOINT_ID
,
TOGGLE_BREAKPOINT_ID
}
from
'
vs/workbench/parts/debug/browser/debugEditorActions
'
;
import
{
TOGGLE_LOG_POINT_ID
,
TOGGLE_CONDITIONAL_BREAKPOINT_ID
,
TOGGLE_BREAKPOINT_ID
}
from
'
vs/workbench/parts/debug/browser/debugEditorActions
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
class
OpenDebugViewletAction
extends
ShowViewletAction
{
class
OpenDebugViewletAction
extends
ShowViewletAction
{
public
static
readonly
ID
=
VIEWLET_ID
;
public
static
readonly
ID
=
VIEWLET_ID
;
...
@@ -132,58 +130,7 @@ Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).regi
...
@@ -132,58 +130,7 @@ Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).regi
const
debugCategory
=
nls
.
localize
(
'
debugCategory
'
,
"
Debug
"
);
const
debugCategory
=
nls
.
localize
(
'
debugCategory
'
,
"
Debug
"
);
const
startDebugDescriptor
=
new
SyncActionDescriptor
(
StartAction
,
StartAction
.
ID
,
StartAction
.
LABEL
,
{
primary
:
KeyCode
.
F5
},
CONTEXT_IN_DEBUG_MODE
.
toNegated
());
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
StartAction
,
StartAction
.
ID
,
StartAction
.
LABEL
,
{
primary
:
KeyCode
.
F5
}),
'
Debug: Start Debugging
'
,
debugCategory
);
function
startDebugHandler
(
accessor
,
args
):
Promise
<
void
>
{
const
notificationService
=
accessor
.
get
(
INotificationService
);
const
instantiationService
=
accessor
.
get
(
IInstantiationService
);
const
lifecycleService
=
accessor
.
get
(
ILifecycleService
);
return
Promise
.
resolve
(
lifecycleService
.
when
(
LifecyclePhase
.
Ready
).
then
(()
=>
{
const
actionInstance
=
instantiationService
.
createInstance
(
startDebugDescriptor
.
syncDescriptor
);
try
{
// don't run the action when not enabled
if
(
!
actionInstance
.
enabled
)
{
actionInstance
.
dispose
();
return
void
0
;
}
const
from
=
args
&&
args
.
from
||
'
keybinding
'
;
if
(
args
)
{
delete
args
.
from
;
}
return
Promise
.
resolve
(
actionInstance
.
run
(
args
,
{
from
})).
then
(()
=>
{
actionInstance
.
dispose
();
},
err
=>
{
actionInstance
.
dispose
();
return
Promise
.
reject
(
err
);
});
}
catch
(
err
)
{
actionInstance
.
dispose
();
return
Promise
.
reject
(
err
);
}
})).
then
(
void
0
,
err
=>
notificationService
.
error
(
err
));
}
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
StartAction
.
ID
,
weight
:
KeybindingWeight
.
WorkbenchContrib
,
when
:
CONTEXT_IN_DEBUG_MODE
.
toNegated
(),
primary
:
KeyCode
.
F5
,
handler
:
startDebugHandler
});
MenuRegistry
.
addCommand
({
id
:
StartAction
.
ID
,
title
:
StartAction
.
LABEL
,
category
:
debugCategory
});
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
StepOverAction
,
StepOverAction
.
ID
,
StepOverAction
.
LABEL
,
{
primary
:
KeyCode
.
F10
},
CONTEXT_IN_DEBUG_MODE
),
'
Debug: Step Over
'
,
debugCategory
);
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
StepOverAction
,
StepOverAction
.
ID
,
StepOverAction
.
LABEL
,
{
primary
:
KeyCode
.
F10
},
CONTEXT_IN_DEBUG_MODE
),
'
Debug: Step Over
'
,
debugCategory
);
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
StepIntoAction
,
StepIntoAction
.
ID
,
StepIntoAction
.
LABEL
,
{
primary
:
KeyCode
.
F11
},
CONTEXT_IN_DEBUG_MODE
,
KeybindingWeight
.
WorkbenchContrib
+
1
),
'
Debug: Step Into
'
,
debugCategory
);
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
StepIntoAction
,
StepIntoAction
.
ID
,
StepIntoAction
.
LABEL
,
{
primary
:
KeyCode
.
F11
},
CONTEXT_IN_DEBUG_MODE
,
KeybindingWeight
.
WorkbenchContrib
+
1
),
'
Debug: Step Into
'
,
debugCategory
);
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
StepOutAction
,
StepOutAction
.
ID
,
StepOutAction
.
LABEL
,
{
primary
:
KeyMod
.
Shift
|
KeyCode
.
F11
},
CONTEXT_IN_DEBUG_MODE
),
'
Debug: Step Out
'
,
debugCategory
);
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
StepOutAction
,
StepOutAction
.
ID
,
StepOutAction
.
LABEL
,
{
primary
:
KeyMod
.
Shift
|
KeyCode
.
F11
},
CONTEXT_IN_DEBUG_MODE
),
'
Debug: Step Out
'
,
debugCategory
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录