Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
619f3201
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,体验更适合开发者的 AI 搜索 >>
提交
619f3201
编写于
3月 19, 2019
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
waitMarkerFilePath to URI
上级
0f8db6ff
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
35 addition
and
8 deletion
+35
-8
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+1
-1
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+2
-1
src/vs/workbench/contrib/terminal/common/terminalService.ts
src/vs/workbench/contrib/terminal/common/terminalService.ts
+1
-1
src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts
...ench/contrib/terminal/electron-browser/terminalService.ts
+24
-2
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+5
-1
src/vs/workbench/electron-browser/window.ts
src/vs/workbench/electron-browser/window.ts
+2
-2
未找到文件。
src/vs/code/electron-main/windows.ts
浏览文件 @
619f3201
...
...
@@ -422,7 +422,7 @@ export class WindowsManager implements IWindowsMainService {
// When run with --wait, make sure we keep the paths to wait for
if
(
fileInputs
&&
openConfig
.
cli
.
wait
&&
openConfig
.
cli
.
waitMarkerFilePath
)
{
fileInputs
.
filesToWait
=
{
paths
:
[...
fileInputs
.
filesToDiff
,
...
fileInputs
.
filesToOpen
,
...
fileInputs
.
filesToCreate
],
waitMarkerFile
Path
:
openConfig
.
cli
.
waitMarkerFilePath
};
fileInputs
.
filesToWait
=
{
paths
:
[...
fileInputs
.
filesToDiff
,
...
fileInputs
.
filesToOpen
,
...
fileInputs
.
filesToCreate
],
waitMarkerFile
Uri
:
URI
.
file
(
openConfig
.
cli
.
waitMarkerFilePath
)
};
}
//
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
619f3201
...
...
@@ -338,11 +338,12 @@ export interface IPath extends IPathData {
export
interface
IPathsToWaitFor
extends
IPathsToWaitForData
{
paths
:
IPath
[];
waitMarkerFileUri
:
URI
;
}
export
interface
IPathsToWaitForData
{
paths
:
IPathData
[];
waitMarkerFile
Path
:
string
;
waitMarkerFile
Uri
:
UriComponents
;
}
export
interface
IPathData
{
...
...
src/vs/workbench/contrib/terminal/common/terminalService.ts
浏览文件 @
619f3201
...
...
@@ -70,7 +70,7 @@ export abstract class TerminalService implements ITerminalService {
@
INotificationService
protected
readonly
_notificationService
:
INotificationService
,
@
IDialogService
private
readonly
_dialogService
:
IDialogService
,
@
IExtensionService
private
readonly
_extensionService
:
IExtensionService
,
@
IFileService
pr
ivate
readonly
_fileService
:
IFileService
@
IFileService
pr
otected
readonly
_fileService
:
IFileService
)
{
this
.
_activeTabIndex
=
0
;
this
.
_isShuttingDown
=
false
;
...
...
src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts
浏览文件 @
619f3201
...
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
pfs
from
'
vs/base/node/pfs
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -27,6 +26,7 @@ import { coalesce } from 'vs/base/common/arrays';
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
escapeNonWindowsPath
}
from
'
vs/workbench/contrib/terminal/common/terminalEnvironment
'
;
import
{
execFile
}
from
'
child_process
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
export
class
TerminalService
extends
BrowserTerminalService
implements
ITerminalService
{
public
get
configHelper
():
ITerminalConfigHelper
{
return
this
.
_configHelper
;
}
...
...
@@ -54,7 +54,8 @@ export class TerminalService extends BrowserTerminalService implements ITerminal
// the termProgram variable) and we are instructed to wait for editors close, wait for the
// marker file to get deleted and then focus back to the integrated terminal.
if
(
request
.
termProgram
===
'
vscode
'
&&
request
.
filesToWait
)
{
pfs
.
whenDeleted
(
request
.
filesToWait
.
waitMarkerFilePath
).
then
(()
=>
{
const
waitMarkerFileUri
=
URI
.
revive
(
request
.
filesToWait
.
waitMarkerFileUri
);
this
.
whenDeleted
(
waitMarkerFileUri
).
then
(()
=>
{
if
(
this
.
terminalInstances
.
length
>
0
)
{
const
terminal
=
this
.
getActiveInstance
();
if
(
terminal
)
{
...
...
@@ -73,6 +74,27 @@ export class TerminalService extends BrowserTerminalService implements ITerminal
});
}
private
whenDeleted
(
path
:
URI
):
Promise
<
void
>
{
// Complete when wait marker file is deleted
return
new
Promise
<
void
>
(
resolve
=>
{
let
running
=
false
;
const
interval
=
setInterval
(()
=>
{
if
(
!
running
)
{
running
=
true
;
this
.
_fileService
.
existsFile
(
path
).
then
(
exists
=>
{
running
=
false
;
if
(
!
exists
)
{
clearInterval
(
interval
);
resolve
(
undefined
);
}
});
}
},
1000
);
});
}
protected
_getDefaultShell
(
p
:
platform
.
Platform
):
string
{
return
getDefaultShell
(
p
);
}
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
619f3201
...
...
@@ -78,7 +78,8 @@ class CodeRendererMain extends Disposable {
this
.
configuration
.
workspace
=
reviveWorkspaceIdentifier
(
this
.
configuration
.
workspace
);
}
const
filesToWaitPaths
=
this
.
configuration
.
filesToWait
&&
this
.
configuration
.
filesToWait
.
paths
;
const
filesToWait
=
this
.
configuration
.
filesToWait
;
const
filesToWaitPaths
=
filesToWait
&&
filesToWait
.
paths
;
[
filesToWaitPaths
,
this
.
configuration
.
filesToOpen
,
this
.
configuration
.
filesToCreate
,
this
.
configuration
.
filesToDiff
].
forEach
(
paths
=>
{
if
(
Array
.
isArray
(
paths
))
{
paths
.
forEach
(
path
=>
{
...
...
@@ -88,6 +89,9 @@ class CodeRendererMain extends Disposable {
});
}
});
if
(
filesToWait
)
{
filesToWait
.
waitMarkerFileUri
=
uri
.
revive
(
filesToWait
.
waitMarkerFileUri
);
}
}
open
():
Promise
<
void
>
{
...
...
src/vs/workbench/electron-browser/window.ts
浏览文件 @
619f3201
...
...
@@ -229,7 +229,7 @@ export class ElectronWindow extends Disposable {
const
filesToWait
=
this
.
windowService
.
getConfiguration
().
filesToWait
;
if
(
filesToWait
)
{
const
resourcesToWaitFor
=
coalesce
(
filesToWait
.
paths
.
map
(
p
=>
p
.
fileUri
));
const
waitMarkerFile
=
URI
.
file
(
filesToWait
.
waitMarkerFilePath
)
;
const
waitMarkerFile
=
filesToWait
.
waitMarkerFileUri
;
const
listenerDispose
=
this
.
editorService
.
onDidCloseEditor
(()
=>
this
.
onEditorClosed
(
listenerDispose
,
resourcesToWaitFor
,
waitMarkerFile
));
this
.
_register
(
listenerDispose
);
...
...
@@ -493,7 +493,7 @@ export class ElectronWindow extends Disposable {
// are closed that the user wants to wait for. When this happens we delete
// the wait marker file to signal to the outside that editing is done.
const
resourcesToWaitFor
=
request
.
filesToWait
.
paths
.
map
(
p
=>
URI
.
revive
(
p
.
fileUri
));
const
waitMarkerFile
=
URI
.
file
(
request
.
filesToWait
.
waitMarkerFilePath
);
const
waitMarkerFile
=
URI
.
revive
(
request
.
filesToWait
.
waitMarkerFileUri
);
const
unbind
=
this
.
editorService
.
onDidCloseEditor
(()
=>
{
if
(
resourcesToWaitFor
.
every
(
resource
=>
!
this
.
editorService
.
isOpen
({
resource
})))
{
unbind
.
dispose
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录