Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
46d90b43
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,发现更多精彩内容 >>
提交
46d90b43
编写于
8月 23, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Should stop sending global settings and keybindings via IPC (fixes #6094)
上级
0b842190
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
5 addition
and
66 deletion
+5
-66
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+0
-3
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+0
-5
src/vs/test/utils/servicesTestUtils.ts
src/vs/test/utils/servicesTestUtils.ts
+1
-3
src/vs/workbench/common/events.ts
src/vs/workbench/common/events.ts
+0
-23
src/vs/workbench/common/options.ts
src/vs/workbench/common/options.ts
+0
-5
src/vs/workbench/electron-browser/bootstrap/index.js
src/vs/workbench/electron-browser/bootstrap/index.js
+1
-6
src/vs/workbench/electron-browser/integration.ts
src/vs/workbench/electron-browser/integration.ts
+0
-7
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+3
-4
src/vs/workbench/services/workspace/common/contextService.ts
src/vs/workbench/services/workspace/common/contextService.ts
+0
-10
未找到文件。
src/vs/code/electron-main/main.ts
浏览文件 @
46d90b43
...
@@ -167,9 +167,6 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: IProce
...
@@ -167,9 +167,6 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: IProce
// Lifecycle
// Lifecycle
lifecycleService
.
ready
();
lifecycleService
.
ready
();
// Load settings (TODO@Ben remove)
global
.
globalSettingsValue
=
JSON
.
stringify
(
configurationService
.
getConfiguration
());
// Propagate to clients
// Propagate to clients
windowsService
.
ready
(
userEnv
);
windowsService
.
ready
(
userEnv
);
...
...
src/vs/code/electron-main/windows.ts
浏览文件 @
46d90b43
...
@@ -193,11 +193,6 @@ export class WindowsManager implements IWindowsService {
...
@@ -193,11 +193,6 @@ export class WindowsManager implements IWindowsService {
},
100
);
},
100
);
});
});
this
.
configurationService
.
onDidUpdateConfiguration
(
event
=>
{
global
.
globalSettingsValue
=
JSON
.
stringify
(
event
.
config
);
// Load settings (TODO@Ben remove)
this
.
sendToAll
(
'
vscode:optionsChange
'
,
JSON
.
stringify
(
event
.
config
));
},
this
);
ipc
.
on
(
'
vscode:startCrashReporter
'
,
(
event
:
any
,
config
:
any
)
=>
{
ipc
.
on
(
'
vscode:startCrashReporter
'
,
(
event
:
any
,
config
:
any
)
=>
{
this
.
logService
.
log
(
'
IPC#vscode:startCrashReporter
'
);
this
.
logService
.
log
(
'
IPC#vscode:startCrashReporter
'
);
...
...
src/vs/test/utils/servicesTestUtils.ts
浏览文件 @
46d90b43
...
@@ -57,9 +57,7 @@ export class TestContextService implements WorkspaceContextService.IWorkspaceCon
...
@@ -57,9 +57,7 @@ export class TestContextService implements WorkspaceContextService.IWorkspaceCon
constructor
(
workspace
:
any
=
TestWorkspace
,
options
:
any
=
null
)
{
constructor
(
workspace
:
any
=
TestWorkspace
,
options
:
any
=
null
)
{
this
.
workspace
=
workspace
;
this
.
workspace
=
workspace
;
this
.
options
=
options
||
{
this
.
options
=
options
||
Object
.
create
(
null
);
globalSettings
:
{}
};
}
}
public
getWorkspace
():
IWorkspace
{
public
getWorkspace
():
IWorkspace
{
...
...
src/vs/workbench/common/events.ts
浏览文件 @
46d90b43
...
@@ -26,29 +26,6 @@ export class EventType {
...
@@ -26,29 +26,6 @@ export class EventType {
* Event type for when a resources encoding changes.
* Event type for when a resources encoding changes.
*/
*/
static
RESOURCE_ENCODING_CHANGED
=
'
resourceEncodingChanged
'
;
static
RESOURCE_ENCODING_CHANGED
=
'
resourceEncodingChanged
'
;
/**
* Event type for when the workbench options change. Listeners should refresh their
* assumption on workbench options after this event is emitted.
*/
static
WORKBENCH_OPTIONS_CHANGED
=
'
workbenchOptionsChanged
'
;
}
/**
* Option change events are send when the options in the running instance change.
*/
export
class
OptionsChangeEvent
extends
Event
{
public
key
:
string
;
public
before
:
any
;
public
after
:
any
;
constructor
(
key
:
string
,
before
:
any
,
after
:
any
,
originalEvent
?:
any
)
{
super
(
originalEvent
);
this
.
key
=
key
;
this
.
before
=
before
;
this
.
after
=
after
;
}
}
}
export
class
ResourceEvent
extends
Event
{
export
class
ResourceEvent
extends
Event
{
...
...
src/vs/workbench/common/options.ts
浏览文件 @
46d90b43
...
@@ -27,9 +27,4 @@ export interface IOptions {
...
@@ -27,9 +27,4 @@ export interface IOptions {
* Instructs the workbench to install the extensions from the provided local paths.
* Instructs the workbench to install the extensions from the provided local paths.
*/
*/
extensionsToInstall
?:
string
[];
extensionsToInstall
?:
string
[];
/**
* The global application settings if any.
*/
globalSettings
?:
any
;
}
}
\ No newline at end of file
src/vs/workbench/electron-browser/bootstrap/index.js
浏览文件 @
46d90b43
...
@@ -120,11 +120,6 @@ function main() {
...
@@ -120,11 +120,6 @@ function main() {
const
enableDeveloperTools
=
process
.
env
[
'
VSCODE_DEV
'
]
||
!!
configuration
.
extensionDevelopmentPath
;
const
enableDeveloperTools
=
process
.
env
[
'
VSCODE_DEV
'
]
||
!!
configuration
.
extensionDevelopmentPath
;
registerListeners
(
enableDeveloperTools
);
registerListeners
(
enableDeveloperTools
);
// We get the global settings through a remote call from the browser
// because its value can change dynamically.
const
rawGlobalSettings
=
remote
.
getGlobal
(
'
globalSettingsValue
'
)
||
'
{}
'
;
const
globalSettings
=
JSON
.
parse
(
rawGlobalSettings
);
// disable pinch zoom & apply zoom level early to avoid glitches
// disable pinch zoom & apply zoom level early to avoid glitches
const
zoomLevel
=
configuration
.
zoomLevel
;
const
zoomLevel
=
configuration
.
zoomLevel
;
webFrame
.
setZoomLevelLimits
(
1
,
1
);
webFrame
.
setZoomLevelLimits
(
1
,
1
);
...
@@ -177,7 +172,7 @@ function main() {
...
@@ -177,7 +172,7 @@ function main() {
timers
.
afterLoad
=
new
Date
();
timers
.
afterLoad
=
new
Date
();
require
(
'
vs/workbench/electron-browser/main
'
)
require
(
'
vs/workbench/electron-browser/main
'
)
.
startup
(
configuration
,
globalSettings
)
.
startup
(
configuration
)
.
done
(
null
,
function
(
error
)
{
onError
(
error
,
enableDeveloperTools
);
});
.
done
(
null
,
function
(
error
)
{
onError
(
error
,
enableDeveloperTools
);
});
});
});
});
});
...
...
src/vs/workbench/electron-browser/integration.ts
浏览文件 @
46d90b43
...
@@ -22,7 +22,6 @@ import {IContextMenuService} from 'vs/platform/contextview/browser/contextView';
...
@@ -22,7 +22,6 @@ import {IContextMenuService} from 'vs/platform/contextview/browser/contextView';
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
LegacyWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
IWindowService
}
from
'
vs/workbench/services/window/electron-browser/windowService
'
;
import
{
IWindowService
}
from
'
vs/workbench/services/window/electron-browser/windowService
'
;
import
{
IWindowConfiguration
}
from
'
vs/workbench/electron-browser/window
'
;
import
{
IWindowConfiguration
}
from
'
vs/workbench/electron-browser/window
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
...
@@ -74,12 +73,6 @@ export class ElectronIntegration {
...
@@ -74,12 +73,6 @@ export class ElectronIntegration {
this
.
commandService
.
executeCommand
(
actionId
,
{
from
:
'
menu
'
}).
done
(
undefined
,
err
=>
this
.
messageService
.
show
(
Severity
.
Error
,
err
));
this
.
commandService
.
executeCommand
(
actionId
,
{
from
:
'
menu
'
}).
done
(
undefined
,
err
=>
this
.
messageService
.
show
(
Severity
.
Error
,
err
));
});
});
// Support options change
ipc
.
on
(
'
vscode:optionsChange
'
,
(
event
,
options
:
string
)
=>
{
const
optionsData
=
JSON
.
parse
(
options
);
(
<
LegacyWorkspaceContextService
>
this
.
contextService
).
updateOptions
(
'
globalSettings
'
,
optionsData
);
});
// Support resolve keybindings event
// Support resolve keybindings event
ipc
.
on
(
'
vscode:resolveKeybindings
'
,
(
event
,
rawActionIds
:
string
)
=>
{
ipc
.
on
(
'
vscode:resolveKeybindings
'
,
(
event
,
rawActionIds
:
string
)
=>
{
let
actionIds
:
string
[]
=
[];
let
actionIds
:
string
[]
=
[];
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
46d90b43
...
@@ -62,7 +62,7 @@ export interface IWindowConfiguration extends ParsedArgs {
...
@@ -62,7 +62,7 @@ export interface IWindowConfiguration extends ParsedArgs {
extensionsToInstall
?:
string
[];
extensionsToInstall
?:
string
[];
}
}
export
function
startup
(
configuration
:
IWindowConfiguration
,
globalSettings
:
any
):
winjs
.
TPromise
<
void
>
{
export
function
startup
(
configuration
:
IWindowConfiguration
):
winjs
.
TPromise
<
void
>
{
// Shell Options
// Shell Options
const
filesToOpen
=
configuration
.
filesToOpen
&&
configuration
.
filesToOpen
.
length
?
toInputs
(
configuration
.
filesToOpen
)
:
null
;
const
filesToOpen
=
configuration
.
filesToOpen
&&
configuration
.
filesToOpen
.
length
?
toInputs
(
configuration
.
filesToOpen
)
:
null
;
...
@@ -72,8 +72,7 @@ export function startup(configuration: IWindowConfiguration, globalSettings: any
...
@@ -72,8 +72,7 @@ export function startup(configuration: IWindowConfiguration, globalSettings: any
filesToOpen
,
filesToOpen
,
filesToCreate
,
filesToCreate
,
filesToDiff
,
filesToDiff
,
extensionsToInstall
:
configuration
.
extensionsToInstall
,
extensionsToInstall
:
configuration
.
extensionsToInstall
globalSettings
};
};
if
(
configuration
.
performance
)
{
if
(
configuration
.
performance
)
{
...
@@ -131,7 +130,7 @@ function getWorkspace(workspacePath: string): IWorkspace {
...
@@ -131,7 +130,7 @@ function getWorkspace(workspacePath: string): IWorkspace {
function
openWorkbench
(
environment
:
IWindowConfiguration
,
workspace
:
IWorkspace
,
options
:
IOptions
):
winjs
.
TPromise
<
void
>
{
function
openWorkbench
(
environment
:
IWindowConfiguration
,
workspace
:
IWorkspace
,
options
:
IOptions
):
winjs
.
TPromise
<
void
>
{
const
eventService
=
new
EventService
();
const
eventService
=
new
EventService
();
const
environmentService
=
new
EnvironmentService
(
environment
,
environment
.
execPath
);
const
environmentService
=
new
EnvironmentService
(
environment
,
environment
.
execPath
);
const
contextService
=
new
LegacyWorkspaceContextService
(
eventService
,
workspace
,
options
);
const
contextService
=
new
LegacyWorkspaceContextService
(
workspace
,
options
);
const
configurationService
=
new
ConfigurationService
(
contextService
,
eventService
,
environmentService
);
const
configurationService
=
new
ConfigurationService
(
contextService
,
eventService
,
environmentService
);
// Since the configuration service is one of the core services that is used in so many places, we initialize it
// Since the configuration service is one of the core services that is used in so many places, we initialize it
...
...
src/vs/workbench/services/workspace/common/contextService.ts
浏览文件 @
46d90b43
...
@@ -5,14 +5,11 @@
...
@@ -5,14 +5,11 @@
'
use strict
'
;
'
use strict
'
;
import
{
IOptions
}
from
'
vs/workbench/common/options
'
;
import
{
IOptions
}
from
'
vs/workbench/common/options
'
;
import
{
EventType
,
OptionsChangeEvent
}
from
'
vs/workbench/common/events
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IWorkspace
,
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspace
,
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
export
class
LegacyWorkspaceContextService
extends
WorkspaceContextService
{
export
class
LegacyWorkspaceContextService
extends
WorkspaceContextService
{
constructor
(
constructor
(
private
eventService
:
IEventService
,
workspace
:
IWorkspace
,
workspace
:
IWorkspace
,
private
options
:
IOptions
private
options
:
IOptions
)
{
)
{
...
@@ -22,11 +19,4 @@ export class LegacyWorkspaceContextService extends WorkspaceContextService {
...
@@ -22,11 +19,4 @@ export class LegacyWorkspaceContextService extends WorkspaceContextService {
public
getOptions
():
IOptions
{
public
getOptions
():
IOptions
{
return
this
.
options
;
return
this
.
options
;
}
}
public
updateOptions
(
key
:
string
,
value
:
any
):
void
{
let
oldValue
=
this
.
options
[
key
];
this
.
options
[
key
]
=
value
;
this
.
eventService
.
emit
(
EventType
.
WORKBENCH_OPTIONS_CHANGED
,
new
OptionsChangeEvent
(
key
,
oldValue
,
value
));
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录