Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
35fe5974
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,发现更多精彩内容 >>
提交
35fe5974
编写于
5月 08, 2020
作者:
J
jeanp413
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #96567
上级
306235b1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
5 deletion
+26
-5
src/vs/workbench/contrib/debug/browser/debugActions.ts
src/vs/workbench/contrib/debug/browser/debugActions.ts
+1
-1
src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts
...kbench/contrib/debug/browser/debugConfigurationManager.ts
+25
-4
未找到文件。
src/vs/workbench/contrib/debug/browser/debugActions.ts
浏览文件 @
35fe5974
...
...
@@ -92,7 +92,7 @@ export class ConfigureAction extends AbstractDebugAction {
if
(
configurationManager
.
selectedConfiguration
.
name
)
{
launch
=
configurationManager
.
selectedConfiguration
.
launch
;
}
else
{
const
launches
=
configurationManager
.
getLaunches
().
filter
(
l
=>
!
!
l
.
workspace
);
const
launches
=
configurationManager
.
getLaunches
().
filter
(
l
=>
!
l
.
hidden
);
if
(
launches
.
length
===
1
)
{
launch
=
launches
[
0
];
}
else
{
...
...
src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts
浏览文件 @
35fe5974
...
...
@@ -8,6 +8,7 @@ import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
*
as
json
from
'
vs/base/common/json
'
;
import
{
URI
as
uri
}
from
'
vs/base/common/uri
'
;
import
*
as
resources
from
'
vs/base/common/resources
'
;
import
{
IJSONSchema
}
from
'
vs/base/common/jsonSchema
'
;
...
...
@@ -15,7 +16,7 @@ import { ITextModel } from 'vs/editor/common/model';
import
{
IEditorPane
}
from
'
vs/workbench/common/editor
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IWorkspaceContextService
,
IWorkspaceFolder
,
WorkbenchState
,
IWorkspaceFoldersChangeEvent
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -385,7 +386,7 @@ export class ConfigurationManager implements IConfigurationManager {
private
initLaunches
():
void
{
this
.
launches
=
this
.
contextService
.
getWorkspace
().
folders
.
map
(
folder
=>
this
.
instantiationService
.
createInstance
(
Launch
,
this
,
folder
));
if
(
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
WORKSPACE
)
{
this
.
launches
.
push
(
this
.
instantiationService
.
createInstance
(
WorkspaceLaunch
));
this
.
launches
.
push
(
this
.
instantiationService
.
createInstance
(
WorkspaceLaunch
,
this
));
}
this
.
launches
.
push
(
this
.
instantiationService
.
createInstance
(
UserLaunch
));
...
...
@@ -692,6 +693,7 @@ class Launch extends AbstractLaunch implements ILaunch {
class
WorkspaceLaunch
extends
AbstractLaunch
implements
ILaunch
{
constructor
(
private
configurationManager
:
ConfigurationManager
,
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IWorkspaceContextService
private
readonly
contextService
:
IWorkspaceContextService
...
...
@@ -715,10 +717,29 @@ class WorkspaceLaunch extends AbstractLaunch implements ILaunch {
return
this
.
configurationService
.
inspect
<
IGlobalConfig
>
(
'
launch
'
).
workspaceValue
;
}
async
openConfigFile
(
sideBySide
:
boolean
,
preserveFocus
:
boolean
):
Promise
<
{
editor
:
IEditorPane
|
null
,
created
:
boolean
}
>
{
async
openConfigFile
(
sideBySide
:
boolean
,
preserveFocus
:
boolean
,
type
?:
string
,
token
?:
CancellationToken
):
Promise
<
{
editor
:
IEditorPane
|
null
,
created
:
boolean
}
>
{
const
ws
=
this
.
contextService
.
getWorkspace
();
if
(
ws
.
folders
.
length
===
0
)
{
return
{
editor
:
null
,
created
:
false
};
}
let
launchExistInFile
=
!!
this
.
getConfig
();
if
(
!
launchExistInFile
)
{
// Launch property in workspace config not found: create one by collecting launch configs from debugConfigProviders
let
content
=
''
;
const
adapter
=
await
this
.
configurationManager
.
guessDebugger
(
type
);
if
(
adapter
)
{
const
initialConfigs
=
await
this
.
configurationManager
.
provideDebugConfigurations
(
undefined
,
adapter
.
type
,
token
||
CancellationToken
.
None
);
content
=
await
adapter
.
getInitialConfigurationContent
(
initialConfigs
);
}
if
(
content
)
{
await
this
.
configurationService
.
updateValue
(
'
launch
'
,
json
.
parse
(
content
),
ConfigurationTarget
.
WORKSPACE
);
}
}
const
editor
=
await
this
.
editorService
.
openEditor
({
resource
:
this
.
contextService
.
getWorkspace
()
.
configuration
!
,
resource
:
ws
.
configuration
!
,
options
:
{
preserveFocus
}
},
sideBySide
?
SIDE_GROUP
:
ACTIVE_GROUP
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录