Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ae2a4a7f
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,发现更多精彩内容 >>
提交
ae2a4a7f
编写于
1月 30, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: introduce UserLaunch
fixes #42467
上级
1d69e7ac
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
56 addition
and
7 deletion
+56
-7
src/vs/workbench/parts/debug/browser/debugActionItems.ts
src/vs/workbench/parts/debug/browser/debugActionItems.ts
+6
-3
src/vs/workbench/parts/debug/browser/debugQuickOpen.ts
src/vs/workbench/parts/debug/browser/debugQuickOpen.ts
+3
-2
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+5
-0
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
...parts/debug/electron-browser/debugConfigurationManager.ts
+42
-2
未找到文件。
src/vs/workbench/parts/debug/browser/debugActionItems.ts
浏览文件 @
ae2a4a7f
...
...
@@ -20,6 +20,7 @@ import { attachSelectBoxStyler, attachStylerCallback } from 'vs/platform/theme/c
import
{
SIDE_BAR_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
selectBorder
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
const
$
=
dom
.
$
;
...
...
@@ -42,6 +43,7 @@ export class StartDebugActionItem implements IActionItem {
@
IThemeService
private
themeService
:
IThemeService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
ICommandService
private
commandService
:
ICommandService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
IContextViewService
contextViewService
:
IContextViewService
,
)
{
this
.
toDispose
=
[];
...
...
@@ -153,12 +155,13 @@ export class StartDebugActionItem implements IActionItem {
this
.
options
=
[];
const
manager
=
this
.
debugService
.
getConfigurationManager
();
const
launches
=
manager
.
getLaunches
();
const
inWorkspace
=
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
WORKSPACE
;
manager
.
getLaunches
().
forEach
(
launch
=>
launch
.
getConfigurationNames
().
forEach
(
name
=>
{
if
(
name
===
manager
.
selectedName
&&
launch
===
manager
.
selectedLaunch
)
{
this
.
selected
=
this
.
options
.
length
;
}
const
label
=
launches
.
length
>
1
?
`
${
name
}
(
${
launch
.
name
}
)`
:
name
;
const
label
=
inWorkspace
?
`
${
name
}
(
${
launch
.
name
}
)`
:
name
;
this
.
options
.
push
({
label
,
handler
:
()
=>
{
manager
.
selectConfiguration
(
launch
,
name
);
return
true
;
}
});
}));
...
...
@@ -168,8 +171,8 @@ export class StartDebugActionItem implements IActionItem {
this
.
options
.
push
({
label
:
StartDebugActionItem
.
SEPARATOR
,
handler
:
undefined
});
const
disabledIdx
=
this
.
options
.
length
-
1
;
launches
.
forEach
(
l
=>
{
const
label
=
launches
.
length
>
1
?
nls
.
localize
(
"
addConfigTo
"
,
"
Add Config ({0})...
"
,
l
.
name
)
:
nls
.
localize
(
'
addConfiguration
'
,
"
Add Configuration...
"
);
launches
.
f
ilter
(
l
=>
!
l
.
hidden
).
f
orEach
(
l
=>
{
const
label
=
inWorkspace
?
nls
.
localize
(
"
addConfigTo
"
,
"
Add Config ({0})...
"
,
l
.
name
)
:
nls
.
localize
(
'
addConfiguration
'
,
"
Add Configuration...
"
);
this
.
options
.
push
({
label
,
handler
:
()
=>
{
this
.
commandService
.
executeCommand
(
'
debug.addConfiguration
'
,
l
.
uri
.
toString
()).
done
(
undefined
,
errors
.
onUnexpectedError
);
...
...
src/vs/workbench/parts/debug/browser/debugQuickOpen.ts
浏览文件 @
ae2a4a7f
...
...
@@ -109,8 +109,9 @@ export class DebugQuickOpenHandler extends Quickopen.QuickOpenHandler {
configurations
.
push
(
new
StartDebugEntry
(
this
.
debugService
,
this
.
contextService
,
this
.
messageService
,
launch
,
config
,
highlights
));
});
}
launches
.
forEach
((
l
,
index
)
=>
{
const
label
=
launches
.
length
>
1
?
nls
.
localize
(
"
addConfigTo
"
,
"
Add Config ({0})...
"
,
l
.
name
)
:
nls
.
localize
(
'
addConfiguration
'
,
"
Add Configuration...
"
);
launches
.
filter
(
l
=>
!
l
.
hidden
).
forEach
((
l
,
index
)
=>
{
const
label
=
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
WORKSPACE
?
nls
.
localize
(
"
addConfigTo
"
,
"
Add Config ({0})...
"
,
l
.
name
)
:
nls
.
localize
(
'
addConfiguration
'
,
"
Add Configuration...
"
);
const
entry
=
new
AddConfigEntry
(
label
,
l
,
this
.
commandService
,
this
.
contextService
,
Filters
.
matchesContiguousSubString
(
input
,
label
));
if
(
index
===
0
)
{
configurations
.
push
(
new
QuickOpenEntryGroup
(
entry
,
undefined
,
true
));
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
ae2a4a7f
...
...
@@ -448,6 +448,11 @@ export interface ILaunch {
workspace
:
IWorkspaceFolder
;
/**
* Should this launch be shown in the debug dropdown.
*/
hidden
:
boolean
;
/**
* Returns a configuration with the specified name.
* Returns null if there is no configuration with the specified name.
...
...
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
浏览文件 @
ae2a4a7f
...
...
@@ -34,6 +34,7 @@ import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
isCodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
launchSchemaId
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
IPreferencesService
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
// debuggers extension point
export
const
debuggersExtPoint
=
extensionsRegistry
.
ExtensionsRegistry
.
registerExtensionPoint
<
IRawAdapter
[]
>
(
'
debuggers
'
,
[],
{
...
...
@@ -362,6 +363,7 @@ export class ConfigurationManager implements IConfigurationManager {
private
initLaunches
():
void
{
this
.
launches
=
this
.
contextService
.
getWorkspace
().
folders
.
map
(
folder
=>
this
.
instantiationService
.
createInstance
(
Launch
,
this
,
folder
));
this
.
launches
.
push
(
this
.
instantiationService
.
createInstance
(
UserLaunch
,
this
));
if
(
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
WORKSPACE
)
{
this
.
launches
.
push
(
this
.
instantiationService
.
createInstance
(
WorkspaceLaunch
,
this
));
}
...
...
@@ -520,8 +522,12 @@ class Launch implements ILaunch {
return
this
.
workspace
.
name
;
}
public
get
hidden
():
boolean
{
return
false
;
}
protected
getConfig
():
IGlobalConfig
{
return
this
.
configurationService
.
getValue
<
IGlobalConfig
>
(
'
launch
'
,
{
resource
:
this
.
workspace
.
uri
})
;
return
this
.
configurationService
.
inspect
<
IGlobalConfig
>
(
'
launch
'
,
{
resource
:
this
.
workspace
.
uri
}).
workspaceFolder
;
}
public
getCompound
(
name
:
string
):
ICompound
{
...
...
@@ -539,7 +545,7 @@ class Launch implements ILaunch {
return
[];
}
else
{
const
names
=
config
.
configurations
.
filter
(
cfg
=>
cfg
&&
typeof
cfg
.
name
===
'
string
'
).
map
(
cfg
=>
cfg
.
name
);
if
(
includeCompounds
&&
names
.
length
>
0
&&
config
.
compounds
)
{
if
(
includeCompounds
&&
config
.
compounds
)
{
if
(
config
.
compounds
)
{
names
.
push
(...
config
.
compounds
.
filter
(
compound
=>
typeof
compound
.
name
===
'
string
'
&&
compound
.
configurations
&&
compound
.
configurations
.
length
)
.
map
(
compound
=>
compound
.
name
));
...
...
@@ -668,3 +674,37 @@ class WorkspaceLaunch extends Launch implements ILaunch {
return
this
.
editorService
.
openEditor
({
resource
:
this
.
workspaceContextService
.
getWorkspace
().
configuration
});
}
}
class
UserLaunch
extends
Launch
implements
ILaunch
{
constructor
(
configurationManager
:
ConfigurationManager
,
@
IFileService
fileService
:
IFileService
,
@
IWorkbenchEditorService
editorService
:
IWorkbenchEditorService
,
@
IConfigurationService
configurationService
:
IConfigurationService
,
@
IConfigurationResolverService
configurationResolverService
:
IConfigurationResolverService
,
@
IPreferencesService
private
preferencesService
:
IPreferencesService
)
{
super
(
configurationManager
,
undefined
,
fileService
,
editorService
,
configurationService
,
configurationResolverService
);
}
get
uri
():
uri
{
return
this
.
preferencesService
.
userSettingsResource
;
}
get
name
():
string
{
return
nls
.
localize
(
'
user settings
'
,
"
user settings
"
);
}
public
get
hidden
():
boolean
{
return
true
;
}
protected
getConfig
():
IGlobalConfig
{
return
this
.
configurationService
.
inspect
<
IGlobalConfig
>
(
'
launch
'
).
user
;
}
openConfigFile
(
sideBySide
:
boolean
,
type
?:
string
):
TPromise
<
IEditor
>
{
return
this
.
preferencesService
.
openGlobalSettings
();
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录