Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5dc5b4a9
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 搜索 >>
提交
5dc5b4a9
编写于
5月 02, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
smoketest: show devtools when using --verbose
上级
5ba105e0
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
59 addition
and
24 deletion
+59
-24
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+1
-1
src/vs/platform/driver/common/driver.ts
src/vs/platform/driver/common/driver.ts
+7
-3
src/vs/platform/driver/electron-browser/driver.ts
src/vs/platform/driver/electron-browser/driver.ts
+13
-2
src/vs/platform/driver/electron-main/driver.ts
src/vs/platform/driver/electron-main/driver.ts
+8
-3
src/vs/platform/environment/common/environment.ts
src/vs/platform/environment/common/environment.ts
+2
-0
src/vs/platform/environment/node/argv.ts
src/vs/platform/environment/node/argv.ts
+2
-1
src/vs/platform/environment/node/environmentService.ts
src/vs/platform/environment/node/environmentService.ts
+1
-0
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+6
-2
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+4
-4
src/vs/platform/windows/electron-browser/windowService.ts
src/vs/platform/windows/electron-browser/windowService.ts
+3
-3
src/vs/platform/windows/electron-main/windowsService.ts
src/vs/platform/windows/electron-main/windowsService.ts
+3
-3
test/smoke/src/application.ts
test/smoke/src/application.ts
+2
-1
test/smoke/src/main.ts
test/smoke/src/main.ts
+2
-1
test/smoke/src/vscode/code.ts
test/smoke/src/vscode/code.ts
+5
-0
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
5dc5b4a9
...
...
@@ -289,7 +289,7 @@ export class CodeApplication {
// Create driver
if
(
this
.
environmentService
.
driverHandle
)
{
serveDriver
(
this
.
electronIpcServer
,
this
.
environmentService
.
driverHandle
,
appInstantiationService
).
then
(
server
=>
{
serveDriver
(
this
.
electronIpcServer
,
this
.
environmentService
.
driverHandle
,
this
.
environmentService
,
appInstantiationService
).
then
(
server
=>
{
this
.
logService
.
info
(
'
Driver started at:
'
,
this
.
environmentService
.
driverHandle
);
this
.
toDispose
.
push
(
server
);
});
...
...
src/vs/platform/driver/common/driver.ts
浏览文件 @
5dc5b4a9
...
...
@@ -150,13 +150,17 @@ export class DriverChannelClient implements IDriver {
}
}
export
interface
IDriverOptions
{
verbose
:
boolean
;
}
export
interface
IWindowDriverRegistry
{
registerWindowDriver
(
windowId
:
number
):
TPromise
<
void
>
;
registerWindowDriver
(
windowId
:
number
):
TPromise
<
IDriverOptions
>
;
reloadWindowDriver
(
windowId
:
number
):
TPromise
<
void
>
;
}
export
interface
IWindowDriverRegistryChannel
extends
IChannel
{
call
(
command
:
'
registerWindowDriver
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
registerWindowDriver
'
,
arg
:
number
):
TPromise
<
IDriverOptions
>
;
call
(
command
:
'
reloadWindowDriver
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
string
,
arg
:
any
):
TPromise
<
any
>
;
}
...
...
@@ -181,7 +185,7 @@ export class WindowDriverRegistryChannelClient implements IWindowDriverRegistry
constructor
(
private
channel
:
IWindowDriverRegistryChannel
)
{
}
registerWindowDriver
(
windowId
:
number
):
TPromise
<
void
>
{
registerWindowDriver
(
windowId
:
number
):
TPromise
<
IDriverOptions
>
{
return
this
.
channel
.
call
(
'
registerWindowDriver
'
,
windowId
);
}
...
...
src/vs/platform/driver/electron-browser/driver.ts
浏览文件 @
5dc5b4a9
...
...
@@ -12,6 +12,7 @@ import { IPCClient } from 'vs/base/parts/ipc/common/ipc';
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
getTopLeftOffset
,
getClientArea
}
from
'
vs/base/browser/dom
'
;
import
*
as
electron
from
'
electron
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
function
serializeElement
(
element
:
Element
,
recursive
:
boolean
):
IElement
{
const
attributes
=
Object
.
create
(
null
);
...
...
@@ -40,7 +41,9 @@ function serializeElement(element: Element, recursive: boolean): IElement {
class
WindowDriver
implements
IWindowDriver
{
constructor
()
{
}
constructor
(
@
IWindowService
private
windowService
:
IWindowService
)
{
}
async
click
(
selector
:
string
,
xoffset
?:
number
,
yoffset
?:
number
):
TPromise
<
void
>
{
return
this
.
_click
(
selector
,
1
,
xoffset
,
yoffset
);
...
...
@@ -183,6 +186,10 @@ class WindowDriver implements IWindowDriver {
return
lines
;
}
async
openDevTools
():
TPromise
<
void
>
{
await
this
.
windowService
.
openDevTools
({
mode
:
'
detach
'
});
}
}
export
async
function
registerWindowDriver
(
...
...
@@ -197,7 +204,11 @@ export async function registerWindowDriver(
const
windowDriverRegistryChannel
=
client
.
getChannel
(
'
windowDriverRegistry
'
);
const
windowDriverRegistry
=
new
WindowDriverRegistryChannelClient
(
windowDriverRegistryChannel
);
await
windowDriverRegistry
.
registerWindowDriver
(
windowId
);
const
options
=
await
windowDriverRegistry
.
registerWindowDriver
(
windowId
);
if
(
options
.
verbose
)
{
windowDriver
.
openDevTools
();
}
const
disposable
=
toDisposable
(()
=>
windowDriverRegistry
.
reloadWindowDriver
(
windowId
));
return
combinedDisposable
([
disposable
,
client
]);
...
...
src/vs/platform/driver/electron-main/driver.ts
浏览文件 @
5dc5b4a9
...
...
@@ -6,7 +6,7 @@
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IDriver
,
DriverChannel
,
IElement
,
IWindowDriverChannel
,
WindowDriverChannelClient
,
IWindowDriverRegistry
,
WindowDriverRegistryChannel
,
IWindowDriver
}
from
'
vs/platform/driver/common/driver
'
;
import
{
IDriver
,
DriverChannel
,
IElement
,
IWindowDriverChannel
,
WindowDriverChannelClient
,
IWindowDriverRegistry
,
WindowDriverRegistryChannel
,
IWindowDriver
,
IDriverOptions
}
from
'
vs/platform/driver/common/driver
'
;
import
{
IWindowsMainService
}
from
'
vs/platform/windows/electron-main/windows
'
;
import
{
serve
as
serveNet
}
from
'
vs/base/parts/ipc/node/ipc.net
'
;
import
{
combinedDisposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -16,6 +16,7 @@ import { SimpleKeybinding, KeyCode } from 'vs/base/common/keyCodes';
import
{
USLayoutResolvedKeybinding
}
from
'
vs/platform/keybinding/common/usLayoutResolvedKeybinding
'
;
import
{
OS
}
from
'
vs/base/common/platform
'
;
import
{
Emitter
,
toPromise
}
from
'
vs/base/common/event
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
// TODO@joao: bad layering!
import
{
KeybindingIO
}
from
'
vs/workbench/services/keybinding/common/keybindingIO
'
;
...
...
@@ -45,13 +46,15 @@ export class Driver implements IDriver, IWindowDriverRegistry {
constructor
(
private
windowServer
:
IPCServer
,
private
options
:
IDriverOptions
,
@
IWindowsMainService
private
windowsService
:
IWindowsMainService
)
{
}
async
registerWindowDriver
(
windowId
:
number
):
TPromise
<
void
>
{
async
registerWindowDriver
(
windowId
:
number
):
TPromise
<
IDriverOptions
>
{
this
.
registeredWindowIds
.
add
(
windowId
);
this
.
reloadingWindowIds
.
delete
(
windowId
);
this
.
onDidReloadingChange
.
fire
();
return
this
.
options
;
}
async
reloadWindowDriver
(
windowId
:
number
):
TPromise
<
void
>
{
...
...
@@ -203,9 +206,11 @@ export class Driver implements IDriver, IWindowDriverRegistry {
export
async
function
serve
(
windowServer
:
IPCServer
,
handle
:
string
,
environmentService
:
IEnvironmentService
,
instantiationService
:
IInstantiationService
):
TPromise
<
IDisposable
>
{
const
driver
=
instantiationService
.
createInstance
(
Driver
,
windowServer
);
const
verbose
=
environmentService
.
driverVerbose
;
const
driver
=
instantiationService
.
createInstance
(
Driver
,
windowServer
,
{
verbose
});
const
windowDriverRegistryChannel
=
new
WindowDriverRegistryChannel
(
driver
);
windowServer
.
registerChannel
(
'
windowDriverRegistry
'
,
windowDriverRegistryChannel
);
...
...
src/vs/platform/environment/common/environment.ts
浏览文件 @
5dc5b4a9
...
...
@@ -58,6 +58,7 @@ export interface ParsedArgs {
'
file-chmod
'
?:
boolean
;
'
upload-logs
'
?:
string
;
'
driver
'
?:
string
;
'
driver-verbose
'
?:
boolean
;
}
export
const
IEnvironmentService
=
createDecorator
<
IEnvironmentService
>
(
'
environmentService
'
);
...
...
@@ -133,4 +134,5 @@ export interface IEnvironmentService {
disableCrashReporter
:
boolean
;
driverHandle
:
string
;
driverVerbose
:
boolean
;
}
src/vs/platform/environment/node/argv.ts
浏览文件 @
5dc5b4a9
...
...
@@ -62,7 +62,8 @@ const options: minimist.Opts = {
'
skip-add-to-recently-opened
'
,
'
status
'
,
'
file-write
'
,
'
file-chmod
'
'
file-chmod
'
,
'
driver-verbose
'
],
alias
:
{
add
:
'
a
'
,
...
...
src/vs/platform/environment/node/environmentService.ts
浏览文件 @
5dc5b4a9
...
...
@@ -171,6 +171,7 @@ export class EnvironmentService implements IEnvironmentService {
get
disableCrashReporter
():
boolean
{
return
!!
this
.
_args
[
'
disable-crash-reporter
'
];
}
get
driverHandle
():
string
{
return
this
.
_args
[
'
driver
'
];
}
get
driverVerbose
():
boolean
{
return
this
.
_args
[
'
driver-verbose
'
];
}
constructor
(
private
_args
:
ParsedArgs
,
private
_execPath
:
string
)
{
if
(
!
process
.
env
[
'
VSCODE_LOGS
'
])
{
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
5dc5b4a9
...
...
@@ -92,6 +92,10 @@ export interface OpenDialogOptions {
message
?:
string
;
}
export
interface
IDevToolsOptions
{
mode
:
'
right
'
|
'
bottom
'
|
'
undocked
'
|
'
detach
'
;
}
export
interface
IWindowsService
{
_serviceBrand
:
any
;
...
...
@@ -110,7 +114,7 @@ export interface IWindowsService {
showOpenDialog
(
windowId
:
number
,
options
:
OpenDialogOptions
):
TPromise
<
string
[]
>
;
reloadWindow
(
windowId
:
number
,
args
?:
ParsedArgs
):
TPromise
<
void
>
;
openDevTools
(
windowId
:
number
):
TPromise
<
void
>
;
openDevTools
(
windowId
:
number
,
options
?:
IDevToolsOptions
):
TPromise
<
void
>
;
toggleDevTools
(
windowId
:
number
):
TPromise
<
void
>
;
closeWorkspace
(
windowId
:
number
):
TPromise
<
void
>
;
createAndEnterWorkspace
(
windowId
:
number
,
folders
?:
IWorkspaceFolderCreationData
[],
path
?:
string
):
TPromise
<
IEnterWorkspaceResult
>
;
...
...
@@ -185,7 +189,7 @@ export interface IWindowService {
pickFolderAndOpen
(
options
:
INativeOpenDialogOptions
):
TPromise
<
void
>
;
pickWorkspaceAndOpen
(
options
:
INativeOpenDialogOptions
):
TPromise
<
void
>
;
reloadWindow
(
args
?:
ParsedArgs
):
TPromise
<
void
>
;
openDevTools
():
TPromise
<
void
>
;
openDevTools
(
options
?:
IDevToolsOptions
):
TPromise
<
void
>
;
toggleDevTools
():
TPromise
<
void
>
;
closeWorkspace
():
TPromise
<
void
>
;
updateTouchBar
(
items
:
ICommandAction
[][]):
TPromise
<
void
>
;
...
...
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
5dc5b4a9
...
...
@@ -8,7 +8,7 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Event
,
buffer
}
from
'
vs/base/common/event
'
;
import
{
IChannel
,
eventToCall
,
eventFromCall
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IWindowsService
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
,
CrashReporterStartOptions
,
IMessageBoxResult
,
MessageBoxOptions
,
SaveDialogOptions
,
OpenDialogOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowsService
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
,
CrashReporterStartOptions
,
IMessageBoxResult
,
MessageBoxOptions
,
SaveDialogOptions
,
OpenDialogOptions
,
IDevToolsOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWorkspaceIdentifier
,
ISingleFolderWorkspaceIdentifier
,
IWorkspaceFolderCreationData
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IRecentlyOpened
}
from
'
vs/platform/history/common/history
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
...
...
@@ -93,7 +93,7 @@ export class WindowsChannel implements IWindowsChannel {
case
'
showSaveDialog
'
:
return
this
.
service
.
showSaveDialog
(
arg
[
0
],
arg
[
1
]);
case
'
showOpenDialog
'
:
return
this
.
service
.
showOpenDialog
(
arg
[
0
],
arg
[
1
]);
case
'
reloadWindow
'
:
return
this
.
service
.
reloadWindow
(
arg
[
0
],
arg
[
1
]);
case
'
openDevTools
'
:
return
this
.
service
.
openDevTools
(
arg
);
case
'
openDevTools
'
:
return
this
.
service
.
openDevTools
(
arg
[
0
],
arg
[
1
]
);
case
'
toggleDevTools
'
:
return
this
.
service
.
toggleDevTools
(
arg
);
case
'
closeWorkspace
'
:
return
this
.
service
.
closeWorkspace
(
arg
);
case
'
createAndEnterWorkspace
'
:
{
...
...
@@ -197,8 +197,8 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
reloadWindow
'
,
[
windowId
,
args
]);
}
openDevTools
(
windowId
:
number
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
openDevTools
'
,
windowId
);
openDevTools
(
windowId
:
number
,
options
?:
IDevToolsOptions
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
openDevTools
'
,
[
windowId
,
options
]
);
}
toggleDevTools
(
windowId
:
number
):
TPromise
<
void
>
{
...
...
src/vs/platform/windows/electron-browser/windowService.ts
浏览文件 @
5dc5b4a9
...
...
@@ -7,7 +7,7 @@
import
{
Event
,
filterEvent
,
mapEvent
,
anyEvent
}
from
'
vs/base/common/event
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IWindowService
,
IWindowsService
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
,
IMessageBoxResult
,
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowService
,
IWindowsService
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
,
IMessageBoxResult
,
IWindowConfiguration
,
IDevToolsOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IRecentlyOpened
}
from
'
vs/platform/history/common/history
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IWorkspaceFolderCreationData
}
from
'
vs/platform/workspaces/common/workspaces
'
;
...
...
@@ -65,8 +65,8 @@ export class WindowService implements IWindowService {
return
this
.
windowsService
.
reloadWindow
(
this
.
windowId
,
args
);
}
openDevTools
():
TPromise
<
void
>
{
return
this
.
windowsService
.
openDevTools
(
this
.
windowId
);
openDevTools
(
options
?:
IDevToolsOptions
):
TPromise
<
void
>
{
return
this
.
windowsService
.
openDevTools
(
this
.
windowId
,
options
);
}
toggleDevTools
():
TPromise
<
void
>
{
...
...
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
5dc5b4a9
...
...
@@ -11,7 +11,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
product
from
'
vs/platform/node/product
'
;
import
{
IWindowsService
,
OpenContext
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
,
IMessageBoxResult
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowsService
,
OpenContext
,
INativeOpenDialogOptions
,
IEnterWorkspaceResult
,
IMessageBoxResult
,
IDevToolsOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IEnvironmentService
,
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
import
{
shell
,
crashReporter
,
app
,
Menu
,
clipboard
}
from
'
electron
'
;
import
{
Event
,
fromNodeEventEmitter
,
mapEvent
,
filterEvent
,
anyEvent
}
from
'
vs/base/common/event
'
;
...
...
@@ -112,12 +112,12 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable
return
TPromise
.
as
(
null
);
}
openDevTools
(
windowId
:
number
):
TPromise
<
void
>
{
openDevTools
(
windowId
:
number
,
options
?:
IDevToolsOptions
):
TPromise
<
void
>
{
this
.
logService
.
trace
(
'
windowsService#openDevTools
'
,
windowId
);
const
codeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
if
(
codeWindow
)
{
codeWindow
.
win
.
webContents
.
openDevTools
();
codeWindow
.
win
.
webContents
.
openDevTools
(
options
);
}
return
TPromise
.
as
(
null
);
...
...
test/smoke/src/application.ts
浏览文件 @
5dc5b4a9
...
...
@@ -108,7 +108,8 @@ export class Application {
userDataDir
:
this
.
options
.
userDataDir
,
extensionsPath
:
this
.
options
.
extensionsPath
,
logger
:
this
.
options
.
logger
,
extraArgs
verbose
:
this
.
options
.
verbose
,
extraArgs
,
});
this
.
_workbench
=
new
Workbench
(
this
.
_code
,
this
.
keybindings
,
this
.
userDataPath
);
...
...
test/smoke/src/main.ts
浏览文件 @
5dc5b4a9
...
...
@@ -257,7 +257,8 @@ function createApp(quality: Quality): Application {
extensionsPath
,
workspaceFilePath
,
waitTime
:
parseInt
(
opts
[
'
wait-time
'
]
||
'
0
'
)
||
20
,
logger
:
new
MultiLogger
(
loggers
)
logger
:
new
MultiLogger
(
loggers
),
verbose
:
opts
.
verbose
});
}
...
...
test/smoke/src/vscode/code.ts
浏览文件 @
5dc5b4a9
...
...
@@ -87,6 +87,7 @@ export interface SpawnOptions {
userDataDir
:
string
;
extensionsPath
:
string
;
logger
:
Logger
;
verbose
?:
boolean
;
extraArgs
?:
string
[];
}
...
...
@@ -122,6 +123,10 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
args
.
unshift
(
repoPath
);
}
if
(
options
.
verbose
)
{
args
.
push
(
'
--driver-verbose
'
);
}
if
(
options
.
extraArgs
)
{
args
.
push
(...
options
.
extraArgs
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录