Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d367f2f2
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,发现更多精彩内容 >>
提交
d367f2f2
编写于
2月 21, 2018
作者:
R
Rachel Macfarlane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Pass disable extensions as part of CLI configuration
上级
3ea42df3
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
24 addition
and
51 deletion
+24
-51
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+8
-11
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+2
-2
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+2
-4
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+5
-10
src/vs/platform/windows/electron-browser/windowService.ts
src/vs/platform/windows/electron-browser/windowService.ts
+3
-6
src/vs/platform/windows/electron-main/windowsService.ts
src/vs/platform/windows/electron-main/windowsService.ts
+3
-13
src/vs/workbench/electron-browser/actions.ts
src/vs/workbench/electron-browser/actions.ts
+1
-1
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+0
-4
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
d367f2f2
...
...
@@ -482,7 +482,7 @@ export class CodeWindow implements ICodeWindow {
});
}
public
load
(
config
:
IWindowConfiguration
,
isReload
?:
boolean
,
disableExtensions
?:
boolean
):
void
{
public
load
(
config
:
IWindowConfiguration
,
isReload
?:
boolean
):
void
{
// If this is the first time the window is loaded, we associate the paths
// directly with the window because we assume the loading will just work
...
...
@@ -499,13 +499,6 @@ export class CodeWindow implements ICodeWindow {
this
.
_readyState
=
ReadyState
.
NAVIGATING
;
}
// Copy the config so that the change to disable-extensions is not preserved
// on another reload.
const
configuration
=
objects
.
mixin
({},
config
);
if
(
disableExtensions
)
{
configuration
[
'
disable-extensions
'
]
=
true
;
}
// Clear Document Edited if needed
if
(
isMacintosh
&&
this
.
_win
.
isDocumentEdited
())
{
if
(
!
isReload
||
!
this
.
backupMainService
.
isHotExitEnabled
())
{
...
...
@@ -524,7 +517,7 @@ export class CodeWindow implements ICodeWindow {
// Load URL
mark
(
'
main:loadWindow
'
);
this
.
_win
.
loadURL
(
this
.
getUrl
(
config
uration
));
this
.
_win
.
loadURL
(
this
.
getUrl
(
config
));
// Make window visible if it did not open in N seconds because this indicates an error
// Only do this when running out of sources and not when running tests
...
...
@@ -539,7 +532,7 @@ export class CodeWindow implements ICodeWindow {
}
}
public
reload
(
configuration
?:
IWindowConfiguration
,
cli
?:
ParsedArgs
,
disableExtensions
?:
boolean
):
void
{
public
reload
(
configuration
?:
IWindowConfiguration
,
cli
?:
ParsedArgs
):
void
{
// If config is not provided, copy our current one
if
(
!
configuration
)
{
...
...
@@ -562,10 +555,14 @@ export class CodeWindow implements ICodeWindow {
configuration
[
'
extensions-dir
'
]
=
cli
[
'
extensions-dir
'
];
}
if
(
cli
)
{
configuration
[
'
disable-extensions
'
]
=
cli
[
'
disable-extensions
'
];
}
configuration
.
isInitialStartup
=
false
;
// since this is a reload
// Load config
this
.
load
(
configuration
,
true
,
disableExtensions
);
this
.
load
(
configuration
,
true
);
}
private
getUrl
(
windowConfiguration
:
IWindowConfiguration
):
string
{
...
...
src/vs/code/electron-main/windows.ts
浏览文件 @
d367f2f2
...
...
@@ -1266,12 +1266,12 @@ export class WindowsManager implements IWindowsMainService {
return
state
;
}
public
reload
(
win
:
CodeWindow
,
cli
?:
ParsedArgs
,
disableExtensions
?:
boolean
):
void
{
public
reload
(
win
:
CodeWindow
,
cli
?:
ParsedArgs
):
void
{
// Only reload when the window has not vetoed this
this
.
lifecycleService
.
unload
(
win
,
UnloadReason
.
RELOAD
).
done
(
veto
=>
{
if
(
!
veto
)
{
win
.
reload
(
void
0
,
cli
,
disableExtensions
);
win
.
reload
(
void
0
,
cli
);
// Emit
this
.
_onWindowReload
.
fire
(
win
.
id
);
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
d367f2f2
...
...
@@ -108,8 +108,7 @@ export interface IWindowsService {
showSaveDialog
(
windowId
:
number
,
options
:
SaveDialogOptions
):
TPromise
<
string
>
;
showOpenDialog
(
windowId
:
number
,
options
:
OpenDialogOptions
):
TPromise
<
string
[]
>
;
reloadWindow
(
windowId
:
number
):
TPromise
<
void
>
;
reloadWindowExtensionsDisabled
(
windowId
:
number
):
TPromise
<
void
>
;
reloadWindow
(
windowId
:
number
,
args
?:
ParsedArgs
):
TPromise
<
void
>
;
openDevTools
(
windowId
:
number
):
TPromise
<
void
>
;
toggleDevTools
(
windowId
:
number
):
TPromise
<
void
>
;
closeWorkspace
(
windowId
:
number
):
TPromise
<
void
>
;
...
...
@@ -184,8 +183,7 @@ export interface IWindowService {
pickFileAndOpen
(
options
:
INativeOpenDialogOptions
):
TPromise
<
void
>
;
pickFolderAndOpen
(
options
:
INativeOpenDialogOptions
):
TPromise
<
void
>
;
pickWorkspaceAndOpen
(
options
:
INativeOpenDialogOptions
):
TPromise
<
void
>
;
reloadWindow
():
TPromise
<
void
>
;
reloadWindowExtensionsDisabled
():
TPromise
<
void
>
;
reloadWindow
(
args
?:
ParsedArgs
):
TPromise
<
void
>
;
openDevTools
():
TPromise
<
void
>
;
toggleDevTools
():
TPromise
<
void
>
;
closeWorkspace
():
TPromise
<
void
>
;
...
...
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
d367f2f2
...
...
@@ -13,6 +13,7 @@ import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceFolde
import
{
IRecentlyOpened
}
from
'
vs/platform/history/common/history
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
export
interface
IWindowsChannel
extends
IChannel
{
call
(
command
:
'
event:onWindowOpen
'
):
TPromise
<
number
>
;
...
...
@@ -25,8 +26,7 @@ export interface IWindowsChannel extends IChannel {
call
(
command
:
'
showMessageBox
'
,
arg
:
[
number
,
MessageBoxOptions
]):
TPromise
<
IMessageBoxResult
>
;
call
(
command
:
'
showSaveDialog
'
,
arg
:
[
number
,
SaveDialogOptions
]):
TPromise
<
string
>
;
call
(
command
:
'
showOpenDialog
'
,
arg
:
[
number
,
OpenDialogOptions
]):
TPromise
<
string
[]
>
;
call
(
command
:
'
reloadWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
reloadWindowExtensionsDisabled
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
reloadWindow
'
,
arg
:
[
number
,
ParsedArgs
]):
TPromise
<
void
>
;
call
(
command
:
'
toggleDevTools
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
closeWorkspace
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
createAndEnterWorkspace
'
,
arg
:
[
number
,
IWorkspaceFolderCreationData
[],
string
]):
TPromise
<
IEnterWorkspaceResult
>
;
...
...
@@ -92,8 +92,7 @@ export class WindowsChannel implements IWindowsChannel {
case
'
showMessageBox
'
:
return
this
.
service
.
showMessageBox
(
arg
[
0
],
arg
[
1
]);
case
'
showSaveDialog
'
:
return
this
.
service
.
showSaveDialog
(
arg
[
0
],
arg
[
1
]);
case
'
showOpenDialog
'
:
return
this
.
service
.
showOpenDialog
(
arg
[
0
],
arg
[
1
]);
case
'
reloadWindowExtensionsDisabled
'
:
return
this
.
service
.
reloadWindowExtensionsDisabled
(
arg
);
case
'
reloadWindow
'
:
return
this
.
service
.
reloadWindow
(
arg
);
case
'
reloadWindow
'
:
return
this
.
service
.
reloadWindow
(
arg
[
0
],
arg
[
1
]);
case
'
openDevTools
'
:
return
this
.
service
.
openDevTools
(
arg
);
case
'
toggleDevTools
'
:
return
this
.
service
.
toggleDevTools
(
arg
);
case
'
closeWorkspace
'
:
return
this
.
service
.
closeWorkspace
(
arg
);
...
...
@@ -194,12 +193,8 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
showOpenDialog
'
,
[
windowId
,
options
]);
}
reloadWindow
(
windowId
:
number
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
reloadWindow
'
,
windowId
);
}
reloadWindowExtensionsDisabled
(
windowId
:
number
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
reloadWindowExtensionsDisabled
'
,
windowId
);
reloadWindow
(
windowId
:
number
,
args
?:
ParsedArgs
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
reloadWindow
'
,
[
windowId
,
args
]);
}
openDevTools
(
windowId
:
number
):
TPromise
<
void
>
{
...
...
src/vs/platform/windows/electron-browser/windowService.ts
浏览文件 @
d367f2f2
...
...
@@ -11,6 +11,7 @@ import { IWindowService, IWindowsService, INativeOpenDialogOptions, IEnterWorksp
import
{
IRecentlyOpened
}
from
'
vs/platform/history/common/history
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IWorkspaceFolderCreationData
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
export
class
WindowService
implements
IWindowService
{
...
...
@@ -60,12 +61,8 @@ export class WindowService implements IWindowService {
return
this
.
windowsService
.
pickWorkspaceAndOpen
(
options
);
}
reloadWindow
():
TPromise
<
void
>
{
return
this
.
windowsService
.
reloadWindow
(
this
.
windowId
);
}
reloadWindowExtensionsDisabled
():
TPromise
<
void
>
{
return
this
.
windowsService
.
reloadWindowExtensionsDisabled
(
this
.
windowId
);
reloadWindow
(
args
?:
ParsedArgs
):
TPromise
<
void
>
{
return
this
.
windowsService
.
reloadWindow
(
this
.
windowId
,
args
);
}
openDevTools
():
TPromise
<
void
>
{
...
...
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
d367f2f2
...
...
@@ -12,7 +12,7 @@ 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
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IEnvironmentService
,
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
import
{
shell
,
crashReporter
,
app
,
Menu
,
clipboard
}
from
'
electron
'
;
import
Event
,
{
chain
,
fromNodeEventEmitter
}
from
'
vs/base/common/event
'
;
import
{
IURLService
}
from
'
vs/platform/url/common/url
'
;
...
...
@@ -107,22 +107,12 @@ export class WindowsService implements IWindowsService, IDisposable {
return
this
.
windowsMainService
.
showOpenDialog
(
options
,
codeWindow
);
}
reloadWindowExtensionsDisabled
(
windowId
:
number
):
TPromise
<
void
>
{
const
codeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
if
(
codeWindow
)
{
this
.
windowsMainService
.
reload
(
codeWindow
,
undefined
,
true
);
}
return
TPromise
.
as
(
null
);
}
reloadWindow
(
windowId
:
number
):
TPromise
<
void
>
{
reloadWindow
(
windowId
:
number
,
args
:
ParsedArgs
):
TPromise
<
void
>
{
this
.
logService
.
trace
(
'
windowsService#reloadWindow
'
,
windowId
);
const
codeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
if
(
codeWindow
)
{
this
.
windowsMainService
.
reload
(
codeWindow
);
this
.
windowsMainService
.
reload
(
codeWindow
,
args
);
}
return
TPromise
.
as
(
null
);
...
...
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
d367f2f2
...
...
@@ -569,7 +569,7 @@ export class ReloadWindowWithExtensionsDisabledAction extends Action {
}
run
():
TPromise
<
boolean
>
{
return
this
.
windowService
.
reloadWindow
ExtensionsDisabled
(
).
then
(()
=>
true
);
return
this
.
windowService
.
reloadWindow
({
_
:
[],
'
disable-extensions
'
:
true
}
).
then
(()
=>
true
);
}
}
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
d367f2f2
...
...
@@ -927,10 +927,6 @@ export class TestWindowService implements IWindowService {
return
TPromise
.
as
(
void
0
);
}
reloadWindowExtensionsDisabled
():
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
openDevTools
():
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录