Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
9ce4ebbf
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9ce4ebbf
编写于
3月 03, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - fold electron environment and native environment into one
上级
44c76bd3
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
75 addition
and
112 deletion
+75
-112
src/vs/platform/windows/node/window.ts
src/vs/platform/windows/node/window.ts
+1
-1
src/vs/workbench/contrib/logs/electron-browser/logsActions.ts
...vs/workbench/contrib/logs/electron-browser/logsActions.ts
+4
-3
src/vs/workbench/contrib/splash/electron-browser/partsSplash.contribution.ts
...ntrib/splash/electron-browser/partsSplash.contribution.ts
+3
-4
src/vs/workbench/electron-browser/actions/windowActions.ts
src/vs/workbench/electron-browser/actions/windowActions.ts
+8
-7
src/vs/workbench/electron-browser/desktop.main.ts
src/vs/workbench/electron-browser/desktop.main.ts
+1
-7
src/vs/workbench/electron-browser/window.ts
src/vs/workbench/electron-browser/window.ts
+5
-9
src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts
...es/backup/test/electron-browser/backupFileService.test.ts
+1
-1
src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts
...test/electron-browser/configurationEditingService.test.ts
+1
-1
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
...ration/test/electron-browser/configurationService.test.ts
+1
-1
src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts
...est/electron-browser/configurationResolverService.test.ts
+1
-1
src/vs/workbench/services/electron/electron-browser/electronEnvironmentService.ts
...s/electron/electron-browser/electronEnvironmentService.ts
+0
-37
src/vs/workbench/services/electron/electron-browser/electronService.ts
...nch/services/electron/electron-browser/electronService.ts
+4
-3
src/vs/workbench/services/environment/electron-browser/environmentService.ts
...rvices/environment/electron-browser/environmentService.ts
+11
-6
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
.../services/extensions/electron-browser/extensionService.ts
+4
-5
src/vs/workbench/services/host/electron-browser/desktopHostService.ts
...ench/services/host/electron-browser/desktopHostService.ts
+5
-6
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
...eybinding/test/electron-browser/keybindingEditing.test.ts
+1
-1
src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts
...h/services/lifecycle/electron-browser/lifecycleService.ts
+4
-3
src/vs/workbench/services/output/electron-browser/outputChannelModelService.ts
...ices/output/electron-browser/outputChannelModelService.ts
+3
-4
src/vs/workbench/services/sharedProcess/electron-browser/sharedProcessService.ts
...es/sharedProcess/electron-browser/sharedProcessService.ts
+4
-3
src/vs/workbench/services/url/electron-browser/urlService.ts
src/vs/workbench/services/url/electron-browser/urlService.ts
+5
-4
src/vs/workbench/services/workspaces/electron-browser/workspacesService.ts
...services/workspaces/electron-browser/workspacesService.ts
+4
-3
src/vs/workbench/test/electron-browser/workbenchTestServices.ts
.../workbench/test/electron-browser/workbenchTestServices.ts
+1
-1
src/vs/workbench/workbench.web.main.ts
src/vs/workbench/workbench.web.main.ts
+3
-1
未找到文件。
src/vs/platform/windows/node/window.ts
浏览文件 @
9ce4ebbf
...
@@ -16,7 +16,7 @@ export interface INativeWindowConfiguration extends IWindowConfiguration {
...
@@ -16,7 +16,7 @@ export interface INativeWindowConfiguration extends IWindowConfiguration {
mainPid
:
number
;
mainPid
:
number
;
windowId
:
number
;
windowId
:
number
;
machineId
:
string
;
// NOTE: This is undefined in the web, the telemetry service directly resolves this.
machineId
:
string
;
appRoot
:
string
;
appRoot
:
string
;
execPath
:
string
;
execPath
:
string
;
...
...
src/vs/workbench/contrib/logs/electron-browser/logsActions.ts
浏览文件 @
9ce4ebbf
...
@@ -9,8 +9,9 @@ import { URI } from 'vs/base/common/uri';
...
@@ -9,8 +9,9 @@ import { URI } from 'vs/base/common/uri';
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
I
ElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronE
nvironmentService
'
;
import
{
I
WorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/e
nvironmentService
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
INativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
export
class
OpenLogsFolderAction
extends
Action
{
export
class
OpenLogsFolderAction
extends
Action
{
...
@@ -35,7 +36,7 @@ export class OpenExtensionLogsFolderAction extends Action {
...
@@ -35,7 +36,7 @@ export class OpenExtensionLogsFolderAction extends Action {
static
readonly
LABEL
=
nls
.
localize
(
'
openExtensionLogsFolder
'
,
"
Open Extension Logs Folder
"
);
static
readonly
LABEL
=
nls
.
localize
(
'
openExtensionLogsFolder
'
,
"
Open Extension Logs Folder
"
);
constructor
(
id
:
string
,
label
:
string
,
constructor
(
id
:
string
,
label
:
string
,
@
I
ElectronEnvironmentService
private
readonly
electronEnvironmentSerice
:
IElectron
EnvironmentService
,
@
I
WorkbenchEnvironmentService
private
readonly
environmentSerice
:
INativeWorkbench
EnvironmentService
,
@
IFileService
private
readonly
fileService
:
IFileService
,
@
IFileService
private
readonly
fileService
:
IFileService
,
@
IElectronService
private
readonly
electronService
:
IElectronService
@
IElectronService
private
readonly
electronService
:
IElectronService
)
{
)
{
...
@@ -43,7 +44,7 @@ export class OpenExtensionLogsFolderAction extends Action {
...
@@ -43,7 +44,7 @@ export class OpenExtensionLogsFolderAction extends Action {
}
}
async
run
():
Promise
<
void
>
{
async
run
():
Promise
<
void
>
{
const
folderStat
=
await
this
.
fileService
.
resolve
(
this
.
e
lectronE
nvironmentSerice
.
extHostLogsPath
);
const
folderStat
=
await
this
.
fileService
.
resolve
(
this
.
environmentSerice
.
extHostLogsPath
);
if
(
folderStat
.
children
&&
folderStat
.
children
[
0
])
{
if
(
folderStat
.
children
&&
folderStat
.
children
[
0
])
{
return
this
.
electronService
.
showItemInFolder
(
folderStat
.
children
[
0
].
resource
.
fsPath
);
return
this
.
electronService
.
showItemInFolder
(
folderStat
.
children
[
0
].
resource
.
fsPath
);
}
}
...
...
src/vs/workbench/contrib/splash/electron-browser/partsSplash.contribution.ts
浏览文件 @
9ce4ebbf
...
@@ -24,7 +24,7 @@ import { URI } from 'vs/base/common/uri';
...
@@ -24,7 +24,7 @@ import { URI } from 'vs/base/common/uri';
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
*
as
perf
from
'
vs/base/common/performance
'
;
import
*
as
perf
from
'
vs/base/common/performance
'
;
import
{
I
ElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronE
nvironmentService
'
;
import
{
I
NativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/e
nvironmentService
'
;
import
{
assertIsDefined
}
from
'
vs/base/common/types
'
;
import
{
assertIsDefined
}
from
'
vs/base/common/types
'
;
class
PartsSplash
{
class
PartsSplash
{
...
@@ -41,8 +41,7 @@ class PartsSplash {
...
@@ -41,8 +41,7 @@ class PartsSplash {
@
IThemeService
private
readonly
_themeService
:
IThemeService
,
@
IThemeService
private
readonly
_themeService
:
IThemeService
,
@
IWorkbenchLayoutService
private
readonly
_layoutService
:
IWorkbenchLayoutService
,
@
IWorkbenchLayoutService
private
readonly
_layoutService
:
IWorkbenchLayoutService
,
@
ITextFileService
private
readonly
_textFileService
:
ITextFileService
,
@
ITextFileService
private
readonly
_textFileService
:
ITextFileService
,
@
IWorkbenchEnvironmentService
private
readonly
_envService
:
IWorkbenchEnvironmentService
,
@
IWorkbenchEnvironmentService
private
readonly
_envService
:
INativeWorkbenchEnvironmentService
,
@
IElectronEnvironmentService
private
readonly
_electronEnvService
:
IElectronEnvironmentService
,
@
ILifecycleService
lifecycleService
:
ILifecycleService
,
@
ILifecycleService
lifecycleService
:
ILifecycleService
,
@
IEditorGroupsService
editorGroupsService
:
IEditorGroupsService
,
@
IEditorGroupsService
editorGroupsService
:
IEditorGroupsService
,
@
IConfigurationService
configService
:
IConfigurationService
,
@
IConfigurationService
configService
:
IConfigurationService
,
...
@@ -113,7 +112,7 @@ class PartsSplash {
...
@@ -113,7 +112,7 @@ class PartsSplash {
// the color needs to be in hex
// the color needs to be in hex
const
backgroundColor
=
this
.
_themeService
.
getColorTheme
().
getColor
(
editorBackground
)
||
themes
.
WORKBENCH_BACKGROUND
(
this
.
_themeService
.
getColorTheme
());
const
backgroundColor
=
this
.
_themeService
.
getColorTheme
().
getColor
(
editorBackground
)
||
themes
.
WORKBENCH_BACKGROUND
(
this
.
_themeService
.
getColorTheme
());
const
payload
=
JSON
.
stringify
({
baseTheme
,
background
:
Color
.
Format
.
CSS
.
formatHex
(
backgroundColor
)
});
const
payload
=
JSON
.
stringify
({
baseTheme
,
background
:
Color
.
Format
.
CSS
.
formatHex
(
backgroundColor
)
});
ipc
.
send
(
'
vscode:changeColorTheme
'
,
this
.
_e
lectronEnvService
.
windowId
,
payload
);
ipc
.
send
(
'
vscode:changeColorTheme
'
,
this
.
_e
nvService
.
configuration
.
windowId
,
payload
);
}
}
}
}
...
...
src/vs/workbench/electron-browser/actions/windowActions.ts
浏览文件 @
9ce4ebbf
...
@@ -18,7 +18,8 @@ import { ICommandHandler } from 'vs/platform/commands/common/commands';
...
@@ -18,7 +18,8 @@ import { ICommandHandler } from 'vs/platform/commands/common/commands';
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
import
{
INativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
export
class
CloseCurrentWindowAction
extends
Action
{
export
class
CloseCurrentWindowAction
extends
Action
{
...
@@ -167,7 +168,7 @@ export abstract class BaseSwitchWindow extends Action {
...
@@ -167,7 +168,7 @@ export abstract class BaseSwitchWindow extends Action {
constructor
(
constructor
(
id
:
string
,
id
:
string
,
label
:
string
,
label
:
string
,
private
e
lectronEnvironmentService
:
IElectron
EnvironmentService
,
private
e
nvironmentService
:
INativeWorkbench
EnvironmentService
,
private
quickInputService
:
IQuickInputService
,
private
quickInputService
:
IQuickInputService
,
private
keybindingService
:
IKeybindingService
,
private
keybindingService
:
IKeybindingService
,
private
modelService
:
IModelService
,
private
modelService
:
IModelService
,
...
@@ -180,7 +181,7 @@ export abstract class BaseSwitchWindow extends Action {
...
@@ -180,7 +181,7 @@ export abstract class BaseSwitchWindow extends Action {
protected
abstract
isQuickNavigate
():
boolean
;
protected
abstract
isQuickNavigate
():
boolean
;
async
run
():
Promise
<
void
>
{
async
run
():
Promise
<
void
>
{
const
currentWindowId
=
this
.
e
lectronEnvironmentService
.
windowId
;
const
currentWindowId
=
this
.
e
nvironmentService
.
configuration
.
windowId
;
const
windows
=
await
this
.
electronService
.
getWindows
();
const
windows
=
await
this
.
electronService
.
getWindows
();
const
placeHolder
=
nls
.
localize
(
'
switchWindowPlaceHolder
'
,
"
Select a window to switch to
"
);
const
placeHolder
=
nls
.
localize
(
'
switchWindowPlaceHolder
'
,
"
Select a window to switch to
"
);
...
@@ -222,14 +223,14 @@ export class SwitchWindow extends BaseSwitchWindow {
...
@@ -222,14 +223,14 @@ export class SwitchWindow extends BaseSwitchWindow {
constructor
(
constructor
(
id
:
string
,
id
:
string
,
label
:
string
,
label
:
string
,
@
I
ElectronEnvironmentService
electronEnvironmentService
:
IElectron
EnvironmentService
,
@
I
WorkbenchEnvironmentService
environmentService
:
INativeWorkbench
EnvironmentService
,
@
IQuickInputService
quickInputService
:
IQuickInputService
,
@
IQuickInputService
quickInputService
:
IQuickInputService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IModelService
modelService
:
IModelService
,
@
IModelService
modelService
:
IModelService
,
@
IModeService
modeService
:
IModeService
,
@
IModeService
modeService
:
IModeService
,
@
IElectronService
electronService
:
IElectronService
@
IElectronService
electronService
:
IElectronService
)
{
)
{
super
(
id
,
label
,
e
lectronE
nvironmentService
,
quickInputService
,
keybindingService
,
modelService
,
modeService
,
electronService
);
super
(
id
,
label
,
environmentService
,
quickInputService
,
keybindingService
,
modelService
,
modeService
,
electronService
);
}
}
protected
isQuickNavigate
():
boolean
{
protected
isQuickNavigate
():
boolean
{
...
@@ -245,14 +246,14 @@ export class QuickSwitchWindow extends BaseSwitchWindow {
...
@@ -245,14 +246,14 @@ export class QuickSwitchWindow extends BaseSwitchWindow {
constructor
(
constructor
(
id
:
string
,
id
:
string
,
label
:
string
,
label
:
string
,
@
I
ElectronEnvironmentService
electronEnvironmentService
:
IElectron
EnvironmentService
,
@
I
WorkbenchEnvironmentService
environmentService
:
INativeWorkbench
EnvironmentService
,
@
IQuickInputService
quickInputService
:
IQuickInputService
,
@
IQuickInputService
quickInputService
:
IQuickInputService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IModelService
modelService
:
IModelService
,
@
IModelService
modelService
:
IModelService
,
@
IModeService
modeService
:
IModeService
,
@
IModeService
modeService
:
IModeService
,
@
IElectronService
electronService
:
IElectronService
@
IElectronService
electronService
:
IElectronService
)
{
)
{
super
(
id
,
label
,
e
lectronE
nvironmentService
,
quickInputService
,
keybindingService
,
modelService
,
modeService
,
electronService
);
super
(
id
,
label
,
environmentService
,
quickInputService
,
keybindingService
,
modelService
,
modeService
,
electronService
);
}
}
protected
isQuickNavigate
():
boolean
{
protected
isQuickNavigate
():
boolean
{
...
...
src/vs/workbench/electron-browser/desktop.main.ts
浏览文件 @
9ce4ebbf
...
@@ -51,7 +51,6 @@ import { FileUserDataProvider } from 'vs/workbench/services/userData/common/file
...
@@ -51,7 +51,6 @@ import { FileUserDataProvider } from 'vs/workbench/services/userData/common/file
import
{
basename
}
from
'
vs/base/common/resources
'
;
import
{
basename
}
from
'
vs/base/common/resources
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
product
from
'
vs/platform/product/common/product
'
;
import
product
from
'
vs/platform/product/common/product
'
;
import
{
ElectronEnvironmentService
,
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
class
DesktopMain
extends
Disposable
{
class
DesktopMain
extends
Disposable
{
...
@@ -60,7 +59,7 @@ class DesktopMain extends Disposable {
...
@@ -60,7 +59,7 @@ class DesktopMain extends Disposable {
constructor
(
private
configuration
:
INativeWindowConfiguration
)
{
constructor
(
private
configuration
:
INativeWindowConfiguration
)
{
super
();
super
();
this
.
environmentService
=
new
NativeWorkbenchEnvironmentService
(
configuration
,
configuration
.
execPath
,
configuration
.
windowId
);
this
.
environmentService
=
new
NativeWorkbenchEnvironmentService
(
configuration
,
configuration
.
execPath
);
this
.
init
();
this
.
init
();
}
}
...
@@ -180,11 +179,6 @@ class DesktopMain extends Disposable {
...
@@ -180,11 +179,6 @@ class DesktopMain extends Disposable {
// Environment
// Environment
serviceCollection
.
set
(
IWorkbenchEnvironmentService
,
this
.
environmentService
);
serviceCollection
.
set
(
IWorkbenchEnvironmentService
,
this
.
environmentService
);
serviceCollection
.
set
(
IElectronEnvironmentService
,
new
ElectronEnvironmentService
(
this
.
configuration
.
windowId
,
this
.
environmentService
.
sharedIPCHandle
,
this
.
environmentService
));
// Product
// Product
serviceCollection
.
set
(
IProductService
,
{
_serviceBrand
:
undefined
,
...
product
});
serviceCollection
.
set
(
IProductService
,
{
_serviceBrand
:
undefined
,
...
product
});
...
...
src/vs/workbench/electron-browser/window.ts
浏览文件 @
9ce4ebbf
...
@@ -58,7 +58,6 @@ import { getBaseLabel } from 'vs/base/common/labels';
...
@@ -58,7 +58,6 @@ import { getBaseLabel } from 'vs/base/common/labels';
import
{
ITunnelService
,
extractLocalHostUriMetaDataForPortMapping
}
from
'
vs/platform/remote/common/tunnel
'
;
import
{
ITunnelService
,
extractLocalHostUriMetaDataForPortMapping
}
from
'
vs/platform/remote/common/tunnel
'
;
import
{
IWorkbenchLayoutService
,
Parts
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
IWorkbenchLayoutService
,
Parts
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
IHostService
}
from
'
vs/workbench/services/host/browser/host
'
;
import
{
IHostService
}
from
'
vs/workbench/services/host/browser/host
'
;
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
import
{
IWorkingCopyService
,
WorkingCopyCapabilities
}
from
'
vs/workbench/services/workingCopy/common/workingCopyService
'
;
import
{
IWorkingCopyService
,
WorkingCopyCapabilities
}
from
'
vs/workbench/services/workingCopy/common/workingCopyService
'
;
import
{
AutoSaveMode
,
IFilesConfigurationService
}
from
'
vs/workbench/services/filesConfiguration/common/filesConfigurationService
'
;
import
{
AutoSaveMode
,
IFilesConfigurationService
}
from
'
vs/workbench/services/filesConfiguration/common/filesConfigurationService
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
...
@@ -69,7 +68,6 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
...
@@ -69,7 +68,6 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
export
class
ElectronWindow
extends
Disposable
{
export
class
ElectronWindow
extends
Disposable
{
private
touchBarMenu
:
IMenu
|
undefined
;
private
touchBarMenu
:
IMenu
|
undefined
;
...
@@ -109,7 +107,6 @@ export class ElectronWindow extends Disposable {
...
@@ -109,7 +107,6 @@ export class ElectronWindow extends Disposable {
@
IElectronService
private
readonly
electronService
:
IElectronService
,
@
IElectronService
private
readonly
electronService
:
IElectronService
,
@
ITunnelService
private
readonly
tunnelService
:
ITunnelService
,
@
ITunnelService
private
readonly
tunnelService
:
ITunnelService
,
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
,
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
,
@
IElectronEnvironmentService
private
readonly
electronEnvironmentService
:
IElectronEnvironmentService
,
@
IWorkingCopyService
private
readonly
workingCopyService
:
IWorkingCopyService
,
@
IWorkingCopyService
private
readonly
workingCopyService
:
IWorkingCopyService
,
@
IFilesConfigurationService
private
readonly
filesConfigurationService
:
IFilesConfigurationService
@
IFilesConfigurationService
private
readonly
filesConfigurationService
:
IFilesConfigurationService
)
{
)
{
...
@@ -287,8 +284,8 @@ export class ElectronWindow extends Disposable {
...
@@ -287,8 +284,8 @@ export class ElectronWindow extends Disposable {
// Detect minimize / maximize
// Detect minimize / maximize
this
.
_register
(
Event
.
any
(
this
.
_register
(
Event
.
any
(
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowMaximize
,
id
=>
id
===
this
.
e
lectronEnvironmentService
.
windowId
),
()
=>
true
),
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowMaximize
,
id
=>
id
===
this
.
e
nvironmentService
.
configuration
.
windowId
),
()
=>
true
),
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowUnmaximize
,
id
=>
id
===
this
.
e
lectronEnvironmentService
.
windowId
),
()
=>
false
)
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowUnmaximize
,
id
=>
id
===
this
.
e
nvironmentService
.
configuration
.
windowId
),
()
=>
false
)
)(
e
=>
this
.
onDidChangeMaximized
(
e
)));
)(
e
=>
this
.
onDidChangeMaximized
(
e
)));
this
.
onDidChangeMaximized
(
this
.
environmentService
.
configuration
.
maximized
??
false
);
this
.
onDidChangeMaximized
(
this
.
environmentService
.
configuration
.
maximized
??
false
);
...
@@ -402,7 +399,7 @@ export class ElectronWindow extends Disposable {
...
@@ -402,7 +399,7 @@ export class ElectronWindow extends Disposable {
this
.
setupOpenHandlers
();
this
.
setupOpenHandlers
();
// Emit event when vscode is ready
// Emit event when vscode is ready
this
.
lifecycleService
.
when
(
LifecyclePhase
.
Ready
).
then
(()
=>
ipc
.
send
(
'
vscode:workbenchReady
'
,
this
.
e
lectronEnvironmentService
.
windowId
));
this
.
lifecycleService
.
when
(
LifecyclePhase
.
Ready
).
then
(()
=>
ipc
.
send
(
'
vscode:workbenchReady
'
,
this
.
e
nvironmentService
.
configuration
.
windowId
));
// Integrity warning
// Integrity warning
this
.
integrityService
.
isPure
().
then
(
res
=>
this
.
titleService
.
updateProperties
({
isPure
:
res
.
isPure
}));
this
.
integrityService
.
isPure
().
then
(
res
=>
this
.
titleService
.
updateProperties
({
isPure
:
res
.
isPure
}));
...
@@ -704,11 +701,10 @@ class NativeMenubarControl extends MenubarControl {
...
@@ -704,11 +701,10 @@ class NativeMenubarControl extends MenubarControl {
@
IStorageService
storageService
:
IStorageService
,
@
IStorageService
storageService
:
IStorageService
,
@
INotificationService
notificationService
:
INotificationService
,
@
INotificationService
notificationService
:
INotificationService
,
@
IPreferencesService
preferencesService
:
IPreferencesService
,
@
IPreferencesService
preferencesService
:
IPreferencesService
,
@
IWorkbenchEnvironmentService
environmentService
:
I
WorkbenchEnvironmentService
,
@
IWorkbenchEnvironmentService
protected
readonly
environmentService
:
INative
WorkbenchEnvironmentService
,
@
IAccessibilityService
accessibilityService
:
IAccessibilityService
,
@
IAccessibilityService
accessibilityService
:
IAccessibilityService
,
@
IMenubarService
private
readonly
menubarService
:
IMenubarService
,
@
IMenubarService
private
readonly
menubarService
:
IMenubarService
,
@
IHostService
hostService
:
IHostService
,
@
IHostService
hostService
:
IHostService
,
@
IElectronEnvironmentService
private
readonly
electronEnvironmentService
:
IElectronEnvironmentService
)
{
)
{
super
(
super
(
menuService
,
menuService
,
...
@@ -757,7 +753,7 @@ class NativeMenubarControl extends MenubarControl {
...
@@ -757,7 +753,7 @@ class NativeMenubarControl extends MenubarControl {
// Send menus to main process to be rendered by Electron
// Send menus to main process to be rendered by Electron
const
menubarData
=
{
menus
:
{},
keybindings
:
{}
};
const
menubarData
=
{
menus
:
{},
keybindings
:
{}
};
if
(
this
.
getMenubarMenus
(
menubarData
))
{
if
(
this
.
getMenubarMenus
(
menubarData
))
{
this
.
menubarService
.
updateMenubar
(
this
.
e
lectronEnvironmentService
.
windowId
,
menubarData
);
this
.
menubarService
.
updateMenubar
(
this
.
e
nvironmentService
.
configuration
.
windowId
,
menubarData
);
}
}
}
}
...
...
src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts
浏览文件 @
9ce4ebbf
...
@@ -48,7 +48,7 @@ const untitledBackupPath = path.join(workspaceBackupPath, 'untitled', hashPath(u
...
@@ -48,7 +48,7 @@ const untitledBackupPath = path.join(workspaceBackupPath, 'untitled', hashPath(u
class
TestBackupEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
class
TestBackupEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
constructor
(
backupPath
:
string
)
{
constructor
(
backupPath
:
string
)
{
super
({
...
TestWindowConfiguration
,
backupPath
,
'
user-data-dir
'
:
userdataDir
},
TestWindowConfiguration
.
execPath
,
TestWindowConfiguration
.
windowId
);
super
({
...
TestWindowConfiguration
,
backupPath
,
'
user-data-dir
'
:
userdataDir
},
TestWindowConfiguration
.
execPath
);
}
}
}
}
...
...
src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts
浏览文件 @
9ce4ebbf
...
@@ -45,7 +45,7 @@ import { FileUserDataProvider } from 'vs/workbench/services/userData/common/file
...
@@ -45,7 +45,7 @@ import { FileUserDataProvider } from 'vs/workbench/services/userData/common/file
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
constructor
(
private
_appSettingsHome
:
URI
)
{
constructor
(
private
_appSettingsHome
:
URI
)
{
super
(
TestWindowConfiguration
,
TestWindowConfiguration
.
execPath
,
TestWindowConfiguration
.
windowId
);
super
(
TestWindowConfiguration
,
TestWindowConfiguration
.
execPath
);
}
}
get
appSettingsHome
()
{
return
this
.
_appSettingsHome
;
}
get
appSettingsHome
()
{
return
this
.
_appSettingsHome
;
}
...
...
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
浏览文件 @
9ce4ebbf
...
@@ -51,7 +51,7 @@ import { timeout } from 'vs/base/common/async';
...
@@ -51,7 +51,7 @@ import { timeout } from 'vs/base/common/async';
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
constructor
(
private
_appSettingsHome
:
URI
)
{
constructor
(
private
_appSettingsHome
:
URI
)
{
super
(
TestWindowConfiguration
,
TestWindowConfiguration
.
execPath
,
TestWindowConfiguration
.
windowId
);
super
(
TestWindowConfiguration
,
TestWindowConfiguration
.
execPath
);
}
}
get
appSettingsHome
()
{
return
this
.
_appSettingsHome
;
}
get
appSettingsHome
()
{
return
this
.
_appSettingsHome
;
}
...
...
src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts
浏览文件 @
9ce4ebbf
...
@@ -623,6 +623,6 @@ class MockInputsConfigurationService extends TestConfigurationService {
...
@@ -623,6 +623,6 @@ class MockInputsConfigurationService extends TestConfigurationService {
class
MockWorkbenchEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
class
MockWorkbenchEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
constructor
(
public
userEnv
:
platform
.
IProcessEnvironment
)
{
constructor
(
public
userEnv
:
platform
.
IProcessEnvironment
)
{
super
({
...
TestWindowConfiguration
,
userEnv
},
TestWindowConfiguration
.
execPath
,
TestWindowConfiguration
.
windowId
);
super
({
...
TestWindowConfiguration
,
userEnv
},
TestWindowConfiguration
.
execPath
);
}
}
}
}
src/vs/workbench/services/electron/electron-browser/electronEnvironmentService.ts
已删除
100644 → 0
浏览文件 @
44c76bd3
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
memoize
}
from
'
vs/base/common/decorators
'
;
import
{
join
}
from
'
vs/base/common/path
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
export
const
IElectronEnvironmentService
=
createDecorator
<
IElectronEnvironmentService
>
(
'
electronEnvironmentService
'
);
export
interface
IElectronEnvironmentService
{
_serviceBrand
:
undefined
;
readonly
windowId
:
number
;
readonly
sharedIPCHandle
:
string
;
readonly
extHostLogsPath
:
URI
;
}
export
class
ElectronEnvironmentService
implements
IElectronEnvironmentService
{
_serviceBrand
:
undefined
;
constructor
(
public
readonly
windowId
:
number
,
public
readonly
sharedIPCHandle
:
string
,
private
readonly
environmentService
:
IEnvironmentService
)
{
}
@
memoize
get
extHostLogsPath
():
URI
{
return
URI
.
file
(
join
(
this
.
environmentService
.
logsPath
,
`exthost
${
this
.
windowId
}
`
));
}
}
src/vs/workbench/services/electron/electron-browser/electronService.ts
浏览文件 @
9ce4ebbf
...
@@ -6,8 +6,9 @@
...
@@ -6,8 +6,9 @@
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-browser/mainProcessService
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-browser/mainProcessService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
I
ElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronE
nvironmentService
'
;
import
{
I
NativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/e
nvironmentService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
export
class
ElectronService
{
export
class
ElectronService
{
...
@@ -15,9 +16,9 @@ export class ElectronService {
...
@@ -15,9 +16,9 @@ export class ElectronService {
constructor
(
constructor
(
@
IMainProcessService
mainProcessService
:
IMainProcessService
,
@
IMainProcessService
mainProcessService
:
IMainProcessService
,
@
I
ElectronEnvironmentService
electronEnvironmentService
:
IElectron
EnvironmentService
@
I
WorkbenchEnvironmentService
environmentService
:
INativeWorkbench
EnvironmentService
)
{
)
{
return
createChannelSender
<
IElectronService
>
(
mainProcessService
.
getChannel
(
'
electron
'
),
{
context
:
e
lectronEnvironmentService
.
windowId
});
return
createChannelSender
<
IElectronService
>
(
mainProcessService
.
getChannel
(
'
electron
'
),
{
context
:
e
nvironmentService
.
configuration
.
windowId
});
}
}
}
}
...
...
src/vs/workbench/services/environment/electron-browser/environmentService.ts
浏览文件 @
9ce4ebbf
...
@@ -17,9 +17,12 @@ export interface INativeWorkbenchEnvironmentService extends IWorkbenchEnvironmen
...
@@ -17,9 +17,12 @@ export interface INativeWorkbenchEnvironmentService extends IWorkbenchEnvironmen
readonly
configuration
:
INativeWindowConfiguration
;
readonly
configuration
:
INativeWindowConfiguration
;
log
?:
string
;
readonly
disableCrashReporter
:
boolean
;
cliPath
:
string
;
disableCrashReporter
:
boolean
;
readonly
cliPath
:
string
;
readonly
log
?:
string
;
readonly
extHostLogsPath
:
URI
;
}
}
export
class
NativeWorkbenchEnvironmentService
extends
EnvironmentService
implements
INativeWorkbenchEnvironmentService
{
export
class
NativeWorkbenchEnvironmentService
extends
EnvironmentService
implements
INativeWorkbenchEnvironmentService
{
...
@@ -43,12 +46,14 @@ export class NativeWorkbenchEnvironmentService extends EnvironmentService implem
...
@@ -43,12 +46,14 @@ export class NativeWorkbenchEnvironmentService extends EnvironmentService implem
get
userRoamingDataHome
():
URI
{
return
this
.
appSettingsHome
.
with
({
scheme
:
Schemas
.
userData
});
}
get
userRoamingDataHome
():
URI
{
return
this
.
appSettingsHome
.
with
({
scheme
:
Schemas
.
userData
});
}
@
memoize
@
memoize
get
logFile
():
URI
{
return
URI
.
file
(
join
(
this
.
logsPath
,
`renderer
${
this
.
windowId
}
.log`
));
}
get
logFile
():
URI
{
return
URI
.
file
(
join
(
this
.
logsPath
,
`renderer
${
this
.
configuration
.
windowId
}
.log`
));
}
@
memoize
get
extHostLogsPath
():
URI
{
return
URI
.
file
(
join
(
this
.
logsPath
,
`exthost
${
this
.
configuration
.
windowId
}
`
));
}
constructor
(
constructor
(
readonly
configuration
:
INativeWindowConfiguration
,
readonly
configuration
:
INativeWindowConfiguration
,
execPath
:
string
,
execPath
:
string
private
readonly
windowId
:
number
)
{
)
{
super
(
configuration
,
execPath
);
super
(
configuration
,
execPath
);
...
...
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
浏览文件 @
9ce4ebbf
...
@@ -35,7 +35,7 @@ import { Logger } from 'vs/workbench/services/extensions/common/extensionPoints'
...
@@ -35,7 +35,7 @@ import { Logger } from 'vs/workbench/services/extensions/common/extensionPoints'
import
{
flatten
}
from
'
vs/base/common/arrays
'
;
import
{
flatten
}
from
'
vs/base/common/arrays
'
;
import
{
IStaticExtensionsService
}
from
'
vs/workbench/services/extensions/common/staticExtensions
'
;
import
{
IStaticExtensionsService
}
from
'
vs/workbench/services/extensions/common/staticExtensions
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
I
ElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronE
nvironmentService
'
;
import
{
I
NativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/e
nvironmentService
'
;
import
{
IRemoteExplorerService
}
from
'
vs/workbench/services/remote/common/remoteExplorerService
'
;
import
{
IRemoteExplorerService
}
from
'
vs/workbench/services/remote/common/remoteExplorerService
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
...
@@ -60,7 +60,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
...
@@ -60,7 +60,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
constructor
(
constructor
(
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
INotificationService
notificationService
:
INotificationService
,
@
INotificationService
notificationService
:
INotificationService
,
@
IWorkbenchEnvironmentService
environmentService
:
I
WorkbenchEnvironmentService
,
@
IWorkbenchEnvironmentService
protected
readonly
_environmentService
:
INative
WorkbenchEnvironmentService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IWorkbenchExtensionEnablementService
extensionEnablementService
:
IWorkbenchExtensionEnablementService
,
@
IWorkbenchExtensionEnablementService
extensionEnablementService
:
IWorkbenchExtensionEnablementService
,
@
IFileService
fileService
:
IFileService
,
@
IFileService
fileService
:
IFileService
,
...
@@ -73,14 +73,13 @@ export class ExtensionService extends AbstractExtensionService implements IExten
...
@@ -73,14 +73,13 @@ export class ExtensionService extends AbstractExtensionService implements IExten
@
IStaticExtensionsService
private
readonly
_staticExtensions
:
IStaticExtensionsService
,
@
IStaticExtensionsService
private
readonly
_staticExtensions
:
IStaticExtensionsService
,
@
IElectronService
private
readonly
_electronService
:
IElectronService
,
@
IElectronService
private
readonly
_electronService
:
IElectronService
,
@
IHostService
private
readonly
_hostService
:
IHostService
,
@
IHostService
private
readonly
_hostService
:
IHostService
,
@
IElectronEnvironmentService
private
readonly
_electronEnvironmentService
:
IElectronEnvironmentService
,
@
IRemoteExplorerService
private
readonly
_remoteExplorerService
:
IRemoteExplorerService
,
@
IRemoteExplorerService
private
readonly
_remoteExplorerService
:
IRemoteExplorerService
,
@
IExtensionGalleryService
private
readonly
_extensionGalleryService
:
IExtensionGalleryService
,
@
IExtensionGalleryService
private
readonly
_extensionGalleryService
:
IExtensionGalleryService
,
)
{
)
{
super
(
super
(
instantiationService
,
instantiationService
,
notificationService
,
notificationService
,
environmentService
,
_
environmentService
,
telemetryService
,
telemetryService
,
extensionEnablementService
,
extensionEnablementService
,
fileService
,
fileService
,
...
@@ -361,7 +360,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
...
@@ -361,7 +360,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
const
result
:
ExtensionHostProcessManager
[]
=
[];
const
result
:
ExtensionHostProcessManager
[]
=
[];
const
extHostProcessWorker
=
this
.
_instantiationService
.
createInstance
(
ExtensionHostProcessWorker
,
autoStart
,
extensions
,
this
.
_e
lectronE
nvironmentService
.
extHostLogsPath
);
const
extHostProcessWorker
=
this
.
_instantiationService
.
createInstance
(
ExtensionHostProcessWorker
,
autoStart
,
extensions
,
this
.
_environmentService
.
extHostLogsPath
);
const
extHostProcessManager
=
this
.
_instantiationService
.
createInstance
(
ExtensionHostProcessManager
,
true
,
extHostProcessWorker
,
null
,
initialActivationEvents
);
const
extHostProcessManager
=
this
.
_instantiationService
.
createInstance
(
ExtensionHostProcessManager
,
true
,
extHostProcessWorker
,
null
,
initialActivationEvents
);
result
.
push
(
extHostProcessManager
);
result
.
push
(
extHostProcessManager
);
...
...
src/vs/workbench/services/host/electron-browser/desktopHostService.ts
浏览文件 @
9ce4ebbf
...
@@ -11,7 +11,7 @@ import { ILabelService } from 'vs/platform/label/common/label';
...
@@ -11,7 +11,7 @@ import { ILabelService } from 'vs/platform/label/common/label';
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IWindowOpenable
,
IOpenWindowOptions
,
isFolderToOpen
,
isWorkspaceToOpen
,
IOpenEmptyWindowOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowOpenable
,
IOpenWindowOptions
,
isFolderToOpen
,
isWorkspaceToOpen
,
IOpenEmptyWindowOptions
}
from
'
vs/platform/windows/common/windows
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
I
ElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronE
nvironmentService
'
;
import
{
I
NativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/e
nvironmentService
'
;
export
class
DesktopHostService
extends
Disposable
implements
IHostService
{
export
class
DesktopHostService
extends
Disposable
implements
IHostService
{
...
@@ -20,16 +20,15 @@ export class DesktopHostService extends Disposable implements IHostService {
...
@@ -20,16 +20,15 @@ export class DesktopHostService extends Disposable implements IHostService {
constructor
(
constructor
(
@
IElectronService
private
readonly
electronService
:
IElectronService
,
@
IElectronService
private
readonly
electronService
:
IElectronService
,
@
ILabelService
private
readonly
labelService
:
ILabelService
,
@
ILabelService
private
readonly
labelService
:
ILabelService
,
@
IWorkbenchEnvironmentService
private
readonly
environmentService
:
IWorkbenchEnvironmentService
,
@
IWorkbenchEnvironmentService
private
readonly
environmentService
:
INativeWorkbenchEnvironmentService
@
IElectronEnvironmentService
private
readonly
electronEnvironmentService
:
IElectronEnvironmentService
)
{
)
{
super
();
super
();
}
}
get
onDidChangeFocus
():
Event
<
boolean
>
{
return
this
.
_onDidChangeFocus
;
}
get
onDidChangeFocus
():
Event
<
boolean
>
{
return
this
.
_onDidChangeFocus
;
}
private
_onDidChangeFocus
:
Event
<
boolean
>
=
Event
.
any
(
private
_onDidChangeFocus
:
Event
<
boolean
>
=
Event
.
any
(
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowFocus
,
id
=>
id
===
this
.
e
lectronEnvironmentService
.
windowId
),
()
=>
this
.
hasFocus
),
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowFocus
,
id
=>
id
===
this
.
e
nvironmentService
.
configuration
.
windowId
),
()
=>
this
.
hasFocus
),
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowBlur
,
id
=>
id
===
this
.
e
lectronEnvironmentService
.
windowId
),
()
=>
this
.
hasFocus
)
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowBlur
,
id
=>
id
===
this
.
e
nvironmentService
.
configuration
.
windowId
),
()
=>
this
.
hasFocus
)
);
);
get
hasFocus
():
boolean
{
get
hasFocus
():
boolean
{
...
@@ -43,7 +42,7 @@ export class DesktopHostService extends Disposable implements IHostService {
...
@@ -43,7 +42,7 @@ export class DesktopHostService extends Disposable implements IHostService {
return
false
;
return
false
;
}
}
return
activeWindowId
===
this
.
e
lectronEnvironmentService
.
windowId
;
return
activeWindowId
===
this
.
e
nvironmentService
.
configuration
.
windowId
;
}
}
openWindow
(
options
?:
IOpenEmptyWindowOptions
):
Promise
<
void
>
;
openWindow
(
options
?:
IOpenEmptyWindowOptions
):
Promise
<
void
>
;
...
...
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
浏览文件 @
9ce4ebbf
...
@@ -58,7 +58,7 @@ import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService';
...
@@ -58,7 +58,7 @@ import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService';
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
constructor
(
private
_appSettingsHome
:
URI
)
{
constructor
(
private
_appSettingsHome
:
URI
)
{
super
(
TestWindowConfiguration
,
TestWindowConfiguration
.
execPath
,
TestWindowConfiguration
.
windowId
);
super
(
TestWindowConfiguration
,
TestWindowConfiguration
.
execPath
);
}
}
get
appSettingsHome
()
{
return
this
.
_appSettingsHome
;
}
get
appSettingsHome
()
{
return
this
.
_appSettingsHome
;
}
...
...
src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts
浏览文件 @
9ce4ebbf
...
@@ -7,7 +7,6 @@ import { toErrorMessage } from 'vs/base/common/errorMessage';
...
@@ -7,7 +7,6 @@ import { toErrorMessage } from 'vs/base/common/errorMessage';
import
{
ShutdownReason
,
StartupKind
,
handleVetos
,
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
ShutdownReason
,
StartupKind
,
handleVetos
,
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IStorageService
,
StorageScope
,
WillSaveStateReason
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IStorageService
,
StorageScope
,
WillSaveStateReason
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ipcRenderer
as
ipc
}
from
'
electron
'
;
import
{
ipcRenderer
as
ipc
}
from
'
electron
'
;
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
...
@@ -15,6 +14,8 @@ import { AbstractLifecycleService } from 'vs/platform/lifecycle/common/lifecycle
...
@@ -15,6 +14,8 @@ import { AbstractLifecycleService } from 'vs/platform/lifecycle/common/lifecycle
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
INativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
export
class
NativeLifecycleService
extends
AbstractLifecycleService
{
export
class
NativeLifecycleService
extends
AbstractLifecycleService
{
...
@@ -26,7 +27,7 @@ export class NativeLifecycleService extends AbstractLifecycleService {
...
@@ -26,7 +27,7 @@ export class NativeLifecycleService extends AbstractLifecycleService {
constructor
(
constructor
(
@
INotificationService
private
readonly
notificationService
:
INotificationService
,
@
INotificationService
private
readonly
notificationService
:
INotificationService
,
@
I
ElectronEnvironmentService
private
readonly
electronEnvironmentService
:
IElectron
EnvironmentService
,
@
I
WorkbenchEnvironmentService
private
readonly
environmentService
:
INativeWorkbench
EnvironmentService
,
@
IStorageService
readonly
storageService
:
IStorageService
,
@
IStorageService
readonly
storageService
:
IStorageService
,
@
ILogService
readonly
logService
:
ILogService
@
ILogService
readonly
logService
:
ILogService
)
{
)
{
...
@@ -56,7 +57,7 @@ export class NativeLifecycleService extends AbstractLifecycleService {
...
@@ -56,7 +57,7 @@ export class NativeLifecycleService extends AbstractLifecycleService {
}
}
private
registerListeners
():
void
{
private
registerListeners
():
void
{
const
windowId
=
this
.
e
lectronEnvironmentService
.
windowId
;
const
windowId
=
this
.
e
nvironmentService
.
configuration
.
windowId
;
// Main side indicates that window is about to unload, check for vetos
// Main side indicates that window is about to unload, check for vetos
ipc
.
on
(
'
vscode:onBeforeUnload
'
,
(
_event
:
unknown
,
reply
:
{
okChannel
:
string
,
cancelChannel
:
string
,
reason
:
ShutdownReason
})
=>
{
ipc
.
on
(
'
vscode:onBeforeUnload
'
,
(
_event
:
unknown
,
reply
:
{
okChannel
:
string
,
cancelChannel
:
string
,
reason
:
ShutdownReason
})
=>
{
...
...
src/vs/workbench/services/output/electron-browser/outputChannelModelService.ts
浏览文件 @
9ce4ebbf
...
@@ -21,7 +21,7 @@ import { toLocalISOString } from 'vs/base/common/date';
...
@@ -21,7 +21,7 @@ import { toLocalISOString } from 'vs/base/common/date';
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
I
ElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronE
nvironmentService
'
;
import
{
I
NativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/e
nvironmentService
'
;
class
OutputChannelBackedByFile
extends
AbstractFileOutputChannelModel
implements
IOutputChannelModel
{
class
OutputChannelBackedByFile
extends
AbstractFileOutputChannelModel
implements
IOutputChannelModel
{
...
@@ -203,8 +203,7 @@ export class OutputChannelModelService extends AsbtractOutputChannelModelService
...
@@ -203,8 +203,7 @@ export class OutputChannelModelService extends AsbtractOutputChannelModelService
constructor
(
constructor
(
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IWorkbenchEnvironmentService
private
readonly
environmentService
:
IWorkbenchEnvironmentService
,
@
IWorkbenchEnvironmentService
private
readonly
environmentService
:
INativeWorkbenchEnvironmentService
,
@
IElectronEnvironmentService
private
readonly
electronEnvironmentService
:
IElectronEnvironmentService
,
@
IFileService
private
readonly
fileService
:
IFileService
@
IFileService
private
readonly
fileService
:
IFileService
)
{
)
{
super
(
instantiationService
);
super
(
instantiationService
);
...
@@ -218,7 +217,7 @@ export class OutputChannelModelService extends AsbtractOutputChannelModelService
...
@@ -218,7 +217,7 @@ export class OutputChannelModelService extends AsbtractOutputChannelModelService
private
_outputDir
:
Promise
<
URI
>
|
null
=
null
;
private
_outputDir
:
Promise
<
URI
>
|
null
=
null
;
private
get
outputDir
():
Promise
<
URI
>
{
private
get
outputDir
():
Promise
<
URI
>
{
if
(
!
this
.
_outputDir
)
{
if
(
!
this
.
_outputDir
)
{
const
outputDir
=
URI
.
file
(
join
(
this
.
environmentService
.
logsPath
,
`output_
${
this
.
e
lectronEnvironmentService
.
windowId
}
_
${
toLocalISOString
(
new
Date
()).
replace
(
/-|:|
\.\d
+Z$/g
,
''
)}
`
));
const
outputDir
=
URI
.
file
(
join
(
this
.
environmentService
.
logsPath
,
`output_
${
this
.
e
nvironmentService
.
configuration
.
windowId
}
_
${
toLocalISOString
(
new
Date
()).
replace
(
/-|:|
\.\d
+Z$/g
,
''
)}
`
));
this
.
_outputDir
=
this
.
fileService
.
createFolder
(
outputDir
).
then
(()
=>
outputDir
);
this
.
_outputDir
=
this
.
fileService
.
createFolder
(
outputDir
).
then
(()
=>
outputDir
);
}
}
return
this
.
_outputDir
;
return
this
.
_outputDir
;
...
...
src/vs/workbench/services/sharedProcess/electron-browser/sharedProcessService.ts
浏览文件 @
9ce4ebbf
...
@@ -5,11 +5,12 @@
...
@@ -5,11 +5,12 @@
import
{
Client
}
from
'
vs/base/parts/ipc/common/ipc.net
'
;
import
{
Client
}
from
'
vs/base/parts/ipc/common/ipc.net
'
;
import
{
connect
}
from
'
vs/base/parts/ipc/node/ipc.net
'
;
import
{
connect
}
from
'
vs/base/parts/ipc/node/ipc.net
'
;
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
import
{
IChannel
,
IServerChannel
,
getDelayedChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IChannel
,
IServerChannel
,
getDelayedChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-browser/mainProcessService
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-browser/mainProcessService
'
;
import
{
ISharedProcessService
}
from
'
vs/platform/ipc/electron-browser/sharedProcessService
'
;
import
{
ISharedProcessService
}
from
'
vs/platform/ipc/electron-browser/sharedProcessService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
INativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
export
class
SharedProcessService
implements
ISharedProcessService
{
export
class
SharedProcessService
implements
ISharedProcessService
{
...
@@ -20,12 +21,12 @@ export class SharedProcessService implements ISharedProcessService {
...
@@ -20,12 +21,12 @@ export class SharedProcessService implements ISharedProcessService {
constructor
(
constructor
(
@
IMainProcessService
mainProcessService
:
IMainProcessService
,
@
IMainProcessService
mainProcessService
:
IMainProcessService
,
@
I
ElectronEnvironmentService
environmentService
:
IElectron
EnvironmentService
@
I
WorkbenchEnvironmentService
environmentService
:
INativeWorkbench
EnvironmentService
)
{
)
{
this
.
sharedProcessMainChannel
=
mainProcessService
.
getChannel
(
'
sharedProcess
'
);
this
.
sharedProcessMainChannel
=
mainProcessService
.
getChannel
(
'
sharedProcess
'
);
this
.
withSharedProcessConnection
=
this
.
whenSharedProcessReady
()
this
.
withSharedProcessConnection
=
this
.
whenSharedProcessReady
()
.
then
(()
=>
connect
(
environmentService
.
sharedIPCHandle
,
`window:
${
environmentService
.
windowId
}
`
));
.
then
(()
=>
connect
(
environmentService
.
sharedIPCHandle
,
`window:
${
environmentService
.
configuration
.
windowId
}
`
));
}
}
whenSharedProcessReady
():
Promise
<
void
>
{
whenSharedProcessReady
():
Promise
<
void
>
{
...
...
src/vs/workbench/services/url/electron-browser/urlService.ts
浏览文件 @
9ce4ebbf
...
@@ -11,9 +11,10 @@ import { URLService } from 'vs/platform/url/node/urlService';
...
@@ -11,9 +11,10 @@ import { URLService } from 'vs/platform/url/node/urlService';
import
{
IOpenerService
,
IOpener
,
matchesScheme
}
from
'
vs/platform/opener/common/opener
'
;
import
{
IOpenerService
,
IOpener
,
matchesScheme
}
from
'
vs/platform/opener/common/opener
'
;
import
product
from
'
vs/platform/product/common/product
'
;
import
product
from
'
vs/platform/product/common/product
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
INativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
export
interface
IRelayOpenURLOptions
extends
IOpenURLOptions
{
export
interface
IRelayOpenURLOptions
extends
IOpenURLOptions
{
openToSide
?:
boolean
;
openToSide
?:
boolean
;
...
@@ -27,7 +28,7 @@ export class RelayURLService extends URLService implements IURLHandler, IOpener
...
@@ -27,7 +28,7 @@ export class RelayURLService extends URLService implements IURLHandler, IOpener
constructor
(
constructor
(
@
IMainProcessService
mainProcessService
:
IMainProcessService
,
@
IMainProcessService
mainProcessService
:
IMainProcessService
,
@
IOpenerService
openerService
:
IOpenerService
,
@
IOpenerService
openerService
:
IOpenerService
,
@
I
ElectronEnvironmentService
private
electronEnvironmentService
:
IElectron
EnvironmentService
,
@
I
WorkbenchEnvironmentService
private
readonly
environmentService
:
INativeWorkbench
EnvironmentService
,
@
IElectronService
private
electronService
:
IElectronService
@
IElectronService
private
electronService
:
IElectronService
)
{
)
{
super
();
super
();
...
@@ -43,9 +44,9 @@ export class RelayURLService extends URLService implements IURLHandler, IOpener
...
@@ -43,9 +44,9 @@ export class RelayURLService extends URLService implements IURLHandler, IOpener
let
query
=
uri
.
query
;
let
query
=
uri
.
query
;
if
(
!
query
)
{
if
(
!
query
)
{
query
=
`windowId=
${
encodeURIComponent
(
this
.
e
lectronEnvironmentService
.
windowId
)}
`
;
query
=
`windowId=
${
encodeURIComponent
(
this
.
e
nvironmentService
.
configuration
.
windowId
)}
`
;
}
else
{
}
else
{
query
+=
`&windowId=
${
encodeURIComponent
(
this
.
e
lectronEnvironmentService
.
windowId
)}
`
;
query
+=
`&windowId=
${
encodeURIComponent
(
this
.
e
nvironmentService
.
configuration
.
windowId
)}
`
;
}
}
return
uri
.
with
({
query
});
return
uri
.
with
({
query
});
...
...
src/vs/workbench/services/workspaces/electron-browser/workspacesService.ts
浏览文件 @
9ce4ebbf
...
@@ -6,8 +6,9 @@
...
@@ -6,8 +6,9 @@
import
{
IWorkspacesService
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IWorkspacesService
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-browser/mainProcessService
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-browser/mainProcessService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
INativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
export
class
NativeWorkspacesService
{
export
class
NativeWorkspacesService
{
...
@@ -15,9 +16,9 @@ export class NativeWorkspacesService {
...
@@ -15,9 +16,9 @@ export class NativeWorkspacesService {
constructor
(
constructor
(
@
IMainProcessService
mainProcessService
:
IMainProcessService
,
@
IMainProcessService
mainProcessService
:
IMainProcessService
,
@
I
ElectronEnvironmentService
electronEnvironmentService
:
IElectron
EnvironmentService
@
I
WorkbenchEnvironmentService
environmentService
:
INativeWorkbench
EnvironmentService
)
{
)
{
return
createChannelSender
<
IWorkspacesService
>
(
mainProcessService
.
getChannel
(
'
workspaces
'
),
{
context
:
e
lectronEnvironmentService
.
windowId
});
return
createChannelSender
<
IWorkspacesService
>
(
mainProcessService
.
getChannel
(
'
workspaces
'
),
{
context
:
e
nvironmentService
.
configuration
.
windowId
});
}
}
}
}
...
...
src/vs/workbench/test/electron-browser/workbenchTestServices.ts
浏览文件 @
9ce4ebbf
...
@@ -53,7 +53,7 @@ export const TestWindowConfiguration: INativeWindowConfiguration = {
...
@@ -53,7 +53,7 @@ export const TestWindowConfiguration: INativeWindowConfiguration = {
...
parseArgs
(
process
.
argv
,
OPTIONS
)
...
parseArgs
(
process
.
argv
,
OPTIONS
)
};
};
export
const
TestEnvironmentService
=
new
NativeWorkbenchEnvironmentService
(
TestWindowConfiguration
,
process
.
execPath
,
0
);
export
const
TestEnvironmentService
=
new
NativeWorkbenchEnvironmentService
(
TestWindowConfiguration
,
process
.
execPath
);
export
class
TestTextFileService
extends
NativeTextFileService
{
export
class
TestTextFileService
extends
NativeTextFileService
{
private
resolveTextContentError
!
:
FileOperationError
|
null
;
private
resolveTextContentError
!
:
FileOperationError
|
null
;
...
...
src/vs/workbench/workbench.web.main.ts
浏览文件 @
9ce4ebbf
...
@@ -24,12 +24,14 @@ import 'vs/workbench/browser/web.main';
...
@@ -24,12 +24,14 @@ import 'vs/workbench/browser/web.main';
//#endregion
//#endregion
////#region --- workbench parts
//#region --- workbench parts
import
'
vs/workbench/browser/parts/titlebar/titlebarPart
'
;
import
'
vs/workbench/browser/parts/titlebar/titlebarPart
'
;
//#endregion
//#endregion
//#region --- workbench services
//#region --- workbench services
import
'
vs/workbench/services/integrity/browser/integrityService
'
;
import
'
vs/workbench/services/integrity/browser/integrityService
'
;
import
'
vs/workbench/services/textMate/browser/textMateService
'
;
import
'
vs/workbench/services/textMate/browser/textMateService
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录