Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
18beedd4
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
18beedd4
编写于
8月 08, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improve consistency in env sent to renderer procs
fixes #10194
上级
ff061902
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
194 addition
and
195 deletion
+194
-195
scripts/code.bat
scripts/code.bat
+1
-0
scripts/code.sh
scripts/code.sh
+1
-0
src/vs/base/common/platform.ts
src/vs/base/common/platform.ts
+3
-3
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+16
-19
src/vs/workbench/electron-browser/index.html
src/vs/workbench/electron-browser/index.html
+173
-167
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+0
-6
未找到文件。
scripts/code.bat
浏览文件 @
18beedd4
...
...
@@ -17,6 +17,7 @@ if not exist out node .\node_modules\gulp\bin\gulp.js compile
:: Configuration
set
NODE_ENV
=
development
set
VSCODE_DEV
=
1
set
VSCODE_CLI
=
1
set
ELECTRON_DEFAULT_ERROR_MODE
=
1
set
ELECTRON_ENABLE_LOGGING
=
1
set
ELECTRON_ENABLE_STACK_DUMPING
=
1
...
...
scripts/code.sh
浏览文件 @
18beedd4
...
...
@@ -22,6 +22,7 @@ function code() {
# Configuration
export
NODE_ENV
=
development
export
VSCODE_DEV
=
1
export
VSCODE_CLI
=
1
export
ELECTRON_ENABLE_LOGGING
=
1
export
ELECTRON_ENABLE_STACK_DUMPING
=
1
...
...
src/vs/base/common/platform.ts
浏览文件 @
18beedd4
...
...
@@ -44,10 +44,10 @@ if (typeof process === 'object') {
_isMacintosh
=
(
process
.
platform
===
'
darwin
'
);
_isLinux
=
(
process
.
platform
===
'
linux
'
);
_isRootUser
=
!
_isWindows
&&
(
process
.
getuid
()
===
0
);
let
vscode_nls_c
onfig
=
process
.
env
[
'
VSCODE_NLS_CONFIG
'
];
if
(
vscode_nls_c
onfig
)
{
let
rawNlsC
onfig
=
process
.
env
[
'
VSCODE_NLS_CONFIG
'
];
if
(
rawNlsC
onfig
)
{
try
{
let
nlsConfig
:
NLSConfig
=
JSON
.
parse
(
vscode_nls_c
onfig
);
let
nlsConfig
:
NLSConfig
=
JSON
.
parse
(
rawNlsC
onfig
);
let
resolved
=
nlsConfig
.
availableLanguages
[
'
*
'
];
_locale
=
nlsConfig
.
locale
;
// VSCode's default language is 'en'
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
18beedd4
...
...
@@ -269,7 +269,7 @@ interface IEnv {
[
key
:
string
]:
string
;
}
function
getUnix
User
Environment
():
TPromise
<
IEnv
>
{
function
getUnix
Shell
Environment
():
TPromise
<
IEnv
>
{
const
promise
=
new
TPromise
((
c
,
e
)
=>
{
const
runAsNode
=
process
.
env
[
'
ATOM_SHELL_INTERNAL_RUN_AS_NODE
'
];
const
noAttach
=
process
.
env
[
'
ELECTRON_NO_ATTACH_CONSOLE
'
];
...
...
@@ -328,20 +328,20 @@ function getUnixUserEnvironment(): TPromise<IEnv> {
}
/**
*
On Unix systems, we might need to get the environment
*
from a user's shell. This should only be done when Code
*
is not launched from a Termina
l.
*
We eed to get the environment from a user's shell.
*
This should only be done when Code itself is not launched
*
from within a shel
l.
*/
function
get
User
ShellEnvironment
():
TPromise
<
IEnv
>
{
if
(
p
latform
.
isWindows
)
{
function
getShellEnvironment
():
TPromise
<
IEnv
>
{
if
(
p
rocess
.
env
[
'
VSCODE_CLI
'
]
===
'
1
'
)
{
return
TPromise
.
as
({});
}
if
(
p
rocess
.
env
[
'
VSCODE_CLI
'
]
===
'
1
'
)
{
if
(
p
latform
.
isWindows
)
{
return
TPromise
.
as
({});
}
return
getUnix
User
Environment
();
return
getUnix
Shell
Environment
();
}
/**
...
...
@@ -349,32 +349,29 @@ function getUserShellEnvironment(): TPromise<IEnv> {
* Such environment needs to be propagated to the renderer/shared
* processes.
*/
function
get
User
Environment
():
TPromise
<
IEnv
>
{
return
get
UserShellEnvironment
().
then
(
userS
hellEnv
=>
{
function
getEnvironment
():
TPromise
<
IEnv
>
{
return
get
ShellEnvironment
().
then
(
s
hellEnv
=>
{
return
instantiationService
.
invokeFunction
(
a
=>
{
const
envService
=
a
.
get
(
IEnvironmentService
);
const
instanceEnv
=
{
VSCODE_PID
:
String
(
process
.
pid
),
VSCODE_IPC_HOOK
:
envService
.
mainIPCHandle
,
VSCODE_SHARED_IPC_HOOK
:
envService
.
sharedIPCHandle
VSCODE_SHARED_IPC_HOOK
:
envService
.
sharedIPCHandle
,
VSCODE_NLS_CONFIG
:
process
.
env
[
'
VSCODE_NLS_CONFIG
'
]
};
return
assign
({},
userS
hellEnv
,
instanceEnv
);
return
assign
({},
s
hellEnv
,
instanceEnv
);
});
});
}
// On some platforms we need to manually read from the global environment variables
// and assign them to the process environment (e.g. when doubleclick app on Mac)
getUserEnvironment
().
then
(
userEnv
=>
{
assign
(
process
.
env
,
userEnv
);
// Make sure the NLS Config travels to the rendered process
// See also https://github.com/Microsoft/vscode/issues/4558
userEnv
[
'
VSCODE_NLS_CONFIG
'
]
=
process
.
env
[
'
VSCODE_NLS_CONFIG
'
];
getEnvironment
().
then
(
env
=>
{
assign
(
process
.
env
,
env
);
return
instantiationService
.
invokeFunction
(
a
=>
a
.
get
(
IEnvironmentService
).
createPaths
())
.
then
(()
=>
instantiationService
.
invokeFunction
(
setupIPC
))
.
then
(
ipcServer
=>
instantiationService
.
invokeFunction
(
main
,
ipcServer
,
userE
nv
));
.
then
(
ipcServer
=>
instantiationService
.
invokeFunction
(
main
,
ipcServer
,
e
nv
));
})
.
done
(
null
,
err
=>
instantiationService
.
invokeFunction
(
quit
,
err
));
\ No newline at end of file
src/vs/workbench/electron-browser/index.html
浏览文件 @
18beedd4
...
...
@@ -14,215 +14,221 @@
<!-- Helpers -->
<script
type=
"text/javascript"
>
var
fs
=
require
(
'
fs
'
);
var
path
=
require
(
'
path
'
);
var
electron
=
require
(
'
electron
'
);
var
remote
=
electron
.
remote
;
var
ipc
=
electron
.
ipcRenderer
;
var
windowId
=
remote
.
getCurrentWindow
().
id
;
function
onError
(
error
,
enableDeveloperTools
)
{
if
(
enableDeveloperTools
)
{
ipc
.
send
(
'
vscode:openDevTools
'
,
windowId
);
}
var
path
=
require
(
'
path
'
);
var
electron
=
require
(
'
electron
'
);
var
remote
=
electron
.
remote
;
var
ipc
=
electron
.
ipcRenderer
;
var
windowId
=
remote
.
getCurrentWindow
().
id
;
function
onError
(
error
,
enableDeveloperTools
)
{
if
(
enableDeveloperTools
)
{
ipc
.
send
(
'
vscode:openDevTools
'
,
windowId
);
}
console
.
error
(
'
[uncaught exception]:
'
+
error
);
console
.
error
(
'
[uncaught exception]:
'
+
error
);
if
(
error
.
stack
)
{
console
.
error
(
error
.
stack
);
}
if
(
error
.
stack
)
{
console
.
error
(
error
.
stack
);
}
}
function
parseURLQueryArgs
()
{
var
result
=
{};
var
search
=
window
.
location
.
search
;
if
(
search
)
{
var
params
=
search
.
split
(
/
[
?&
]
/
);
for
(
var
i
=
0
;
i
<
params
.
length
;
i
++
)
{
var
param
=
params
[
i
];
if
(
param
)
{
var
keyValue
=
param
.
split
(
'
=
'
);
if
(
keyValue
.
length
===
2
)
{
result
[
keyValue
[
0
]]
=
decodeURIComponent
(
keyValue
[
1
]);
}
function
parseURLQueryArgs
()
{
var
result
=
{};
var
search
=
window
.
location
.
search
;
if
(
search
)
{
var
params
=
search
.
split
(
/
[
?&
]
/
);
for
(
var
i
=
0
;
i
<
params
.
length
;
i
++
)
{
var
param
=
params
[
i
];
if
(
param
)
{
var
keyValue
=
param
.
split
(
'
=
'
);
if
(
keyValue
.
length
===
2
)
{
result
[
keyValue
[
0
]]
=
decodeURIComponent
(
keyValue
[
1
]);
}
}
}
return
result
;
}
function
createScript
(
src
,
onload
)
{
var
script
=
document
.
createElement
(
'
script
'
);
script
.
src
=
src
;
script
.
addEventListener
(
'
load
'
,
onload
);
return
result
;
}
var
head
=
document
.
getElementsByTagName
(
'
head
'
)[
0
];
head
.
insertBefore
(
script
,
head
.
lastChild
);
}
function
createScript
(
src
,
onload
)
{
var
script
=
document
.
createElement
(
'
script
'
);
script
.
src
=
src
;
script
.
addEventListener
(
'
load
'
,
onload
);
function
uriFromPath
(
_path
)
{
var
pathName
=
path
.
resolve
(
_path
).
replace
(
/
\\
/g
,
'
/
'
);
var
head
=
document
.
getElementsByTagName
(
'
head
'
)[
0
];
head
.
insertBefore
(
script
,
head
.
lastChild
);
}
if
(
pathName
.
length
>
0
&&
pathName
.
charAt
(
0
)
!==
'
/
'
)
{
pathName
=
'
/
'
+
pathName
;
}
function
uriFromPath
(
_path
)
{
var
pathName
=
path
.
resolve
(
_path
).
replace
(
/
\\
/g
,
'
/
'
);
return
encodeURI
(
'
file://
'
+
pathName
);
if
(
pathName
.
length
>
0
&&
pathName
.
charAt
(
0
)
!==
'
/
'
)
{
pathName
=
'
/
'
+
pathName
;
}
function
registerListeners
(
enableDeveloperTools
)
{
// Devtools & reload support
if
(
enableDeveloperTools
)
{
var
extractKey
=
function
(
e
)
{
return
[
e
.
ctrlKey
?
'
ctrl-
'
:
''
,
e
.
metaKey
?
'
meta-
'
:
''
,
e
.
altKey
?
'
alt-
'
:
''
,
e
.
shiftKey
?
'
shift-
'
:
''
,
e
.
keyCode
].
join
(
''
);
};
var
TOGGLE_DEV_TOOLS_KB
=
(
process
.
platform
===
'
darwin
'
?
'
meta-alt-73
'
:
'
ctrl-shift-73
'
);
// mac: Cmd-Alt-I, rest: Ctrl-Shift-I
var
RELOAD_KB
=
(
process
.
platform
===
'
darwin
'
?
'
meta-82
'
:
'
ctrl-82
'
);
// mac: Cmd-R, rest: Ctrl-R
window
.
addEventListener
(
'
keydown
'
,
function
(
e
)
{
var
key
=
extractKey
(
e
);
if
(
key
===
TOGGLE_DEV_TOOLS_KB
)
{
ipc
.
send
(
'
vscode:toggleDevTools
'
,
windowId
);
}
else
if
(
key
===
RELOAD_KB
)
{
ipc
.
send
(
'
vscode:reloadWindow
'
,
windowId
);
}
});
}
return
encodeURI
(
'
file://
'
+
pathName
);
}
process
.
on
(
'
uncaughtException
'
,
function
(
error
)
{
onError
(
error
,
enableDeveloperTools
)
});
function
registerListeners
(
enableDeveloperTools
)
{
// Devtools & reload support
if
(
enableDeveloperTools
)
{
var
extractKey
=
function
(
e
)
{
return
[
e
.
ctrlKey
?
'
ctrl-
'
:
''
,
e
.
metaKey
?
'
meta-
'
:
''
,
e
.
altKey
?
'
alt-
'
:
''
,
e
.
shiftKey
?
'
shift-
'
:
''
,
e
.
keyCode
].
join
(
''
);
};
var
TOGGLE_DEV_TOOLS_KB
=
(
process
.
platform
===
'
darwin
'
?
'
meta-alt-73
'
:
'
ctrl-shift-73
'
);
// mac: Cmd-Alt-I, rest: Ctrl-Shift-I
var
RELOAD_KB
=
(
process
.
platform
===
'
darwin
'
?
'
meta-82
'
:
'
ctrl-82
'
);
// mac: Cmd-R, rest: Ctrl-R
window
.
addEventListener
(
'
keydown
'
,
function
(
e
)
{
var
key
=
extractKey
(
e
);
if
(
key
===
TOGGLE_DEV_TOOLS_KB
)
{
ipc
.
send
(
'
vscode:toggleDevTools
'
,
windowId
);
}
else
if
(
key
===
RELOAD_KB
)
{
ipc
.
send
(
'
vscode:reloadWindow
'
,
windowId
);
}
});
}
process
.
on
(
'
uncaughtException
'
,
function
(
error
)
{
onError
(
error
,
enableDeveloperTools
)
});
}
function
assign
(
destination
,
source
)
{
source
=>
Object
.
keys
(
source
).
forEach
(
key
=>
destination
[
key
]
=
source
[
key
]);
return
destination
;
}
</script>
<!-- Startup Code -->
<script
type=
"text/javascript"
>
var
webFrame
=
require
(
'
electron
'
).
webFrame
;
var
args
=
parseURLQueryArgs
();
var
configuration
=
JSON
.
parse
(
args
[
'
config
'
])
||
{};
var
enableDeveloperTools
=
!
configuration
.
isBuilt
||
!!
configuration
.
extensionDevelopmentPath
;
// Correctly inherit the parent's environment
assign
(
process
.
env
,
configuration
.
userEnv
);
// Get the nls configuration into the process.env as early as possible.
var
nlsConfig
=
{
availableLanguages
:
{}
};
var
config
=
process
.
env
[
'
VSCODE_NLS_CONFIG
'
];
if
(
config
)
{
process
.
env
[
'
VSCODE_NLS_CONFIG
'
]
=
config
;
try
{
nlsConfig
=
JSON
.
parse
(
config
);
}
catch
(
e
)
{}
}
var
mainStarted
=
false
;
var
args
=
parseURLQueryArgs
();
var
configuration
=
JSON
.
parse
(
args
[
'
config
'
]);
var
enableDeveloperTools
=
!
configuration
.
isBuilt
||
!!
configuration
.
extensionDevelopmentPath
;
var
locale
=
nlsConfig
.
availableLanguages
[
'
*
'
]
||
'
en
'
;
// Get the nls configuration into the process.env as early as possible.
var
nlsConfig
=
{
availableLanguages
:
{}
};
if
(
configuration
.
userEnv
&&
configuration
.
userEnv
[
'
VSCODE_NLS_CONFIG
'
])
{
var
config
=
configuration
.
userEnv
[
'
VSCODE_NLS_CONFIG
'
];
process
.
env
[
'
VSCODE_NLS_CONFIG
'
]
=
config
;
try
{
if
(
config
)
{
nlsConfig
=
JSON
.
parse
(
config
);
}
}
catch
(
e
)
{
}
}
var
locale
=
nlsConfig
.
availableLanguages
[
'
*
'
]
||
'
en
'
;
if
(
locale
===
'
zh-tw
'
)
{
locale
=
'
zh-Hant
'
;
}
else
if
(
locale
===
'
zh-cn
'
)
{
locale
=
'
zh-Hans
'
;
}
window
.
document
.
documentElement
.
setAttribute
(
'
lang
'
,
locale
);
registerListeners
(
enableDeveloperTools
);
// We get the global settings through a remote call from the browser
// because its value can change dynamically.
var
globalSettings
;
var
globalSettingsValue
=
remote
.
getGlobal
(
'
globalSettingsValue
'
);
if
(
globalSettingsValue
)
{
globalSettings
=
JSON
.
parse
(
globalSettingsValue
);
}
else
{
globalSettings
=
{
settings
:
{},
keybindings
:
[]
};
}
if
(
locale
===
'
zh-tw
'
)
{
locale
=
'
zh-Hant
'
;
}
else
if
(
locale
===
'
zh-cn
'
)
{
locale
=
'
zh-Hans
'
;
}
// disable pinch zoom & apply zoom level early to avoid glitches
var
windowConfiguration
=
globalSettings
.
settings
&&
globalSettings
.
settings
.
window
;
webFrame
.
setZoomLevelLimits
(
1
,
1
);
if
(
windowConfiguration
&&
typeof
windowConfiguration
.
zoomLevel
===
'
number
'
&&
windowConfiguration
.
zoomLevel
!==
0
)
{
webFrame
.
setZoomLevel
(
windowConfiguration
.
zoomLevel
);
}
window
.
document
.
documentElement
.
setAttribute
(
'
lang
'
,
locale
);
registerListeners
(
enableDeveloperTools
);
// We get the global settings through a remote call from the browser
// because its value can change dynamically.
var
globalSettings
;
var
globalSettingsValue
=
remote
.
getGlobal
(
'
globalSettingsValue
'
);
if
(
globalSettingsValue
)
{
globalSettings
=
JSON
.
parse
(
globalSettingsValue
);
}
else
{
globalSettings
=
{
settings
:
{},
keybindings
:
[]
};
}
// Load the loader and start loading the workbench
var
rootUrl
=
uriFromPath
(
configuration
.
appRoot
)
+
'
/out
'
;
// In the bundled version the nls plugin is packaged with the loader so the NLS Plugins
// loads as soon as the loader loads. To be able to have pseudo translation
createScript
(
rootUrl
+
'
/vs/loader.js
'
,
function
()
{
define
(
'
fs
'
,
[
'
original-fs
'
],
function
(
originalFS
)
{
return
originalFS
;
});
// replace the patched electron fs with the original node fs for all AMD code
require
.
config
({
baseUrl
:
rootUrl
,
'
vs/nls
'
:
nlsConfig
,
recordStats
:
configuration
.
enablePerformance
,
ignoreDuplicateModules
:
[
'
vs/workbench/parts/search/common/searchQuery
'
]
});
if
(
nlsConfig
.
pseudo
)
{
require
([
'
vs/nls
'
],
function
(
nlsPlugin
)
{
nlsPlugin
.
setPseudoTranslation
(
nlsConfig
.
pseudo
);
});
}
// disable pinch zoom & apply zoom level early to avoid glitches
var
windowConfiguration
=
globalSettings
.
settings
&&
globalSettings
.
settings
.
window
;
webFrame
.
setZoomLevelLimits
(
1
,
1
);
if
(
windowConfiguration
&&
typeof
windowConfiguration
.
zoomLevel
===
'
number
'
&&
windowConfiguration
.
zoomLevel
!==
0
)
{
webFrame
.
setZoomLevel
(
windowConfiguration
.
zoomLevel
);
}
window
.
MonacoEnvironment
=
{};
var
timers
=
window
.
MonacoEnvironment
.
timers
=
{
start
:
new
Date
()
};
// Load the loader and start loading the workbench
var
rootUrl
=
uriFromPath
(
configuration
.
appRoot
)
+
'
/out
'
;
// In the bundled version the nls plugin is packaged with the loader so the NLS Plugins
// loads as soon as the loader loads. To be able to have pseudo translation
createScript
(
rootUrl
+
'
/vs/loader.js
'
,
function
()
{
define
(
'
fs
'
,
[
'
original-fs
'
],
function
(
originalFS
)
{
return
originalFS
;
});
// replace the patched electron fs with the original node fs for all AMD code
require
.
config
({
baseUrl
:
rootUrl
,
'
vs/nls
'
:
nlsConfig
,
recordStats
:
configuration
.
enablePerformance
,
ignoreDuplicateModules
:
[
'
vs/workbench/parts/search/common/searchQuery
'
]
});
if
(
nlsConfig
.
pseudo
)
{
require
([
'
vs/nls
'
],
function
(
nlsPlugin
)
{
nlsPlugin
.
setPseudoTranslation
(
nlsConfig
.
pseudo
);
});
}
if
(
configuration
.
enablePerformance
)
{
var
programStart
=
remote
.
getGlobal
(
'
programStart
'
);
var
vscodeStart
=
remote
.
getGlobal
(
'
vscodeStart
'
);
window
.
MonacoEnvironment
=
{};
var
timers
=
window
.
MonacoEnvironment
.
timers
=
{
start
:
new
Date
()
};
if
(
programStart
)
{
timers
.
beforeProgram
=
new
Date
(
programStart
);
timers
.
afterProgram
=
new
Date
(
vscodeStart
);
}
if
(
configuration
.
enablePerformance
)
{
var
programStart
=
remote
.
getGlobal
(
'
programStart
'
);
var
vscodeStart
=
remote
.
getGlobal
(
'
vscodeStart
'
);
timers
.
vscodeStart
=
new
Date
(
vscodeStart
);
timers
.
start
=
new
Date
(
programStart
||
vscodeStart
);
if
(
programStart
)
{
timers
.
beforeProgram
=
new
Date
(
programStart
);
timers
.
afterProgram
=
new
Date
(
vscodeStart
);
}
timers
.
beforeLoad
=
new
Date
();
timers
.
vscodeStart
=
new
Date
(
vscodeStart
);
timers
.
start
=
new
Date
(
programStart
||
vscodeStart
);
}
require
([
'
vs/workbench/workbench.main
'
,
'
vs/nls!vs/workbench/workbench.main
'
,
'
vs/css!vs/workbench/workbench.main
'
],
function
()
{
timers
.
afterLoad
=
new
Date
();
timers
.
beforeLoad
=
new
Date
();
var
main
=
require
(
'
vs/workbench/electron-browser/main
'
);
main
.
startup
(
configuration
,
globalSettings
).
then
(
function
()
{
mainStarted
=
true
;
},
function
(
error
)
{
onError
(
error
,
enableDeveloperTools
)
});
});
});
require
([
'
vs/workbench/electron-browser/main
'
,
'
vs/workbench/workbench.main
'
,
'
vs/nls!vs/workbench/workbench.main
'
,
'
vs/css!vs/workbench/workbench.main
'
],
(
main
)
=>
{
timers
.
afterLoad
=
new
Date
();
main
.
startup
(
configuration
,
globalSettings
)
.
done
(
null
,
error
=>
onError
(
error
,
enableDeveloperTools
));
});
});
</script>
</head>
<body
class=
"monaco-shell vs-dark"
aria-label=
""
>
<script>
(
function
()
{
try
{
var
theme
=
window
.
localStorage
.
getItem
(
'
storage://global/workbench.theme
'
);
if
(
theme
)
{
var
baseTheme
=
theme
.
split
(
'
'
)[
0
];
if
(
baseTheme
!==
'
vs-dark
'
)
{
window
.
document
.
body
.
className
=
'
monaco-shell
'
+
baseTheme
;
}
try
{
var
theme
=
window
.
localStorage
.
getItem
(
'
storage://global/workbench.theme
'
);
if
(
theme
)
{
var
baseTheme
=
theme
.
split
(
'
'
)[
0
];
if
(
baseTheme
!==
'
vs-dark
'
)
{
window
.
document
.
body
.
className
=
'
monaco-shell
'
+
baseTheme
;
}
}
catch
(
error
)
{
console
.
error
(
error
);
}
})();
}
catch
(
error
)
{
console
.
error
(
error
);
}
})();
</script>
</body>
</html>
\ No newline at end of file
src/vs/workbench/electron-browser/main.ts
浏览文件 @
18beedd4
...
...
@@ -12,7 +12,6 @@ import errors = require('vs/base/common/errors');
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
timer
=
require
(
'
vs/base/common/timer
'
);
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
uri
from
'
vs/base/common/uri
'
;
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
...
...
@@ -20,10 +19,8 @@ import {EventService} from 'vs/platform/event/common/eventService';
import
{
WorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
IWorkspace
,
IConfiguration
,
IEnvironment
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ConfigurationService
}
from
'
vs/workbench/services/configuration/node/configurationService
'
;
import
path
=
require
(
'
path
'
);
import
fs
=
require
(
'
fs
'
);
import
gracefulFs
=
require
(
'
graceful-fs
'
);
gracefulFs
.
gracefulify
(
fs
);
...
...
@@ -56,9 +53,6 @@ export interface IMainEnvironment extends IEnvironment {
}
export
function
startup
(
environment
:
IMainEnvironment
,
globalSettings
:
IGlobalSettings
):
winjs
.
TPromise
<
void
>
{
// Inherit the user environment
assign
(
process
.
env
,
environment
.
userEnv
);
// Shell Configuration
let
shellConfiguration
:
IConfiguration
=
{
env
:
environment
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录