Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
2de4f42d
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,发现更多精彩内容 >>
提交
2de4f42d
编写于
4月 22, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
finish IEnvService
上级
1e3a037f
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
215 addition
and
177 deletion
+215
-177
src/vs/workbench/electron-main/auto-updater.linux.ts
src/vs/workbench/electron-main/auto-updater.linux.ts
+8
-7
src/vs/workbench/electron-main/auto-updater.win32.ts
src/vs/workbench/electron-main/auto-updater.win32.ts
+5
-4
src/vs/workbench/electron-main/env.ts
src/vs/workbench/electron-main/env.ts
+112
-92
src/vs/workbench/electron-main/log.ts
src/vs/workbench/electron-main/log.ts
+2
-2
src/vs/workbench/electron-main/main.ts
src/vs/workbench/electron-main/main.ts
+10
-8
src/vs/workbench/electron-main/settings.ts
src/vs/workbench/electron-main/settings.ts
+20
-9
src/vs/workbench/electron-main/sharedProcess.ts
src/vs/workbench/electron-main/sharedProcess.ts
+14
-12
src/vs/workbench/electron-main/storage.ts
src/vs/workbench/electron-main/storage.ts
+2
-2
src/vs/workbench/electron-main/update-manager.ts
src/vs/workbench/electron-main/update-manager.ts
+10
-10
src/vs/workbench/electron-main/window.ts
src/vs/workbench/electron-main/window.ts
+6
-6
src/vs/workbench/electron-main/windows.ts
src/vs/workbench/electron-main/windows.ts
+26
-25
未找到文件。
src/vs/workbench/electron-main/auto-updater.linux.ts
浏览文件 @
2de4f42d
...
...
@@ -6,11 +6,11 @@
'
use strict
'
;
import
events
=
require
(
'
events
'
);
import
{
isString
}
from
'
vs/base/common/types
'
;
import
{
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
json
}
from
'
vs/base/node/request
'
;
import
{
isString
}
from
'
vs/base/common/types
'
;
import
{
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
json
}
from
'
vs/base/node/request
'
;
import
{
getProxyAgent
}
from
'
vs/base/node/proxy
'
;
import
{
manager
as
Settings
}
from
'
vs/workbench/electron-main/settings
'
;
import
{
ISettingsManager
}
from
'
vs/workbench/electron-main/settings
'
;
import
{
IEnvService
}
from
'
vs/workbench/electron-main/env
'
;
export
interface
IUpdate
{
...
...
@@ -26,7 +26,8 @@ export class LinuxAutoUpdaterImpl extends events.EventEmitter {
private
currentRequest
:
Promise
;
constructor
(
@
IEnvService
private
envService
:
IEnvService
@
IEnvService
private
envService
:
IEnvService
,
@
ISettingsManager
private
settingsManager
:
ISettingsManager
)
{
super
();
...
...
@@ -49,8 +50,8 @@ export class LinuxAutoUpdaterImpl extends events.EventEmitter {
this
.
emit
(
'
checking-for-update
'
);
const
proxyUrl
=
Settings
.
getValue
(
'
http.proxy
'
);
const
strictSSL
=
Settings
.
getValue
(
'
http.proxyStrictSSL
'
,
true
);
const
proxyUrl
=
this
.
settingsManager
.
getValue
(
'
http.proxy
'
);
const
strictSSL
=
this
.
settingsManager
.
getValue
(
'
http.proxyStrictSSL
'
,
true
);
const
agent
=
getProxyAgent
(
this
.
url
,
{
proxyUrl
,
strictSSL
});
this
.
currentRequest
=
json
<
IUpdate
>
({
url
:
this
.
url
,
agent
})
...
...
src/vs/workbench/electron-main/auto-updater.win32.ts
浏览文件 @
2de4f42d
...
...
@@ -15,7 +15,7 @@ import { isString } from 'vs/base/common/types';
import
{
Promise
,
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
download
,
json
}
from
'
vs/base/node/request
'
;
import
{
getProxyAgent
}
from
'
vs/base/node/proxy
'
;
import
{
manager
as
Settings
}
from
'
vs/workbench/electron-main/settings
'
;
import
{
ISettingsManager
}
from
'
vs/workbench/electron-main/settings
'
;
import
{
ILifecycleService
}
from
'
vs/workbench/electron-main/lifecycle
'
;
import
{
IEnvService
}
from
'
./env
'
;
...
...
@@ -33,7 +33,8 @@ export class Win32AutoUpdaterImpl extends events.EventEmitter {
constructor
(
@
ILifecycleService
private
lifecycleService
:
ILifecycleService
,
@
IEnvService
private
envService
:
IEnvService
@
IEnvService
private
envService
:
IEnvService
,
@
ISettingsManager
private
settingsManager
:
ISettingsManager
)
{
super
();
...
...
@@ -61,8 +62,8 @@ export class Win32AutoUpdaterImpl extends events.EventEmitter {
this
.
emit
(
'
checking-for-update
'
);
const
proxyUrl
=
Settings
.
getValue
(
'
http.proxy
'
);
const
strictSSL
=
Settings
.
getValue
(
'
http.proxyStrictSSL
'
,
true
);
const
proxyUrl
=
this
.
settingsManager
.
getValue
(
'
http.proxy
'
);
const
strictSSL
=
this
.
settingsManager
.
getValue
(
'
http.proxyStrictSSL
'
,
true
);
const
agent
=
getProxyAgent
(
this
.
url
,
{
proxyUrl
,
strictSSL
});
this
.
currentRequest
=
json
<
IUpdate
>
({
url
:
this
.
url
,
agent
})
...
...
src/vs/workbench/electron-main/env.ts
浏览文件 @
2de4f42d
...
...
@@ -10,7 +10,6 @@ import fs = require('fs');
import
path
=
require
(
'
path
'
);
import
os
=
require
(
'
os
'
);
import
{
app
}
from
'
electron
'
;
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
paths
=
require
(
'
vs/base/common/paths
'
);
...
...
@@ -20,15 +19,73 @@ import { assign } from 'vs/base/common/objects';
import
types
=
require
(
'
vs/base/common/types
'
);
import
{
ServiceIdentifier
,
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
interface
IEnv
{
cliArgs
:
ICommandLineArguments
;
export
interface
IProductConfiguration
{
nameShort
:
string
;
nameLong
:
string
;
applicationName
:
string
;
win32AppUserModelId
:
string
;
win32MutexName
:
string
;
darwinBundleIdentifier
:
string
;
dataFolderName
:
string
;
downloadUrl
:
string
;
updateUrl
?:
string
;
quality
?:
string
;
commit
:
string
;
date
:
string
;
extensionsGallery
:
{
serviceUrl
:
string
;
itemUrl
:
string
;
};
extensionTips
:
{
[
id
:
string
]:
string
;
};
crashReporter
:
Electron
.
CrashReporterStartOptions
;
welcomePage
:
string
;
enableTelemetry
:
boolean
;
aiConfig
:
{
key
:
string
;
asimovKey
:
string
;
};
sendASmile
:
{
reportIssueUrl
:
string
,
requestFeatureUrl
:
string
};
documentationUrl
:
string
;
releaseNotesUrl
:
string
;
twitterUrl
:
string
;
requestFeatureUrl
:
string
;
reportIssueUrl
:
string
;
licenseUrl
:
string
;
privacyStatementUrl
:
string
;
}
export
interface
IProcessEnvironment
{
[
key
:
string
]:
string
;
}
export
interface
ICommandLineArguments
{
verboseLogging
:
boolean
;
debugExtensionHostPort
:
number
;
debugBrkExtensionHost
:
boolean
;
logExtensionHostCommunication
:
boolean
;
disableExtensions
:
boolean
;
extensionsHomePath
:
string
;
extensionDevelopmentPath
:
string
;
extensionTestsPath
:
string
;
programStart
:
number
;
pathArguments
?:
string
[];
enablePerformance
?:
boolean
;
firstrun
?:
boolean
;
openNewWindow
?:
boolean
;
openInSameWindow
?:
boolean
;
gotoLineMode
?:
boolean
;
diffMode
?:
boolean
;
locale
?:
string
;
waitForWindowClose
?:
boolean
;
}
export
const
IEnvService
=
createDecorator
<
IEnvService
>
(
'
environmentService
'
);
export
interface
IEnvService
{
serviceId
:
ServiceIdentifier
<
any
>
;
cliArgs
:
ICommandLineArguments
;
userExtensionsHome
:
string
;
isTestingFromCli
:
boolean
;
...
...
@@ -37,6 +94,13 @@ export interface IEnvService {
updateUrl
:
string
;
quality
:
string
;
userHome
:
string
;
appRoot
:
string
;
currentWorkingDirectory
:
string
;
version
:
string
;
appHome
:
string
;
appSettingsHome
:
string
;
appSettingsPath
:
string
;
appKeybindingsPath
:
string
;
mainIPCHandle
:
string
;
sharedIPCHandle
:
string
;
}
...
...
@@ -65,6 +129,27 @@ export class EnvService implements IEnvService {
private
_userHome
:
string
;
get
userHome
():
string
{
return
this
.
_userHome
;
}
private
_appRoot
:
string
;
get
appRoot
():
string
{
return
this
.
_appRoot
;
}
private
_currentWorkingDirectory
:
string
;
get
currentWorkingDirectory
():
string
{
return
this
.
_currentWorkingDirectory
;
}
private
_version
:
string
;
get
version
():
string
{
return
this
.
_version
;
}
private
_appHome
:
string
;
get
appHome
():
string
{
return
this
.
_appHome
;
}
private
_appSettingsHome
:
string
;
get
appSettingsHome
():
string
{
return
this
.
_appSettingsHome
;
}
private
_appSettingsPath
:
string
;
get
appSettingsPath
():
string
{
return
this
.
_appSettingsPath
;
}
private
_appKeybindingsPath
:
string
;
get
appKeybindingsPath
():
string
{
return
this
.
_appKeybindingsPath
;
}
private
_mainIPCHandle
:
string
;
get
mainIPCHandle
():
string
{
return
this
.
_mainIPCHandle
;
}
...
...
@@ -72,6 +157,20 @@ export class EnvService implements IEnvService {
get
sharedIPCHandle
():
string
{
return
this
.
_sharedIPCHandle
;
}
constructor
()
{
this
.
_appRoot
=
path
.
dirname
(
uri
.
parse
(
require
.
toUrl
(
''
)).
fsPath
);
this
.
_currentWorkingDirectory
=
process
.
env
[
'
VSCODE_CWD
'
]
||
process
.
cwd
();
this
.
_version
=
app
.
getVersion
();
this
.
_appHome
=
app
.
getPath
(
'
userData
'
);
this
.
_appSettingsHome
=
path
.
join
(
this
.
_appHome
,
'
User
'
);
// TODO move out of here!
if
(
!
fs
.
existsSync
(
this
.
_appSettingsHome
))
{
fs
.
mkdirSync
(
this
.
_appSettingsHome
);
}
this
.
_appSettingsPath
=
path
.
join
(
this
.
_appSettingsHome
,
'
settings.json
'
);
this
.
_appKeybindingsPath
=
path
.
join
(
this
.
_appSettingsHome
,
'
keybindings.json
'
);
// Remove the Electron executable
let
[,
...
args
]
=
process
.
argv
;
...
...
@@ -81,8 +180,8 @@ export class EnvService implements IEnvService {
}
// Finally, prepend any extra arguments from the 'argv' file
if
(
fs
.
existsSync
(
path
.
join
(
appRoot
,
'
argv
'
)))
{
const
extraargs
:
string
[]
=
JSON
.
parse
(
fs
.
readFileSync
(
path
.
join
(
appRoot
,
'
argv
'
),
'
utf8
'
));
if
(
fs
.
existsSync
(
path
.
join
(
this
.
_
appRoot
,
'
argv
'
)))
{
const
extraargs
:
string
[]
=
JSON
.
parse
(
fs
.
readFileSync
(
path
.
join
(
this
.
_
appRoot
,
'
argv
'
),
'
utf8
'
));
args
=
[...
extraargs
,
...
args
];
}
...
...
@@ -101,7 +200,7 @@ export class EnvService implements IEnvService {
debugExtensionHostPort
=
parseNumber
(
args
,
'
--debugPluginHost
'
,
5870
,
this
.
isBuilt
?
void
0
:
5870
);
}
const
pathArguments
=
parsePathArguments
(
args
,
gotoLineMode
);
const
pathArguments
=
parsePathArguments
(
this
.
_currentWorkingDirectory
,
args
,
gotoLineMode
);
this
.
_cliArgs
=
Object
.
freeze
({
pathArguments
:
pathArguments
,
...
...
@@ -127,7 +226,7 @@ export class EnvService implements IEnvService {
this
.
_isTestingFromCli
=
this
.
cliArgs
.
extensionTestsPath
&&
!
this
.
cliArgs
.
debugBrkExtensionHost
;
try
{
this
.
_product
=
JSON
.
parse
(
fs
.
readFileSync
(
path
.
join
(
appRoot
,
'
product.json
'
),
'
utf8
'
));
this
.
_product
=
JSON
.
parse
(
fs
.
readFileSync
(
path
.
join
(
this
.
_
appRoot
,
'
product.json
'
),
'
utf8
'
));
}
catch
(
error
)
{
this
.
_product
=
Object
.
create
(
null
);
}
...
...
@@ -204,85 +303,6 @@ export class EnvService implements IEnvService {
}
}
export
interface
IProductConfiguration
{
nameShort
:
string
;
nameLong
:
string
;
applicationName
:
string
;
win32AppUserModelId
:
string
;
win32MutexName
:
string
;
darwinBundleIdentifier
:
string
;
dataFolderName
:
string
;
downloadUrl
:
string
;
updateUrl
?:
string
;
quality
?:
string
;
commit
:
string
;
date
:
string
;
extensionsGallery
:
{
serviceUrl
:
string
;
itemUrl
:
string
;
};
extensionTips
:
{
[
id
:
string
]:
string
;
};
crashReporter
:
Electron
.
CrashReporterStartOptions
;
welcomePage
:
string
;
enableTelemetry
:
boolean
;
aiConfig
:
{
key
:
string
;
asimovKey
:
string
;
};
sendASmile
:
{
reportIssueUrl
:
string
,
requestFeatureUrl
:
string
};
documentationUrl
:
string
;
releaseNotesUrl
:
string
;
twitterUrl
:
string
;
requestFeatureUrl
:
string
;
reportIssueUrl
:
string
;
licenseUrl
:
string
;
privacyStatementUrl
:
string
;
}
export
const
appRoot
=
path
.
dirname
(
uri
.
parse
(
require
.
toUrl
(
''
)).
fsPath
);
export
const
currentWorkingDirectory
=
process
.
env
.
VSCODE_CWD
||
process
.
cwd
();
export
const
version
=
app
.
getVersion
();
export
const
appHome
=
app
.
getPath
(
'
userData
'
);
export
const
appSettingsHome
=
path
.
join
(
appHome
,
'
User
'
);
if
(
!
fs
.
existsSync
(
appSettingsHome
))
{
fs
.
mkdirSync
(
appSettingsHome
);
}
export
const
appSettingsPath
=
path
.
join
(
appSettingsHome
,
'
settings.json
'
);
export
const
appKeybindingsPath
=
path
.
join
(
appSettingsHome
,
'
keybindings.json
'
);
export
interface
IProcessEnvironment
{
[
key
:
string
]:
string
;
}
export
interface
ICommandLineArguments
{
verboseLogging
:
boolean
;
debugExtensionHostPort
:
number
;
debugBrkExtensionHost
:
boolean
;
logExtensionHostCommunication
:
boolean
;
disableExtensions
:
boolean
;
extensionsHomePath
:
string
;
extensionDevelopmentPath
:
string
;
extensionTestsPath
:
string
;
programStart
:
number
;
pathArguments
?:
string
[];
enablePerformance
?:
boolean
;
firstrun
?:
boolean
;
openNewWindow
?:
boolean
;
openInSameWindow
?:
boolean
;
gotoLineMode
?:
boolean
;
diffMode
?:
boolean
;
locale
?:
string
;
waitForWindowClose
?:
boolean
;
}
type
OptionBag
=
{
[
opt
:
string
]:
boolean
;
};
function
parseOpts
(
argv
:
string
[]):
OptionBag
{
...
...
@@ -292,7 +312,7 @@ function parseOpts(argv: string[]): OptionBag {
.
reduce
((
r
,
a
)
=>
{
r
[
a
]
=
true
;
return
r
;
},
<
OptionBag
>
{});
}
function
parsePathArguments
(
argv
:
string
[],
gotoLineMode
?:
boolean
):
string
[]
{
function
parsePathArguments
(
cwd
:
string
,
argv
:
string
[],
gotoLineMode
?:
boolean
):
string
[]
{
return
arrays
.
coalesce
(
// no invalid paths
arrays
.
distinct
(
// no duplicates
argv
.
filter
(
a
=>
!
(
/^-/
.
test
(
a
)))
// arguments without leading "-"
...
...
@@ -306,7 +326,7 @@ function parsePathArguments(argv: string[], gotoLineMode?: boolean): string[] {
}
if
(
pathCandidate
)
{
pathCandidate
=
preparePath
(
pathCandidate
);
pathCandidate
=
preparePath
(
cwd
,
pathCandidate
);
}
let
realPath
:
string
;
...
...
@@ -315,7 +335,7 @@ function parsePathArguments(argv: string[], gotoLineMode?: boolean): string[] {
}
catch
(
error
)
{
// in case of an error, assume the user wants to create this file
// if the path is relative, we join it to the cwd
realPath
=
path
.
normalize
(
path
.
isAbsolute
(
pathCandidate
)
?
pathCandidate
:
path
.
join
(
c
urrentWorkingDirectory
,
pathCandidate
));
realPath
=
path
.
normalize
(
path
.
isAbsolute
(
pathCandidate
)
?
pathCandidate
:
path
.
join
(
c
wd
,
pathCandidate
));
}
if
(
!
paths
.
isValidBasename
(
path
.
basename
(
realPath
)))
{
...
...
@@ -336,7 +356,7 @@ function parsePathArguments(argv: string[], gotoLineMode?: boolean): string[] {
);
}
function
preparePath
(
p
:
string
):
string
{
function
preparePath
(
cwd
:
string
,
p
:
string
):
string
{
// Trim trailing quotes
if
(
platform
.
isWindows
)
{
...
...
@@ -349,7 +369,7 @@ function preparePath(p: string): string {
if
(
platform
.
isWindows
)
{
// Resolve the path against cwd if it is relative
p
=
path
.
resolve
(
c
urrentWorkingDirectory
,
p
);
p
=
path
.
resolve
(
c
wd
,
p
);
// Trim trailing '.' chars on Windows to prevent invalid file names
p
=
strings
.
rtrim
(
p
,
'
.
'
);
...
...
src/vs/workbench/electron-main/log.ts
浏览文件 @
2de4f42d
...
...
@@ -5,8 +5,8 @@
'
use strict
'
;
import
{
ServiceIdentifier
,
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEnvService
}
from
'
./env
'
;
import
{
ServiceIdentifier
,
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEnvService
}
from
'
./env
'
;
export
const
ILogService
=
createDecorator
<
ILogService
>
(
'
logService
'
);
...
...
src/vs/workbench/electron-main/main.ts
浏览文件 @
2de4f42d
...
...
@@ -10,11 +10,11 @@ import fs = require('fs');
import
nls
=
require
(
'
vs/nls
'
);
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
env
=
require
(
'
vs/workbench/electron-main/env
'
)
;
import
{
IProcessEnvironment
,
IEnvService
,
EnvService
}
from
'
vs/workbench/electron-main/env
'
;
import
windows
=
require
(
'
vs/workbench/electron-main/windows
'
);
import
{
ILifecycleService
,
LifecycleService
}
from
'
vs/workbench/electron-main/lifecycle
'
;
import
{
VSCodeMenu
}
from
'
vs/workbench/electron-main/menus
'
;
import
settings
=
require
(
'
vs/workbench/electron-main/settings
'
)
;
import
{
ISettingsManager
,
SettingsManager
}
from
'
vs/workbench/electron-main/settings
'
;
import
{
IUpdateManager
,
UpdateManager
}
from
'
vs/workbench/electron-main/update-manager
'
;
import
{
Server
,
serve
,
connect
}
from
'
vs/base/parts/ipc/node/ipc.net
'
;
import
{
getUserEnvironment
}
from
'
vs/base/node/env
'
;
...
...
@@ -51,13 +51,14 @@ function quit(accessor: ServicesAccessor, arg?: any) {
process
.
exit
(
exitCode
);
// in main, process.exit === app.exit
}
function
main
(
accessor
:
ServicesAccessor
,
ipcServer
:
Server
,
userEnv
:
env
.
IProcessEnvironment
):
void
{
function
main
(
accessor
:
ServicesAccessor
,
ipcServer
:
Server
,
userEnv
:
IProcessEnvironment
):
void
{
const
instantiationService
=
accessor
.
get
(
IInstantiationService
);
const
logService
=
accessor
.
get
(
ILogService
);
const
envService
=
accessor
.
get
(
env
.
IEnvService
);
const
envService
=
accessor
.
get
(
IEnvService
);
const
windowManager
=
accessor
.
get
(
windows
.
IWindowsManager
);
const
lifecycleService
=
accessor
.
get
(
ILifecycleService
);
const
updateManager
=
accessor
.
get
(
IUpdateManager
);
const
settingsManager
=
accessor
.
get
(
ISettingsManager
);
// We handle uncaught exceptions here to prevent electron from opening a dialog to the user
process
.
on
(
'
uncaughtException
'
,
(
err
:
any
)
=>
{
...
...
@@ -80,7 +81,7 @@ function main(accessor: ServicesAccessor, ipcServer: Server, userEnv: env.IProce
});
logService
.
log
(
'
### VSCode main.js ###
'
);
logService
.
log
(
env
.
appRoot
,
envService
.
cliArgs
);
logService
.
log
(
env
Service
.
appRoot
,
envService
.
cliArgs
);
// Setup Windows mutex
let
windowsMutex
:
Mutex
=
null
;
...
...
@@ -151,7 +152,7 @@ function main(accessor: ServicesAccessor, ipcServer: Server, userEnv: env.IProce
lifecycleService
.
ready
();
// Load settings
settings
.
m
anager
.
loadSync
();
settings
M
anager
.
loadSync
();
// Propagate to clients
windowManager
.
ready
(
userEnv
);
...
...
@@ -188,7 +189,7 @@ function main(accessor: ServicesAccessor, ipcServer: Server, userEnv: env.IProce
function
setupIPC
(
accessor
:
ServicesAccessor
):
TPromise
<
Server
>
{
const
logService
=
accessor
.
get
(
ILogService
);
const
envService
=
accessor
.
get
(
env
.
IEnvService
);
const
envService
=
accessor
.
get
(
IEnvService
);
function
setup
(
retry
:
boolean
):
TPromise
<
Server
>
{
return
serve
(
envService
.
mainIPCHandle
).
then
(
server
=>
{
...
...
@@ -255,12 +256,13 @@ function setupIPC(accessor: ServicesAccessor): TPromise<Server> {
// TODO: isolate
const
services
=
new
ServiceCollection
();
services
.
set
(
env
.
IEnvService
,
new
SyncDescriptor
(
env
.
EnvService
));
services
.
set
(
IEnvService
,
new
SyncDescriptor
(
EnvService
));
services
.
set
(
ILogService
,
new
SyncDescriptor
(
MainLogService
));
services
.
set
(
windows
.
IWindowsManager
,
new
SyncDescriptor
(
windows
.
WindowsManager
));
services
.
set
(
ILifecycleService
,
new
SyncDescriptor
(
LifecycleService
));
services
.
set
(
IStorageService
,
new
SyncDescriptor
(
StorageService
));
services
.
set
(
IUpdateManager
,
new
SyncDescriptor
(
UpdateManager
));
services
.
set
(
ISettingsManager
,
new
SyncDescriptor
(
SettingsManager
));
const
instantiationService
=
new
InstantiationService
(
services
);
...
...
src/vs/workbench/electron-main/settings.ts
浏览文件 @
2de4f42d
...
...
@@ -6,21 +6,34 @@
'
use strict
'
;
import
{
app
}
from
'
electron
'
;
import
{
ServiceIdentifier
,
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
UserSettings
,
ISettings
}
from
'
vs/workbench/node/userSettings
'
;
import
{
IEnvService
}
from
'
vs/workbench/electron-main/env
'
;
import
Event
from
'
vs/base/common/event
'
;
export
const
ISettingsManager
=
createDecorator
<
ISettingsManager
>
(
'
settingsManager
'
);
export
interface
ISettingsManager
{
serviceId
:
ServiceIdentifier
<
any
>
;
globalSettings
:
ISettings
;
loadSync
():
boolean
;
getValue
(
key
:
string
,
fallback
?:
any
):
any
;
onChange
:
Event
<
ISettings
>
;
}
import
env
=
require
(
'
vs/workbench/electron-main/env
'
);
import
{
UserSettings
}
from
'
vs/workbench/node/userSettings
'
;
export
class
SettingsManager
extends
UserSettings
implements
ISettingsManager
{
export
class
SettingsManager
extends
UserSettings
{
serviceId
=
ISettingsManager
;
constructor
()
{
super
(
env
.
appSettingsPath
,
env
.
appKeybindingsPath
);
constructor
(
@
IEnvService
envService
:
IEnvService
)
{
super
(
env
Service
.
appSettingsPath
,
envService
.
appKeybindingsPath
);
app
.
on
(
'
will-quit
'
,
()
=>
{
this
.
dispose
();
});
}
public
loadSync
():
boolean
{
loadSync
():
boolean
{
const
settingsChanged
=
super
.
loadSync
();
// Store into global so that any renderer can access the value with remote.getGlobal()
...
...
@@ -30,6 +43,4 @@ export class SettingsManager extends UserSettings {
return
settingsChanged
;
}
}
export
const
manager
=
new
SettingsManager
();
\ No newline at end of file
}
\ No newline at end of file
src/vs/workbench/electron-main/sharedProcess.ts
浏览文件 @
2de4f42d
...
...
@@ -8,23 +8,23 @@ import URI from 'vs/base/common/uri';
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
IEnvironment
}
from
'
vs/platform/workspace/common/workspace
'
;
import
env
=
require
(
'
vs/workbench/electron-main/env
'
)
;
import
{
manager
as
SettingsManager
}
from
'
vs/workbench/electron-main/settings
'
;
import
{
IEnvService
}
from
'
vs/workbench/electron-main/env
'
;
import
{
I
SettingsManager
}
from
'
vs/workbench/electron-main/settings
'
;
import
{
IUpdateManager
}
from
'
vs/workbench/electron-main/update-manager
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
const
boostrapPath
=
URI
.
parse
(
require
.
toUrl
(
'
bootstrap
'
)).
fsPath
;
function
getEnvironment
(
envService
:
env
.
IEnvService
,
updateManager
:
IUpdateManager
):
IEnvironment
{
function
getEnvironment
(
envService
:
IEnvService
,
updateManager
:
IUpdateManager
):
IEnvironment
{
let
configuration
:
IEnvironment
=
assign
({},
envService
.
cliArgs
);
configuration
.
execPath
=
process
.
execPath
;
configuration
.
appName
=
envService
.
product
.
nameLong
;
configuration
.
appRoot
=
env
.
appRoot
;
configuration
.
version
=
env
.
version
;
configuration
.
appRoot
=
env
Service
.
appRoot
;
configuration
.
version
=
env
Service
.
version
;
configuration
.
commitHash
=
envService
.
product
.
commit
;
configuration
.
appSettingsHome
=
env
.
appSettingsHome
;
configuration
.
appSettingsPath
=
env
.
appSettingsPath
;
configuration
.
appKeybindingsPath
=
env
.
appKeybindingsPath
;
configuration
.
appSettingsHome
=
env
Service
.
appSettingsHome
;
configuration
.
appSettingsPath
=
env
Service
.
appSettingsPath
;
configuration
.
appKeybindingsPath
=
env
Service
.
appKeybindingsPath
;
configuration
.
userExtensionsHome
=
envService
.
userExtensionsHome
;
configuration
.
isBuilt
=
envService
.
isBuilt
;
configuration
.
updateFeedUrl
=
updateManager
.
feedUrl
;
...
...
@@ -34,7 +34,7 @@ function getEnvironment(envService: env.IEnvService, updateManager: IUpdateManag
return
configuration
;
}
function
_spawnSharedProcess
(
envService
:
env
.
IEnvService
,
updateManager
:
IUpdate
Manager
):
cp
.
ChildProcess
{
function
_spawnSharedProcess
(
envService
:
IEnvService
,
updateManager
:
IUpdateManager
,
settingsManager
:
ISettings
Manager
):
cp
.
ChildProcess
{
// Make sure the nls configuration travels to the shared process.
const
opts
=
{
env
:
assign
(
assign
({},
process
.
env
),
{
...
...
@@ -51,7 +51,7 @@ function _spawnSharedProcess(envService: env.IEnvService, updateManager: IUpdate
env
:
getEnvironment
(
envService
,
updateManager
)
},
contextServiceOptions
:
{
globalSettings
:
S
ettingsManager
.
globalSettings
globalSettings
:
s
ettingsManager
.
globalSettings
}
});
});
...
...
@@ -62,8 +62,10 @@ function _spawnSharedProcess(envService: env.IEnvService, updateManager: IUpdate
let
spawnCount
=
0
;
export
function
spawnSharedProcess
(
accessor
:
ServicesAccessor
):
IDisposable
{
const
envService
=
accessor
.
get
(
env
.
IEnvService
);
const
envService
=
accessor
.
get
(
IEnvService
);
const
updateManager
=
accessor
.
get
(
IUpdateManager
);
const
settingsManager
=
accessor
.
get
(
ISettingsManager
);
let
child
:
cp
.
ChildProcess
;
const
spawn
=
()
=>
{
...
...
@@ -71,7 +73,7 @@ export function spawnSharedProcess(accessor: ServicesAccessor): IDisposable {
return
;
}
child
=
_spawnSharedProcess
(
envService
,
updateManager
);
child
=
_spawnSharedProcess
(
envService
,
updateManager
,
settingsManager
);
child
.
on
(
'
exit
'
,
spawn
);
};
...
...
src/vs/workbench/electron-main/storage.ts
浏览文件 @
2de4f42d
...
...
@@ -30,12 +30,12 @@ export class StorageService implements IStorageService {
serviceId
=
IStorageService
;
private
dbPath
=
path
.
join
(
env
.
appHome
,
'
storage.json
'
)
;
private
dbPath
:
string
;
private
database
:
any
=
null
;
private
eventEmitter
=
new
events
.
EventEmitter
();
constructor
(@
env
.
IEnvService
private
envService
:
env
.
IEnvService
)
{
this
.
dbPath
=
path
.
join
(
envService
.
appHome
,
'
storage.json
'
);
}
onStore
<
T
>
(
clb
:
(
key
:
string
,
oldValue
:
T
,
newValue
:
T
)
=>
void
):
()
=>
void
{
...
...
src/vs/workbench/electron-main/update-manager.ts
浏览文件 @
2de4f42d
...
...
@@ -8,15 +8,14 @@
import
fs
=
require
(
'
fs
'
);
import
path
=
require
(
'
path
'
);
import
events
=
require
(
'
events
'
);
import
electron
=
require
(
'
electron
'
);
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
*
as
env
from
'
vs/workbench/electron-main/env
'
;
import
settings
=
require
(
'
vs/workbench/electron-main/settings
'
)
;
import
{
Win32AutoUpdaterImpl
}
from
'
vs/workbench/electron-main/auto-updater.win32
'
;
import
{
LinuxAutoUpdaterImpl
}
from
'
vs/workbench/electron-main/auto-updater.linux
'
;
import
{
ILifecycleService
}
from
'
vs/workbench/electron-main/lifecycle
'
;
import
{
ServiceIdentifier
,
createDecorator
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEnvService
,
getPlatformIdentifier
}
from
'
vs/workbench/electron-main/env
'
;
import
{
ISettingsManager
}
from
'
vs/workbench/electron-main/settings
'
;
import
{
Win32AutoUpdaterImpl
}
from
'
vs/workbench/electron-main/auto-updater.win32
'
;
import
{
LinuxAutoUpdaterImpl
}
from
'
vs/workbench/electron-main/auto-updater.linux
'
;
import
{
ILifecycleService
}
from
'
vs/workbench/electron-main/lifecycle
'
;
import
{
ServiceIdentifier
,
createDecorator
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
enum
State
{
Uninitialized
,
...
...
@@ -72,7 +71,8 @@ export class UpdateManager extends events.EventEmitter implements IUpdateManager
constructor
(
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
ILifecycleService
private
lifecycleService
:
ILifecycleService
,
@
env
.
IEnvService
private
envService
:
env
.
IEnvService
@
IEnvService
private
envService
:
IEnvService
,
@
ISettingsManager
private
settingsManager
:
ISettingsManager
)
{
super
();
...
...
@@ -225,7 +225,7 @@ export class UpdateManager extends events.EventEmitter implements IUpdateManager
}
private
getUpdateChannel
():
string
{
const
channel
=
settings
.
m
anager
.
getValue
(
'
update.channel
'
)
||
'
default
'
;
const
channel
=
this
.
settingsM
anager
.
getValue
(
'
update.channel
'
)
||
'
default
'
;
return
channel
===
'
none
'
?
null
:
this
.
envService
.
quality
;
}
...
...
@@ -242,6 +242,6 @@ export class UpdateManager extends events.EventEmitter implements IUpdateManager
return
null
;
}
return
`
${
this
.
envService
.
updateUrl
}
/api/update/
${
env
.
getPlatformIdentifier
()
}
/
${
channel
}
/
${
this
.
envService
.
product
.
commit
}
`
;
return
`
${
this
.
envService
.
updateUrl
}
/api/update/
${
getPlatformIdentifier
()
}
/
${
channel
}
/
${
this
.
envService
.
product
.
commit
}
`
;
}
}
src/vs/workbench/electron-main/window.ts
浏览文件 @
2de4f42d
...
...
@@ -12,7 +12,7 @@ import {shell, screen, BrowserWindow} from 'electron';
import
{
TPromise
,
TValueCallback
}
from
'
vs/base/common/winjs.base
'
;
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
env
=
require
(
'
vs/workbench/electron-main/env
'
)
;
import
{
ICommandLineArguments
,
IEnvService
,
IProcessEnvironment
}
from
'
vs/workbench/electron-main/env
'
;
import
storage
=
require
(
'
vs/workbench/electron-main/storage
'
);
import
{
ILogService
}
from
'
./log
'
;
...
...
@@ -87,7 +87,7 @@ export interface IPath {
installExtensionPath
?:
boolean
;
}
export
interface
IWindowConfiguration
extends
env
.
ICommandLineArguments
{
export
interface
IWindowConfiguration
extends
ICommandLineArguments
{
execPath
:
string
;
version
:
string
;
appName
:
string
;
...
...
@@ -122,7 +122,7 @@ export interface IWindowConfiguration extends env.ICommandLineArguments {
licenseUrl
:
string
;
productDownloadUrl
:
string
;
enableTelemetry
:
boolean
;
userEnv
:
env
.
IProcessEnvironment
;
userEnv
:
IProcessEnvironment
;
aiConfig
:
{
key
:
string
;
asimovKey
:
string
;
...
...
@@ -158,7 +158,7 @@ export class VSCodeWindow {
constructor
(
config
:
IWindowCreationOptions
,
@
ILogService
private
logService
:
ILogService
,
@
env
.
IEnvService
private
envService
:
env
.
IEnvService
,
@
IEnvService
private
envService
:
IEnvService
,
@
storage
.
IStorageService
private
storageService
:
storage
.
IStorageService
)
{
this
.
_lastFocusTime
=
-
1
;
...
...
@@ -192,7 +192,7 @@ export class VSCodeWindow {
};
if
(
platform
.
isLinux
)
{
options
.
icon
=
path
.
join
(
env
.
appRoot
,
'
resources/linux/code.png
'
);
// Windows and Mac are better off using the embedded icon(s)
options
.
icon
=
path
.
join
(
this
.
envService
.
appRoot
,
'
resources/linux/code.png
'
);
// Windows and Mac are better off using the embedded icon(s)
}
// Create the browser window.
...
...
@@ -389,7 +389,7 @@ export class VSCodeWindow {
}
}
public
reload
(
cli
?:
env
.
ICommandLineArguments
):
void
{
public
reload
(
cli
?:
ICommandLineArguments
):
void
{
// Inherit current properties but overwrite some
let
configuration
:
IWindowConfiguration
=
objects
.
mixin
({},
this
.
currentConfig
);
...
...
src/vs/workbench/electron-main/windows.ts
浏览文件 @
2de4f42d
...
...
@@ -13,7 +13,7 @@ import fs = require('fs');
import
{
ipcMain
as
ipc
,
app
,
screen
,
crashReporter
,
BrowserWindow
,
dialog
}
from
'
electron
'
;
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
env
=
require
(
'
vs/workbench/electron-main/env
'
)
;
import
{
ICommandLineArguments
,
IProcessEnvironment
,
IEnvService
,
IParsedPath
,
parseLineAndColumnAware
}
from
'
vs/workbench/electron-main/env
'
;
import
window
=
require
(
'
vs/workbench/electron-main/window
'
);
import
{
ILifecycleService
}
from
'
vs/workbench/electron-main/lifecycle
'
;
import
nls
=
require
(
'
vs/nls
'
);
...
...
@@ -21,7 +21,7 @@ import paths = require('vs/base/common/paths');
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
storage
=
require
(
'
vs/workbench/electron-main/storage
'
);
import
settings
=
require
(
'
vs/workbench/electron-main/settings
'
)
;
import
{
ISettingsManager
}
from
'
vs/workbench/electron-main/settings
'
;
import
{
IUpdateManager
,
IUpdate
}
from
'
vs/workbench/electron-main/update-manager
'
;
import
{
ILogService
}
from
'
./log
'
;
import
{
ServiceIdentifier
,
createDecorator
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -38,8 +38,8 @@ enum WindowError {
}
export
interface
IOpenConfiguration
{
cli
:
env
.
ICommandLineArguments
;
userEnv
?:
env
.
IProcessEnvironment
;
cli
:
ICommandLineArguments
;
userEnv
?:
IProcessEnvironment
;
pathsToOpen
?:
string
[];
preferNewWindow
?:
boolean
;
forceNewWindow
?:
boolean
;
...
...
@@ -86,14 +86,14 @@ export interface IWindowsManager {
onClose
(
clb
:
(
id
:
number
)
=>
void
):
()
=>
void
;
// methods
ready
(
initialUserEnv
:
env
.
IProcessEnvironment
):
void
;
reload
(
win
:
window
.
VSCodeWindow
,
cli
?:
env
.
ICommandLineArguments
):
void
;
ready
(
initialUserEnv
:
IProcessEnvironment
):
void
;
reload
(
win
:
window
.
VSCodeWindow
,
cli
?:
ICommandLineArguments
):
void
;
open
(
openConfig
:
IOpenConfiguration
):
window
.
VSCodeWindow
[];
openPluginDevelopmentHostWindow
(
openConfig
:
IOpenConfiguration
):
void
;
openFileFolderPicker
(
forceNewWindow
?:
boolean
):
void
;
openFilePicker
(
forceNewWindow
?:
boolean
):
void
;
openFolderPicker
(
forceNewWindow
?:
boolean
):
void
;
focusLastActive
(
cli
:
env
.
ICommandLineArguments
):
window
.
VSCodeWindow
;
focusLastActive
(
cli
:
ICommandLineArguments
):
window
.
VSCodeWindow
;
getLastActiveWindow
():
window
.
VSCodeWindow
;
findWindow
(
workspacePath
:
string
,
filePath
?:
string
,
extensionDevelopmentPath
?:
string
):
window
.
VSCodeWindow
;
openNewWindow
():
void
;
...
...
@@ -117,16 +117,17 @@ export class WindowsManager implements IWindowsManager {
private
static
WINDOWS
:
window
.
VSCodeWindow
[]
=
[];
private
eventEmitter
=
new
events
.
EventEmitter
();
private
initialUserEnv
:
env
.
IProcessEnvironment
;
private
initialUserEnv
:
IProcessEnvironment
;
private
windowsState
:
IWindowsState
;
constructor
(
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
ILogService
private
logService
:
ILogService
,
@
storage
.
IStorageService
private
storageService
:
storage
.
IStorageService
,
@
env
.
IEnvService
private
envService
:
env
.
IEnvService
,
@
IEnvService
private
envService
:
IEnvService
,
@
ILifecycleService
private
lifecycleService
:
ILifecycleService
,
@
IUpdateManager
private
updateManager
:
IUpdateManager
@
IUpdateManager
private
updateManager
:
IUpdateManager
,
@
ISettingsManager
private
settingsManager
:
ISettingsManager
)
{
}
onOpen
(
clb
:
(
path
:
window
.
IPath
)
=>
void
):
()
=>
void
{
...
...
@@ -147,7 +148,7 @@ export class WindowsManager implements IWindowsManager {
return
()
=>
this
.
eventEmitter
.
removeListener
(
EventTypes
.
CLOSE
,
clb
);
}
public
ready
(
initialUserEnv
:
env
.
IProcessEnvironment
):
void
{
public
ready
(
initialUserEnv
:
IProcessEnvironment
):
void
{
this
.
registerListeners
();
this
.
initialUserEnv
=
initialUserEnv
;
...
...
@@ -193,7 +194,7 @@ export class WindowsManager implements IWindowsManager {
},
100
);
});
settings
.
m
anager
.
onChange
((
newSettings
)
=>
{
this
.
settingsM
anager
.
onChange
((
newSettings
)
=>
{
this
.
sendToAll
(
'
vscode:optionsChange
'
,
JSON
.
stringify
({
globalSettings
:
newSettings
}));
},
this
);
...
...
@@ -484,7 +485,7 @@ export class WindowsManager implements IWindowsManager {
}
}
public
reload
(
win
:
window
.
VSCodeWindow
,
cli
?:
env
.
ICommandLineArguments
):
void
{
public
reload
(
win
:
window
.
VSCodeWindow
,
cli
?:
ICommandLineArguments
):
void
{
// Only reload when the window has not vetoed this
this
.
lifecycleService
.
unload
(
win
).
done
((
veto
)
=>
{
...
...
@@ -578,7 +579,7 @@ export class WindowsManager implements IWindowsManager {
}
else
{
openFilesInNewWindow
=
openConfig
.
preferNewWindow
;
if
(
openFilesInNewWindow
&&
!
openConfig
.
cli
.
extensionDevelopmentPath
)
{
// can be overriden via settings (not for PDE though!)
openFilesInNewWindow
=
settings
.
m
anager
.
getValue
(
'
window.openFilesInNewWindow
'
,
openFilesInNewWindow
);
openFilesInNewWindow
=
this
.
settingsM
anager
.
getValue
(
'
window.openFilesInNewWindow
'
,
openFilesInNewWindow
);
}
}
...
...
@@ -720,7 +721,7 @@ export class WindowsManager implements IWindowsManager {
this
.
open
({
cli
:
openConfig
.
cli
,
forceNewWindow
:
true
,
forceEmpty
:
openConfig
.
cli
.
pathArguments
.
length
===
0
});
}
private
toConfiguration
(
userEnv
:
env
.
IProcessEnvironment
,
cli
:
env
.
ICommandLineArguments
,
workspacePath
?:
string
,
filesToOpen
?:
window
.
IPath
[],
filesToCreate
?:
window
.
IPath
[],
filesToDiff
?:
window
.
IPath
[],
extensionsToInstall
?:
string
[]):
window
.
IWindowConfiguration
{
private
toConfiguration
(
userEnv
:
IProcessEnvironment
,
cli
:
ICommandLineArguments
,
workspacePath
?:
string
,
filesToOpen
?:
window
.
IPath
[],
filesToCreate
?:
window
.
IPath
[],
filesToDiff
?:
window
.
IPath
[],
extensionsToInstall
?:
string
[]):
window
.
IWindowConfiguration
{
let
configuration
:
window
.
IWindowConfiguration
=
objects
.
mixin
({},
cli
);
// inherit all properties from CLI
configuration
.
execPath
=
process
.
execPath
;
configuration
.
workspacePath
=
workspacePath
;
...
...
@@ -731,12 +732,12 @@ export class WindowsManager implements IWindowsManager {
configuration
.
appName
=
this
.
envService
.
product
.
nameLong
;
configuration
.
applicationName
=
this
.
envService
.
product
.
applicationName
;
configuration
.
darwinBundleIdentifier
=
this
.
envService
.
product
.
darwinBundleIdentifier
;
configuration
.
appRoot
=
env
.
appRoot
;
configuration
.
version
=
env
.
version
;
configuration
.
appRoot
=
this
.
envService
.
appRoot
;
configuration
.
version
=
this
.
envService
.
version
;
configuration
.
commitHash
=
this
.
envService
.
product
.
commit
;
configuration
.
appSettingsHome
=
env
.
appSettingsHome
;
configuration
.
appSettingsPath
=
env
.
appSettingsPath
;
configuration
.
appKeybindingsPath
=
env
.
appKeybindingsPath
;
configuration
.
appSettingsHome
=
this
.
envService
.
appSettingsHome
;
configuration
.
appSettingsPath
=
this
.
envService
.
appSettingsPath
;
configuration
.
appKeybindingsPath
=
this
.
envService
.
appKeybindingsPath
;
configuration
.
userExtensionsHome
=
this
.
envService
.
userExtensionsHome
;
configuration
.
extensionTips
=
this
.
envService
.
product
.
extensionTips
;
configuration
.
mainIPCHandle
=
this
.
envService
.
mainIPCHandle
;
...
...
@@ -806,9 +807,9 @@ export class WindowsManager implements IWindowsManager {
return
null
;
}
let
parsedPath
:
env
.
IParsedPath
;
let
parsedPath
:
IParsedPath
;
if
(
gotoLineMode
)
{
parsedPath
=
env
.
parseLineAndColumnAware
(
anyPath
);
parsedPath
=
parseLineAndColumnAware
(
anyPath
);
anyPath
=
parsedPath
.
path
;
}
...
...
@@ -834,7 +835,7 @@ export class WindowsManager implements IWindowsManager {
return
null
;
}
private
cliToPaths
(
cli
:
env
.
ICommandLineArguments
,
ignoreFileNotFound
?:
boolean
):
window
.
IPath
[]
{
private
cliToPaths
(
cli
:
ICommandLineArguments
,
ignoreFileNotFound
?:
boolean
):
window
.
IPath
[]
{
// Check for pass in candidate or last opened path
let
candidates
:
string
[]
=
[];
...
...
@@ -844,7 +845,7 @@ export class WindowsManager implements IWindowsManager {
// No path argument, check settings for what to do now
else
{
let
reopenFolders
=
settings
.
m
anager
.
getValue
(
'
window.reopenFolders
'
,
'
one
'
);
let
reopenFolders
=
this
.
settingsM
anager
.
getValue
(
'
window.reopenFolders
'
,
'
one
'
);
let
lastActiveFolder
=
this
.
windowsState
.
lastActiveWindow
&&
this
.
windowsState
.
lastActiveWindow
.
workspacePath
;
// Restore all
...
...
@@ -1058,7 +1059,7 @@ export class WindowsManager implements IWindowsManager {
});
}
public
focusLastActive
(
cli
:
env
.
ICommandLineArguments
):
window
.
VSCodeWindow
{
public
focusLastActive
(
cli
:
ICommandLineArguments
):
window
.
VSCodeWindow
{
let
lastActive
=
this
.
getLastActiveWindow
();
if
(
lastActive
)
{
lastActive
.
focus
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录