Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9d8d0841
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,发现更多精彩内容 >>
提交
9d8d0841
编写于
7月 25, 2019
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
properly use default terminal for debug; fixes #77110
上级
3b5ee24c
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
40 addition
and
43 deletion
+40
-43
src/vs/workbench/api/browser/mainThreadDebugService.ts
src/vs/workbench/api/browser/mainThreadDebugService.ts
+3
-3
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+2
-2
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+8
-5
src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts
...kbench/contrib/debug/browser/debugConfigurationManager.ts
+3
-3
src/vs/workbench/contrib/debug/common/debug.ts
src/vs/workbench/contrib/debug/common/debug.ts
+2
-9
src/vs/workbench/contrib/debug/common/debugger.ts
src/vs/workbench/contrib/debug/common/debugger.ts
+2
-3
src/vs/workbench/contrib/debug/node/terminals.ts
src/vs/workbench/contrib/debug/node/terminals.ts
+20
-18
未找到文件。
src/vs/workbench/api/browser/mainThreadDebugService.ts
浏览文件 @
9d8d0841
...
...
@@ -5,7 +5,7 @@
import
{
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
URI
as
uri
}
from
'
vs/base/common/uri
'
;
import
{
IDebugService
,
IConfig
,
IDebugConfigurationProvider
,
IBreakpoint
,
IFunctionBreakpoint
,
IBreakpointData
,
I
TerminalSettings
,
I
DebugAdapter
,
IDebugAdapterDescriptorFactory
,
IDebugSession
,
IDebugAdapterFactory
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IDebugService
,
IConfig
,
IDebugConfigurationProvider
,
IBreakpoint
,
IFunctionBreakpoint
,
IBreakpointData
,
IDebugAdapter
,
IDebugAdapterDescriptorFactory
,
IDebugSession
,
IDebugAdapterFactory
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
ExtHostContext
,
ExtHostDebugServiceShape
,
MainThreadDebugServiceShape
,
DebugSessionUUID
,
MainContext
,
IExtHostContext
,
IBreakpointsDeltaDto
,
ISourceMultiBreakpointDto
,
ISourceBreakpointDto
,
IFunctionBreakpointDto
,
IDebugSessionDto
...
...
@@ -71,8 +71,8 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
return
Promise
.
resolve
(
this
.
_proxy
.
$substituteVariables
(
folder
?
folder
.
uri
:
undefined
,
config
));
}
runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSettings
):
Promise
<
number
|
undefined
>
{
return
Promise
.
resolve
(
this
.
_proxy
.
$runInTerminal
(
args
,
config
));
runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
):
Promise
<
number
|
undefined
>
{
return
Promise
.
resolve
(
this
.
_proxy
.
$runInTerminal
(
args
));
}
// RPC methods (MainThreadDebugServiceShape)
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
9d8d0841
...
...
@@ -40,7 +40,7 @@ import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor';
import
*
as
tasks
from
'
vs/workbench/api/common/shared/tasks
'
;
import
{
IRevealOptions
,
ITreeItem
}
from
'
vs/workbench/common/views
'
;
import
*
as
callHierarchy
from
'
vs/workbench/contrib/callHierarchy/common/callHierarchy
'
;
import
{
IAdapterDescriptor
,
IConfig
,
ITerminalSettings
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IAdapterDescriptor
,
IConfig
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
ITextQueryBuilderOptions
}
from
'
vs/workbench/contrib/search/common/queryBuilder
'
;
import
{
ITerminalDimensions
,
IShellLaunchConfig
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
ExtensionActivationError
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
...
...
@@ -1245,7 +1245,7 @@ export type IDebugSessionDto = IDebugSessionFullDto | DebugSessionUUID;
export
interface
ExtHostDebugServiceShape
{
$substituteVariables
(
folder
:
UriComponents
|
undefined
,
config
:
IConfig
):
Promise
<
IConfig
>
;
$runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSettings
):
Promise
<
number
|
undefined
>
;
$runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
):
Promise
<
number
|
undefined
>
;
$startDASession
(
handle
:
number
,
session
:
IDebugSessionDto
):
Promise
<
void
>
;
$stopDASession
(
handle
:
number
):
Promise
<
void
>
;
$sendDAMessage
(
handle
:
number
,
message
:
DebugProtocol
.
ProtocolMessage
):
void
;
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
9d8d0841
...
...
@@ -20,7 +20,7 @@ import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstract
import
{
IExtHostWorkspaceProvider
}
from
'
vs/workbench/api/common/extHostWorkspace
'
;
import
{
ExtHostExtensionService
}
from
'
vs/workbench/api/node/extHostExtensionService
'
;
import
{
ExtHostDocumentsAndEditors
}
from
'
vs/workbench/api/common/extHostDocumentsAndEditors
'
;
import
{
I
TerminalSettings
,
I
DebuggerContribution
,
IConfig
,
IDebugAdapter
,
IDebugAdapterServer
,
IDebugAdapterExecutable
,
IAdapterDescriptor
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IDebuggerContribution
,
IConfig
,
IDebugAdapter
,
IDebugAdapterServer
,
IDebugAdapterExecutable
,
IAdapterDescriptor
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
hasChildProcesses
,
prepareCommand
,
runInExternalTerminal
}
from
'
vs/workbench/contrib/debug/node/terminals
'
;
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
AbstractVariableResolverService
}
from
'
vs/workbench/services/configurationResolver/common/variableResolver
'
;
...
...
@@ -318,7 +318,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
// RPC methods (ExtHostDebugServiceShape)
public
$runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSetting
s
):
Promise
<
number
|
undefined
>
{
public
async
$runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArgument
s
):
Promise
<
number
|
undefined
>
{
if
(
args
.
kind
===
'
integrated
'
)
{
...
...
@@ -350,9 +350,12 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
terminal
.
show
();
return
this
.
_integratedTerminalInstance
.
processId
.
then
(
shellProcessId
=>
{
return
this
.
_integratedTerminalInstance
.
processId
.
then
(
async
shellProcessId
=>
{
const
configProvider
=
await
this
.
_configurationService
.
getConfigProvider
();
const
shell
=
this
.
_terminalService
.
getDefaultShell
(
configProvider
);
const
command
=
prepareCommand
(
args
,
shell
,
configProvider
);
const
command
=
prepareCommand
(
args
,
config
);
terminal
.
sendText
(
command
,
true
);
return
shellProcessId
;
...
...
@@ -361,7 +364,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
}
else
if
(
args
.
kind
===
'
external
'
)
{
runInExternalTerminal
(
args
,
config
);
runInExternalTerminal
(
args
,
await
this
.
_configurationService
.
getConfigProvider
()
);
}
return
Promise
.
resolve
(
undefined
);
}
...
...
src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts
浏览文件 @
9d8d0841
...
...
@@ -21,7 +21,7 @@ import { IFileService } from 'vs/platform/files/common/files';
import
{
IWorkspaceContextService
,
IWorkspaceFolder
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IDebugConfigurationProvider
,
ICompound
,
IDebugConfiguration
,
IConfig
,
IGlobalConfig
,
IConfigurationManager
,
ILaunch
,
IDebugAdapterDescriptorFactory
,
IDebugAdapter
,
I
TerminalSettings
,
I
DebugSession
,
IAdapterDescriptor
,
CONTEXT_DEBUG_CONFIGURATION_TYPE
,
IDebugAdapterFactory
,
IDebugService
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IDebugConfigurationProvider
,
ICompound
,
IDebugConfiguration
,
IConfig
,
IGlobalConfig
,
IConfigurationManager
,
ILaunch
,
IDebugAdapterDescriptorFactory
,
IDebugAdapter
,
IDebugSession
,
IAdapterDescriptor
,
CONTEXT_DEBUG_CONFIGURATION_TYPE
,
IDebugAdapterFactory
,
IDebugService
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
Debugger
}
from
'
vs/workbench/contrib/debug/common/debugger
'
;
import
{
IEditorService
,
ACTIVE_GROUP
,
SIDE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
isCodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
...
...
@@ -108,10 +108,10 @@ export class ConfigurationManager implements IConfigurationManager {
return
Promise
.
resolve
(
config
);
}
runInTerminal
(
debugType
:
string
,
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSettings
):
Promise
<
number
|
undefined
>
{
runInTerminal
(
debugType
:
string
,
args
:
DebugProtocol
.
RunInTerminalRequestArguments
):
Promise
<
number
|
undefined
>
{
let
tl
=
this
.
debugAdapterFactories
.
get
(
debugType
);
if
(
tl
)
{
return
tl
.
runInTerminal
(
args
,
config
);
return
tl
.
runInTerminal
(
args
);
}
return
Promise
.
resolve
(
void
0
);
}
...
...
src/vs/workbench/contrib/debug/common/debug.ts
浏览文件 @
9d8d0841
...
...
@@ -24,9 +24,7 @@ import { IViewContainersRegistry, ViewContainer, Extensions as ViewContainerExte
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
TaskIdentifier
}
from
'
vs/workbench/contrib/tasks/common/tasks
'
;
import
{
TelemetryService
}
from
'
vs/platform/telemetry/common/telemetryService
'
;
import
{
ITerminalConfiguration
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IExternalTerminalSettings
}
from
'
vs/workbench/contrib/externalTerminal/common/externalTerminal
'
;
export
const
VIEWLET_ID
=
'
workbench.view.debug
'
;
export
const
VIEW_CONTAINER
:
ViewContainer
=
Registry
.
as
<
IViewContainersRegistry
>
(
ViewContainerExtensions
.
ViewContainersRegistry
).
registerViewContainer
(
VIEWLET_ID
);
...
...
@@ -573,12 +571,7 @@ export interface IDebugAdapterTrackerFactory {
}
export
interface
ITerminalLauncher
{
runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSettings
):
Promise
<
number
|
undefined
>
;
}
export
interface
ITerminalSettings
{
external
:
IExternalTerminalSettings
;
integrated
:
ITerminalConfiguration
;
runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
):
Promise
<
number
|
undefined
>
;
}
export
interface
IConfigurationManager
{
...
...
@@ -623,7 +616,7 @@ export interface IConfigurationManager {
createDebugAdapter
(
session
:
IDebugSession
):
IDebugAdapter
|
undefined
;
substituteVariables
(
debugType
:
string
,
folder
:
IWorkspaceFolder
|
undefined
,
config
:
IConfig
):
Promise
<
IConfig
>
;
runInTerminal
(
debugType
:
string
,
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSettings
):
Promise
<
number
|
undefined
>
;
runInTerminal
(
debugType
:
string
,
args
:
DebugProtocol
.
RunInTerminalRequestArguments
):
Promise
<
number
|
undefined
>
;
}
export
interface
ILaunch
{
...
...
src/vs/workbench/contrib/debug/common/debugger.ts
浏览文件 @
9d8d0841
...
...
@@ -9,7 +9,7 @@ import * as objects from 'vs/base/common/objects';
import
{
isObject
}
from
'
vs/base/common/types
'
;
import
{
IJSONSchema
,
IJSONSchemaSnippet
}
from
'
vs/base/common/jsonSchema
'
;
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IConfig
,
IDebuggerContribution
,
INTERNAL_CONSOLE_OPTIONS_SCHEMA
,
IConfigurationManager
,
IDebugAdapter
,
I
TerminalSettings
,
I
Debugger
,
IDebugSession
,
IDebugHelperService
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IConfig
,
IDebuggerContribution
,
INTERNAL_CONSOLE_OPTIONS_SCHEMA
,
IConfigurationManager
,
IDebugAdapter
,
IDebugger
,
IDebugSession
,
IDebugHelperService
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
*
as
ConfigurationResolverUtils
from
'
vs/workbench/services/configurationResolver/common/configurationResolverUtils
'
;
...
...
@@ -108,8 +108,7 @@ export class Debugger implements IDebugger {
}
runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
):
Promise
<
number
|
undefined
>
{
const
config
=
this
.
configurationService
.
getValue
<
ITerminalSettings
>
(
'
terminal
'
);
return
this
.
configurationManager
.
runInTerminal
(
this
.
type
,
args
,
config
);
return
this
.
configurationManager
.
runInTerminal
(
this
.
type
,
args
);
}
get
label
():
string
{
...
...
src/vs/workbench/contrib/debug/node/terminals.ts
浏览文件 @
9d8d0841
...
...
@@ -5,15 +5,15 @@
import
*
as
cp
from
'
child_process
'
;
import
*
as
env
from
'
vs/base/common/platform
'
;
import
{
ITerminalSettings
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
getSystemShell
}
from
'
vs/workbench/contrib/terminal/node/terminal
'
;
import
{
WindowsExternalTerminalService
,
MacExternalTerminalService
,
LinuxExternalTerminalService
}
from
'
vs/workbench/contrib/externalTerminal/node/externalTerminalService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IExternalTerminalService
}
from
'
vs/workbench/contrib/externalTerminal/common/externalTerminal
'
;
import
{
ExtHostConfigProvider
}
from
'
vs/workbench/api/common/extHostConfiguration
'
;
let
externalTerminalService
:
IExternalTerminalService
|
undefined
=
undefined
;
export
function
runInExternalTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSettings
):
void
{
export
function
runInExternalTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
Provider
:
ExtHostConfigProvider
):
void
{
if
(
!
externalTerminalService
)
{
if
(
env
.
isWindows
)
{
externalTerminalService
=
new
WindowsExternalTerminalService
(
<
IConfigurationService
><
unknown
>
undefined
);
...
...
@@ -24,6 +24,7 @@ export function runInExternalTerminal(args: DebugProtocol.RunInTerminalRequestAr
}
}
if
(
externalTerminalService
)
{
const
config
=
configProvider
.
getConfiguration
(
'
terminal
'
);
externalTerminalService
.
runInTerminal
(
args
.
title
!
,
args
.
cwd
,
args
.
args
,
args
.
env
||
{},
config
.
external
||
{});
}
}
...
...
@@ -60,25 +61,26 @@ export function hasChildProcesses(processId: number): boolean {
const
enum
ShellType
{
cmd
,
powershell
,
bash
}
export
function
prepareCommand
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSettings
):
string
{
export
function
prepareCommand
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
shell
:
string
,
configProvider
:
ExtHostConfigProvider
):
string
{
let
shellType
:
ShellType
;
let
shellType
=
env
.
isWindows
?
ShellType
.
cmd
:
ShellType
.
bash
;
// pick a good default
if
(
shell
)
{
const
config
=
configProvider
.
getConfiguration
(
'
terminal
'
);
// get the shell configuration for the current platform
let
shell
:
string
;
const
shell_config
=
config
.
integrated
.
shell
;
if
(
env
.
isWindows
)
{
shell
=
shell_config
.
windows
||
getSystemShell
(
env
.
Platform
.
Windows
);
shellType
=
ShellType
.
cmd
;
}
else
if
(
env
.
isLinux
)
{
shell
=
shell_config
.
linux
||
getSystemShell
(
env
.
Platform
.
Linux
);
shellType
=
ShellType
.
bash
;
}
else
if
(
env
.
isMacintosh
)
{
shell
=
shell_config
.
osx
||
getSystemShell
(
env
.
Platform
.
Mac
);
shellType
=
ShellType
.
bash
;
}
else
{
throw
new
Error
(
'
Unknown platform
'
);
}
}
// try to determine the shell type
shell
=
shell
.
trim
().
toLowerCase
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录