Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
5fad95f5
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5fad95f5
编写于
2月 05, 2020
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change getDefaultShellAndArgs to use promises
Part of #75793
上级
1aefcce7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
14 addition
and
13 deletion
+14
-13
src/vs/workbench/api/browser/mainThreadTerminalService.ts
src/vs/workbench/api/browser/mainThreadTerminalService.ts
+5
-4
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+1
-1
src/vs/workbench/api/common/extHostTerminalService.ts
src/vs/workbench/api/common/extHostTerminalService.ts
+2
-2
src/vs/workbench/api/node/extHostTask.ts
src/vs/workbench/api/node/extHostTask.ts
+1
-1
src/vs/workbench/api/node/extHostTerminalService.ts
src/vs/workbench/api/node/extHostTerminalService.ts
+3
-3
src/vs/workbench/contrib/terminal/browser/terminalService.ts
src/vs/workbench/contrib/terminal/browser/terminalService.ts
+1
-1
src/vs/workbench/contrib/terminal/common/terminal.ts
src/vs/workbench/contrib/terminal/common/terminal.ts
+1
-1
未找到文件。
src/vs/workbench/api/browser/mainThreadTerminalService.ts
浏览文件 @
5fad95f5
...
@@ -309,15 +309,16 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
...
@@ -309,15 +309,16 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
return
true
;
return
true
;
}
}
private
async
_onRequestAvailableShells
(
callback
:
IAvailableShellsRequest
):
Promise
<
void
>
{
private
async
_onRequestAvailableShells
(
req
:
IAvailableShellsRequest
):
Promise
<
void
>
{
if
(
this
.
_isPrimaryExtHost
())
{
if
(
this
.
_isPrimaryExtHost
())
{
callback
(
await
this
.
_proxy
.
$getAvailableShells
());
req
.
callback
(
await
this
.
_proxy
.
$getAvailableShells
());
}
}
}
}
private
_onRequestDefaultShellAndArgs
(
request
:
IDefaultShellAndArgsRequest
):
void
{
private
async
_onRequestDefaultShellAndArgs
(
req
:
IDefaultShellAndArgsRequest
):
Promise
<
void
>
{
if
(
this
.
_isPrimaryExtHost
())
{
if
(
this
.
_isPrimaryExtHost
())
{
this
.
_proxy
.
$requestDefaultShellAndArgs
(
request
.
useAutomationShell
).
then
(
e
=>
request
.
callback
(
e
.
shell
,
e
.
args
));
const
res
=
await
this
.
_proxy
.
$getDefaultShellAndArgs
(
req
.
useAutomationShell
);
req
.
callback
(
res
.
shell
,
res
.
args
);
}
}
}
}
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
5fad95f5
...
@@ -1288,7 +1288,7 @@ export interface ExtHostTerminalServiceShape {
...
@@ -1288,7 +1288,7 @@ export interface ExtHostTerminalServiceShape {
$acceptProcessRequestLatency
(
id
:
number
):
number
;
$acceptProcessRequestLatency
(
id
:
number
):
number
;
$acceptWorkspacePermissionsChanged
(
isAllowed
:
boolean
):
void
;
$acceptWorkspacePermissionsChanged
(
isAllowed
:
boolean
):
void
;
$getAvailableShells
():
Promise
<
IShellDefinitionDto
[]
>
;
$getAvailableShells
():
Promise
<
IShellDefinitionDto
[]
>
;
$
reques
tDefaultShellAndArgs
(
useAutomationShell
:
boolean
):
Promise
<
IShellAndArgsDto
>
;
$
ge
tDefaultShellAndArgs
(
useAutomationShell
:
boolean
):
Promise
<
IShellAndArgsDto
>
;
}
}
export
interface
ExtHostSCMShape
{
export
interface
ExtHostSCMShape
{
...
...
src/vs/workbench/api/common/extHostTerminalService.ts
浏览文件 @
5fad95f5
...
@@ -326,7 +326,7 @@ export abstract class BaseExtHostTerminalService implements IExtHostTerminalServ
...
@@ -326,7 +326,7 @@ export abstract class BaseExtHostTerminalService implements IExtHostTerminalServ
public
abstract
getDefaultShellArgs
(
useAutomationShell
:
boolean
,
configProvider
:
ExtHostConfigProvider
):
string
[]
|
string
;
public
abstract
getDefaultShellArgs
(
useAutomationShell
:
boolean
,
configProvider
:
ExtHostConfigProvider
):
string
[]
|
string
;
public
abstract
$spawnExtHostProcess
(
id
:
number
,
shellLaunchConfigDto
:
IShellLaunchConfigDto
,
activeWorkspaceRootUriComponents
:
UriComponents
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
Promise
<
void
>
;
public
abstract
$spawnExtHostProcess
(
id
:
number
,
shellLaunchConfigDto
:
IShellLaunchConfigDto
,
activeWorkspaceRootUriComponents
:
UriComponents
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
Promise
<
void
>
;
public
abstract
$getAvailableShells
():
Promise
<
IShellDefinitionDto
[]
>
;
public
abstract
$getAvailableShells
():
Promise
<
IShellDefinitionDto
[]
>
;
public
abstract
$
reques
tDefaultShellAndArgs
(
useAutomationShell
:
boolean
):
Promise
<
IShellAndArgsDto
>
;
public
abstract
$
ge
tDefaultShellAndArgs
(
useAutomationShell
:
boolean
):
Promise
<
IShellAndArgsDto
>
;
public
abstract
$acceptWorkspacePermissionsChanged
(
isAllowed
:
boolean
):
void
;
public
abstract
$acceptWorkspacePermissionsChanged
(
isAllowed
:
boolean
):
void
;
public
createExtensionTerminal
(
options
:
vscode
.
ExtensionTerminalOptions
):
vscode
.
Terminal
{
public
createExtensionTerminal
(
options
:
vscode
.
ExtensionTerminalOptions
):
vscode
.
Terminal
{
...
@@ -610,7 +610,7 @@ export class WorkerExtHostTerminalService extends BaseExtHostTerminalService {
...
@@ -610,7 +610,7 @@ export class WorkerExtHostTerminalService extends BaseExtHostTerminalService {
throw
new
Error
(
'
Not implemented
'
);
throw
new
Error
(
'
Not implemented
'
);
}
}
public
async
$
reques
tDefaultShellAndArgs
(
useAutomationShell
:
boolean
):
Promise
<
IShellAndArgsDto
>
{
public
async
$
ge
tDefaultShellAndArgs
(
useAutomationShell
:
boolean
):
Promise
<
IShellAndArgsDto
>
{
throw
new
Error
(
'
Not implemented
'
);
throw
new
Error
(
'
Not implemented
'
);
}
}
...
...
src/vs/workbench/api/node/extHostTask.ts
浏览文件 @
5fad95f5
...
@@ -179,7 +179,7 @@ export class ExtHostTask extends ExtHostTaskBase {
...
@@ -179,7 +179,7 @@ export class ExtHostTask extends ExtHostTaskBase {
}
}
public
$getDefaultShellAndArgs
():
Promise
<
{
shell
:
string
,
args
:
string
[]
|
string
|
undefined
}
>
{
public
$getDefaultShellAndArgs
():
Promise
<
{
shell
:
string
,
args
:
string
[]
|
string
|
undefined
}
>
{
return
this
.
_terminalService
.
$
reques
tDefaultShellAndArgs
(
true
);
return
this
.
_terminalService
.
$
ge
tDefaultShellAndArgs
(
true
);
}
}
public
async
$jsonTasksSupported
():
Promise
<
boolean
>
{
public
async
$jsonTasksSupported
():
Promise
<
boolean
>
{
...
...
src/vs/workbench/api/node/extHostTerminalService.ts
浏览文件 @
5fad95f5
...
@@ -204,12 +204,12 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
...
@@ -204,12 +204,12 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
return
detectAvailableShells
();
return
detectAvailableShells
();
}
}
public
async
$
reques
tDefaultShellAndArgs
(
useAutomationShell
:
boolean
):
Promise
<
IShellAndArgsDto
>
{
public
async
$
ge
tDefaultShellAndArgs
(
useAutomationShell
:
boolean
):
Promise
<
IShellAndArgsDto
>
{
const
configProvider
=
await
this
.
_extHostConfiguration
.
getConfigProvider
();
const
configProvider
=
await
this
.
_extHostConfiguration
.
getConfigProvider
();
return
Promise
.
resolve
(
{
return
{
shell
:
this
.
getDefaultShell
(
useAutomationShell
,
configProvider
),
shell
:
this
.
getDefaultShell
(
useAutomationShell
,
configProvider
),
args
:
this
.
getDefaultShellArgs
(
useAutomationShell
,
configProvider
)
args
:
this
.
getDefaultShellArgs
(
useAutomationShell
,
configProvider
)
}
)
;
};
}
}
public
$acceptWorkspacePermissionsChanged
(
isAllowed
:
boolean
):
void
{
public
$acceptWorkspacePermissionsChanged
(
isAllowed
:
boolean
):
void
{
...
...
src/vs/workbench/contrib/terminal/browser/terminalService.ts
浏览文件 @
5fad95f5
...
@@ -600,7 +600,7 @@ export class TerminalService implements ITerminalService {
...
@@ -600,7 +600,7 @@ export class TerminalService implements ITerminalService {
}
}
private
_detectWindowsShells
():
Promise
<
IShellDefinition
[]
>
{
private
_detectWindowsShells
():
Promise
<
IShellDefinition
[]
>
{
return
new
Promise
(
r
=>
this
.
_onRequestAvailableShells
.
fire
(
r
));
return
new
Promise
(
r
=>
this
.
_onRequestAvailableShells
.
fire
(
{
callback
:
r
}
));
}
}
...
...
src/vs/workbench/contrib/terminal/common/terminal.ts
浏览文件 @
5fad95f5
...
@@ -360,7 +360,7 @@ export interface IStartExtensionTerminalRequest {
...
@@ -360,7 +360,7 @@ export interface IStartExtensionTerminalRequest {
}
}
export
interface
IAvailableShellsRequest
{
export
interface
IAvailableShellsRequest
{
(
shells
:
IShellDefinition
[]):
void
;
callback
:
(
shells
:
IShellDefinition
[])
=>
void
;
}
}
export
interface
IDefaultShellAndArgsRequest
{
export
interface
IDefaultShellAndArgsRequest
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录