Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9cf14183
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,发现更多精彩内容 >>
未验证
提交
9cf14183
编写于
2月 11, 2019
作者:
D
Daniel Imms
提交者:
GitHub
2月 11, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #68415 from Microsoft/tyriar/strict-null-checks
Strict null check more terminal files
上级
1ad850c0
c7f83b2c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
21 deletion
+27
-21
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+2
-0
src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts
...rkbench/api/electron-browser/mainThreadTerminalService.ts
+7
-3
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/contrib/terminal/electron-browser/terminalActions.ts
...ench/contrib/terminal/electron-browser/terminalActions.ts
+17
-17
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
9cf14183
...
...
@@ -413,6 +413,7 @@
"./vs/workbench/api/electron-browser/mainThreadStatusBar.ts"
,
"./vs/workbench/api/electron-browser/mainThreadStorage.ts"
,
"./vs/workbench/api/electron-browser/mainThreadTelemetry.ts"
,
"./vs/workbench/api/electron-browser/mainThreadTerminalService.ts"
,
"./vs/workbench/api/electron-browser/mainThreadUrls.ts"
,
"./vs/workbench/api/electron-browser/mainThreadWindow.ts"
,
"./vs/workbench/api/electron-browser/mainThreadWorkspace.ts"
,
...
...
@@ -635,6 +636,7 @@
"./vs/workbench/contrib/terminal/common/terminalCommands.ts"
,
"./vs/workbench/contrib/terminal/common/terminalMenu.ts"
,
"./vs/workbench/contrib/terminal/common/terminalService.ts"
,
"./vs/workbench/contrib/terminal/electron-browser/terminalActions.ts"
,
"./vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper.ts"
,
"./vs/workbench/contrib/terminal/electron-browser/terminalInstance.ts"
,
"./vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts"
,
...
...
src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts
浏览文件 @
9cf14183
...
...
@@ -37,7 +37,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this
.
_toDispose
.
push
(
terminalService
.
onInstanceProcessIdReady
(
instance
=>
this
.
_onTerminalProcessIdReady
(
instance
)));
this
.
_toDispose
.
push
(
terminalService
.
onInstanceDimensionsChanged
(
instance
=>
this
.
_onInstanceDimensionsChanged
(
instance
)));
this
.
_toDispose
.
push
(
terminalService
.
onInstanceRequestExtHostProcess
(
request
=>
this
.
_onTerminalRequestExtHostProcess
(
request
)));
this
.
_toDispose
.
push
(
terminalService
.
onActiveInstanceChanged
(
instance
=>
this
.
_onActiveTerminalChanged
(
instance
?
instance
.
id
:
undefined
)));
this
.
_toDispose
.
push
(
terminalService
.
onActiveInstanceChanged
(
instance
=>
this
.
_onActiveTerminalChanged
(
instance
?
instance
.
id
:
null
)));
this
.
_toDispose
.
push
(
terminalService
.
onInstanceTitleChanged
(
instance
=>
this
.
_onTitleChanged
(
instance
.
id
,
instance
.
title
)));
// Set initial ext host state
...
...
@@ -90,7 +90,8 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
}
public
$hide
(
terminalId
:
number
):
void
{
if
(
this
.
terminalService
.
getActiveInstance
().
id
===
terminalId
)
{
const
instance
=
this
.
terminalService
.
getActiveInstance
();
if
(
instance
&&
instance
.
id
===
terminalId
)
{
this
.
terminalService
.
hidePanel
();
}
}
...
...
@@ -164,7 +165,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
terminalInstance
.
addDisposable
(
this
.
_terminalOnDidWriteDataListeners
[
terminalId
]);
}
private
_onActiveTerminalChanged
(
terminalId
:
number
|
undefined
):
void
{
private
_onActiveTerminalChanged
(
terminalId
:
number
|
null
):
void
{
this
.
_proxy
.
$acceptActiveTerminalChanged
(
terminalId
);
}
...
...
@@ -195,6 +196,9 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
}
private
_onTerminalProcessIdReady
(
terminalInstance
:
ITerminalInstance
):
void
{
if
(
terminalInstance
.
processId
===
undefined
)
{
return
;
}
this
.
_proxy
.
$acceptTerminalProcessId
(
terminalInstance
.
id
,
terminalInstance
.
processId
);
}
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
9cf14183
...
...
@@ -940,7 +940,7 @@ export interface ShellLaunchConfigDto {
executable
?:
string
;
args
?:
string
[]
|
string
;
cwd
?:
string
|
URI
;
env
?:
{
[
key
:
string
]:
string
};
env
?:
{
[
key
:
string
]:
string
|
null
};
}
export
interface
ExtHostTerminalServiceShape
{
...
...
src/vs/workbench/contrib/terminal/electron-browser/terminalActions.ts
浏览文件 @
9cf14183
...
...
@@ -40,23 +40,23 @@ export const TERMINAL_PICKER_PREFIX = 'term ';
function
getCwdForSplit
(
configHelper
:
ITerminalConfigHelper
,
instance
:
ITerminalInstance
,
folders
?:
IWorkspaceFolder
[],
commandService
?:
ICommandService
):
Promise
<
string
|
URI
>
{
switch
(
configHelper
.
config
.
splitCwd
)
{
case
'
workspaceRoot
'
:
let
pathPromise
:
Promise
<
string
|
URI
>
;
if
(
folders
.
length
===
0
)
{
pathPromise
=
Promise
.
resolve
(
''
);
}
else
if
(
folders
.
length
===
1
)
{
pathPromise
=
Promise
.
resolve
(
folders
[
0
].
uri
);
}
else
if
(
folders
.
length
>
1
)
{
// Only choose a path when there's more than 1 folder
const
options
:
IPickOptions
<
IQuickPickItem
>
=
{
placeHolder
:
nls
.
localize
(
'
workbench.action.terminal.newWorkspacePlaceholder
'
,
"
Select current working directory for new terminal
"
)
};
pathPromise
=
commandService
.
executeCommand
(
PICK_WORKSPACE_FOLDER_COMMAND_ID
,
[
options
]).
then
(
workspace
=>
{
if
(
!
workspace
)
{
// Don't split the instance if the workspace picker was canceled
return
undefined
;
}
return
Promise
.
resolve
(
workspace
.
uri
);
}
);
let
pathPromise
:
Promise
<
string
|
URI
>
=
Promise
.
resolve
(
''
)
;
if
(
folders
!==
undefined
&&
commandService
!==
undefined
)
{
if
(
folders
.
length
===
1
)
{
pathPromise
=
Promise
.
resolve
(
folders
[
0
].
uri
);
}
else
if
(
folders
.
length
>
1
)
{
// Only choose a path when there's more than 1 folder
const
options
:
IPickOptions
<
IQuickPickItem
>
=
{
placeHolder
:
nls
.
localize
(
'
workbench.action.terminal.newWorkspacePlaceholder
'
,
"
Select current working directory for new terminal
"
)
};
pathPromise
=
commandService
.
executeCommand
(
PICK_WORKSPACE_FOLDER_COMMAND_ID
,
[
options
]).
then
(
workspace
=>
{
if
(
!
workspace
)
{
// Don't split the instance if the workspace picker was canceled
return
undefined
;
}
return
Promise
.
resolve
(
workspace
.
uri
);
}
);
}
}
return
pathPromise
;
case
'
initial
'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录