Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
64eb716d
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,体验更适合开发者的 AI 搜索 >>
提交
64eb716d
编写于
1月 04, 2021
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
env - fully qualify our own variables
上级
c03bc427
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
79 addition
and
75 deletion
+79
-75
src/bootstrap-fork.js
src/bootstrap-fork.js
+7
-7
src/vs/base/common/path.ts
src/vs/base/common/path.ts
+2
-2
src/vs/base/common/platform.ts
src/vs/base/common/platform.ts
+3
-0
src/vs/base/node/processes.ts
src/vs/base/node/processes.ts
+6
-6
src/vs/base/node/shell.ts
src/vs/base/node/shell.ts
+10
-10
src/vs/base/parts/ipc/test/node/ipc.cp.test.ts
src/vs/base/parts/ipc/test/node/ipc.cp.test.ts
+1
-1
src/vs/base/test/node/processes/processes.test.ts
src/vs/base/test/node/processes/processes.test.ts
+3
-3
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+4
-4
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+9
-9
src/vs/code/electron-sandbox/issue/issueReporterMain.ts
src/vs/code/electron-sandbox/issue/issueReporterMain.ts
+2
-4
src/vs/platform/diagnostics/node/diagnosticsService.ts
src/vs/platform/diagnostics/node/diagnosticsService.ts
+4
-4
src/vs/platform/files/node/watcher/nsfw/watcherService.ts
src/vs/platform/files/node/watcher/nsfw/watcherService.ts
+3
-3
src/vs/platform/files/node/watcher/unix/watcherService.ts
src/vs/platform/files/node/watcher/unix/watcherService.ts
+3
-3
src/vs/platform/native/electron-main/nativeHostMainService.ts
...vs/platform/native/electron-main/nativeHostMainService.ts
+7
-4
src/vs/platform/telemetry/node/commonProperties.ts
src/vs/platform/telemetry/node/commonProperties.ts
+1
-1
src/vs/workbench/browser/web.main.ts
src/vs/workbench/browser/web.main.ts
+1
-0
src/vs/workbench/contrib/debug/node/debugHelperService.ts
src/vs/workbench/contrib/debug/node/debugHelperService.ts
+2
-2
src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
...workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
+2
-3
src/vs/workbench/services/extensions/electron-browser/localProcessExtensionHost.ts
.../extensions/electron-browser/localProcessExtensionHost.ts
+4
-4
src/vs/workbench/services/search/electron-browser/searchService.ts
...rkbench/services/search/electron-browser/searchService.ts
+3
-3
src/vs/workbench/services/timer/browser/timerService.ts
src/vs/workbench/services/timer/browser/timerService.ts
+1
-0
src/vs/workbench/workbench.web.api.ts
src/vs/workbench/workbench.web.api.ts
+1
-2
未找到文件。
src/bootstrap-fork.js
浏览文件 @
64eb716d
...
...
@@ -23,7 +23,7 @@ if (process.env['VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH']) {
}
// Configure: pipe logging to parent process
if
(
!!
process
.
send
&&
process
.
env
.
PIPE_LOGGING
===
'
true
'
)
{
if
(
!!
process
.
send
&&
process
.
env
[
'
VSCODE_PIPE_LOGGING
'
]
===
'
true
'
)
{
pipeLoggingToParent
();
}
...
...
@@ -41,7 +41,7 @@ if (process.env['VSCODE_PARENT_PID']) {
configureCrashReporter
();
// Load AMD entry point
require
(
'
./bootstrap-amd
'
).
load
(
process
.
env
[
'
AMD_ENTRYPOINT
'
]);
require
(
'
./bootstrap-amd
'
).
load
(
process
.
env
[
'
VSCODE_
AMD_ENTRYPOINT
'
]);
//#region Helpers
...
...
@@ -82,7 +82,7 @@ function pipeLoggingToParent() {
// Add the stack trace as payload if we are told so. We remove the message and the 2 top frames
// to start the stacktrace where the console message was being written
if
(
process
.
env
.
VSCODE_LOG_STACK
===
'
true
'
)
{
if
(
process
.
env
[
'
VSCODE_LOG_STACK
'
]
===
'
true
'
)
{
const
stack
=
new
Error
().
stack
;
if
(
stack
)
{
argsArray
.
push
({
__
$stack
:
stack
.
split
(
'
\n
'
).
slice
(
3
).
join
(
'
\n
'
)
});
...
...
@@ -152,7 +152,7 @@ function pipeLoggingToParent() {
* @param {'log' | 'warn' | 'error'} severity
*/
function
wrapConsoleMethod
(
method
,
severity
)
{
if
(
process
.
env
.
VSCODE_LOG_NATIVE
===
'
true
'
)
{
if
(
process
.
env
[
'
VSCODE_LOG_NATIVE
'
]
===
'
true
'
)
{
const
original
=
console
[
method
];
console
[
method
]
=
function
()
{
safeSendConsoleMessage
(
severity
,
safeToArray
(
arguments
));
...
...
@@ -168,12 +168,12 @@ function pipeLoggingToParent() {
}
// Pass console logging to the outside so that we have it in the main side if told so
if
(
process
.
env
.
VERBOSE_LOGGING
===
'
true
'
)
{
if
(
process
.
env
[
'
VSCODE_VERBOSE_LOGGING
'
]
===
'
true
'
)
{
wrapConsoleMethod
(
'
info
'
,
'
log
'
);
wrapConsoleMethod
(
'
log
'
,
'
log
'
);
wrapConsoleMethod
(
'
warn
'
,
'
warn
'
);
wrapConsoleMethod
(
'
error
'
,
'
error
'
);
}
else
if
(
process
.
env
.
VSCODE_LOG_NATIVE
!==
'
true
'
)
{
}
else
if
(
process
.
env
[
'
VSCODE_LOG_NATIVE
'
]
!==
'
true
'
)
{
console
.
log
=
function
()
{
/* ignore */
};
console
.
warn
=
function
()
{
/* ignore */
};
console
.
info
=
function
()
{
/* ignore */
};
...
...
@@ -209,7 +209,7 @@ function terminateWhenParentTerminates() {
}
function
configureCrashReporter
()
{
const
crashReporterOptionsRaw
=
process
.
env
[
'
CRASH_REPORTER_START_OPTIONS
'
];
const
crashReporterOptionsRaw
=
process
.
env
[
'
VSCODE_
CRASH_REPORTER_START_OPTIONS
'
];
if
(
typeof
crashReporterOptionsRaw
===
'
string
'
)
{
try
{
const
crashReporterOptions
=
JSON
.
parse
(
crashReporterOptionsRaw
);
...
...
src/vs/base/common/path.ts
浏览文件 @
64eb716d
...
...
@@ -43,7 +43,7 @@ const CHAR_QUESTION_MARK = 63; /* ? */
class
ErrorInvalidArgType
extends
Error
{
code
:
'
ERR_INVALID_ARG_TYPE
'
;
constructor
(
name
:
string
,
expected
:
string
,
actual
:
any
)
{
constructor
(
name
:
string
,
expected
:
string
,
actual
:
unknown
)
{
// determiner: 'must be' or 'must not be'
let
determiner
;
if
(
typeof
expected
===
'
string
'
&&
expected
.
indexOf
(
'
not
'
)
===
0
)
{
...
...
@@ -215,7 +215,7 @@ export const win32: IPath = {
// absolute path, get cwd for that drive, or the process cwd if
// the drive cwd is not available. We're sure the device is not
// a UNC path at this points, because UNC paths are always absolute.
path
=
(
process
.
env
as
any
)
[
`=
${
resolvedDevice
}
`
]
||
process
.
cwd
();
path
=
process
.
env
[
`=
${
resolvedDevice
}
`
]
||
process
.
cwd
();
// Verify that a cwd was found and that it actually points
// to our drive. If not, default to the drive's root.
...
...
src/vs/base/common/platform.ts
浏览文件 @
64eb716d
...
...
@@ -8,6 +8,7 @@ const LANGUAGE_DEFAULT = 'en';
let
_isWindows
=
false
;
let
_isMacintosh
=
false
;
let
_isLinux
=
false
;
let
_isLinuxSnap
=
false
;
let
_isNative
=
false
;
let
_isWeb
=
false
;
let
_isIOS
=
false
;
...
...
@@ -79,6 +80,7 @@ else if (typeof nodeProcess === 'object') {
_isWindows
=
(
nodeProcess
.
platform
===
'
win32
'
);
_isMacintosh
=
(
nodeProcess
.
platform
===
'
darwin
'
);
_isLinux
=
(
nodeProcess
.
platform
===
'
linux
'
);
_isLinuxSnap
=
_isLinux
&&
!!
nodeProcess
.
env
[
'
SNAP
'
]
&&
!!
nodeProcess
.
env
[
'
SNAP_REVISION
'
];
_locale
=
LANGUAGE_DEFAULT
;
_language
=
LANGUAGE_DEFAULT
;
const
rawNlsConfig
=
nodeProcess
.
env
[
'
VSCODE_NLS_CONFIG
'
];
...
...
@@ -128,6 +130,7 @@ if (_isMacintosh) {
export
const
isWindows
=
_isWindows
;
export
const
isMacintosh
=
_isMacintosh
;
export
const
isLinux
=
_isLinux
;
export
const
isLinuxSnap
=
_isLinuxSnap
;
export
const
isNative
=
_isNative
;
export
const
isWeb
=
_isWeb
;
export
const
isIOS
=
_isIOS
;
...
...
src/vs/base/node/processes.ts
浏览文件 @
64eb716d
...
...
@@ -50,7 +50,7 @@ function terminateProcess(process: cp.ChildProcess, cwd?: string): Promise<Termi
options
.
cwd
=
cwd
;
}
const
killProcess
=
cp
.
execFile
(
'
taskkill
'
,
[
'
/T
'
,
'
/F
'
,
'
/PID
'
,
process
.
pid
.
toString
()],
options
);
return
new
Promise
(
(
resolve
,
reject
)
=>
{
return
new
Promise
(
resolve
=>
{
killProcess
.
once
(
'
error
'
,
(
err
)
=>
{
resolve
({
success
:
false
,
error
:
err
});
});
...
...
@@ -68,7 +68,7 @@ function terminateProcess(process: cp.ChildProcess, cwd?: string): Promise<Termi
}
else
if
(
Platform
.
isLinux
||
Platform
.
isMacintosh
)
{
try
{
const
cmd
=
FileAccess
.
asFileUri
(
'
vs/base/node/terminateProcess.sh
'
,
require
).
fsPath
;
return
new
Promise
(
(
resolve
,
reject
)
=>
{
return
new
Promise
(
resolve
=>
{
cp
.
execFile
(
cmd
,
[
process
.
pid
.
toString
()],
{
encoding
:
'
utf8
'
,
shell
:
true
}
as
cp
.
ExecFileOptions
,
(
err
,
stdout
,
stderr
)
=>
{
if
(
err
)
{
resolve
({
success
:
false
,
error
:
err
});
...
...
@@ -86,8 +86,8 @@ function terminateProcess(process: cp.ChildProcess, cwd?: string): Promise<Termi
return
Promise
.
resolve
({
success
:
true
});
}
export
function
getWindowsShell
(
env
ironment
:
Platform
.
IProcessEnvironment
=
process
.
env
as
Platform
.
IProcessEnvironment
):
string
{
return
env
ironment
[
'
comspec
'
]
||
'
cmd.exe
'
;
export
function
getWindowsShell
(
env
=
process
.
env
as
Platform
.
IProcessEnvironment
):
string
{
return
env
[
'
comspec
'
]
||
'
cmd.exe
'
;
}
export
abstract
class
AbstractProcess
<
TProgressData
>
{
...
...
@@ -447,8 +447,8 @@ export namespace win32 {
// to the current working directory.
return
path
.
join
(
cwd
,
command
);
}
if
(
paths
===
undefined
&&
Types
.
isString
(
process
.
env
.
PATH
))
{
paths
=
process
.
env
.
PATH
.
split
(
path
.
delimiter
);
if
(
paths
===
undefined
&&
Types
.
isString
(
process
.
env
[
'
PATH
'
]
))
{
paths
=
process
.
env
[
'
PATH
'
]
.
split
(
path
.
delimiter
);
}
// No PATH environment. Make path absolute to the cwd.
if
(
paths
===
undefined
||
paths
.
length
===
0
)
{
...
...
src/vs/base/node/shell.ts
浏览文件 @
64eb716d
...
...
@@ -12,29 +12,29 @@ import * as processes from 'vs/base/node/processes';
* shell that the terminal uses by default.
* @param p The platform to detect the shell of.
*/
export
function
getSystemShell
(
p
:
platform
.
Platform
,
env
ironment
:
platform
.
IProcessEnvironment
=
process
.
env
as
platform
.
IProcessEnvironment
):
string
{
export
function
getSystemShell
(
p
:
platform
.
Platform
,
env
=
process
.
env
as
platform
.
IProcessEnvironment
):
string
{
if
(
p
===
platform
.
Platform
.
Windows
)
{
if
(
platform
.
isWindows
)
{
return
getSystemShellWindows
(
env
ironment
);
return
getSystemShellWindows
(
env
);
}
// Don't detect Windows shell when not on Windows
return
processes
.
getWindowsShell
(
env
ironment
);
return
processes
.
getWindowsShell
(
env
);
}
// Only use $SHELL for the current OS
if
(
platform
.
isLinux
&&
p
===
platform
.
Platform
.
Mac
||
platform
.
isMacintosh
&&
p
===
platform
.
Platform
.
Linux
)
{
return
'
/bin/bash
'
;
}
return
getSystemShellUnixLike
(
env
ironment
);
return
getSystemShellUnixLike
(
env
);
}
let
_TERMINAL_DEFAULT_SHELL_UNIX_LIKE
:
string
|
null
=
null
;
function
getSystemShellUnixLike
(
env
ironment
:
platform
.
IProcessEnvironment
):
string
{
function
getSystemShellUnixLike
(
env
:
platform
.
IProcessEnvironment
):
string
{
if
(
!
_TERMINAL_DEFAULT_SHELL_UNIX_LIKE
)
{
let
unixLikeTerminal
:
string
;
if
(
platform
.
isWindows
)
{
unixLikeTerminal
=
'
/bin/bash
'
;
// for WSL
}
else
{
unixLikeTerminal
=
env
ironment
.
SHELL
;
unixLikeTerminal
=
env
[
'
SHELL
'
]
;
if
(
!
unixLikeTerminal
)
{
try
{
...
...
@@ -59,12 +59,12 @@ function getSystemShellUnixLike(environment: platform.IProcessEnvironment): stri
}
let
_TERMINAL_DEFAULT_SHELL_WINDOWS
:
string
|
null
=
null
;
function
getSystemShellWindows
(
env
ironment
:
platform
.
IProcessEnvironment
):
string
{
function
getSystemShellWindows
(
env
:
platform
.
IProcessEnvironment
):
string
{
if
(
!
_TERMINAL_DEFAULT_SHELL_WINDOWS
)
{
const
isAtLeastWindows10
=
platform
.
isWindows
&&
parseFloat
(
os
.
release
())
>=
10
;
const
is32ProcessOn64Windows
=
env
ironment
.
hasOwnProperty
(
'
PROCESSOR_ARCHITEW6432
'
);
const
powerShellPath
=
`
${
env
ironment
.
windir
}
\
\$
{is32ProcessOn64Windows ? 'Sysnative' : 'System32'}\\WindowsPowerShell\\v1.0\\powershell.exe`
;
_TERMINAL_DEFAULT_SHELL_WINDOWS
=
isAtLeastWindows10
?
powerShellPath
:
processes
.
getWindowsShell
(
env
ironment
);
const
is32ProcessOn64Windows
=
env
.
hasOwnProperty
(
'
PROCESSOR_ARCHITEW6432
'
);
const
powerShellPath
=
`
${
env
[
'
windir
'
]
}
\
\$
{is32ProcessOn64Windows ? 'Sysnative' : 'System32'}\\WindowsPowerShell\\v1.0\\powershell.exe`
;
_TERMINAL_DEFAULT_SHELL_WINDOWS
=
isAtLeastWindows10
?
powerShellPath
:
processes
.
getWindowsShell
(
env
);
}
return
_TERMINAL_DEFAULT_SHELL_WINDOWS
;
}
src/vs/base/parts/ipc/test/node/ipc.cp.test.ts
浏览文件 @
64eb716d
...
...
@@ -11,7 +11,7 @@ import { getPathFromAmdModule } from 'vs/base/common/amd';
function
createClient
():
Client
{
return
new
Client
(
getPathFromAmdModule
(
require
,
'
bootstrap-fork
'
),
{
serverName
:
'
TestServer
'
,
env
:
{
AMD_ENTRYPOINT
:
'
vs/base/parts/ipc/test/node/testApp
'
,
verbose
:
true
}
env
:
{
VSCODE_
AMD_ENTRYPOINT
:
'
vs/base/parts/ipc/test/node/testApp
'
,
verbose
:
true
}
});
}
...
...
src/vs/base/test/node/processes/processes.test.ts
浏览文件 @
64eb716d
...
...
@@ -13,9 +13,9 @@ import { getPathFromAmdModule } from 'vs/base/common/amd';
function
fork
(
id
:
string
):
cp
.
ChildProcess
{
const
opts
:
any
=
{
env
:
objects
.
mixin
(
objects
.
deepClone
(
process
.
env
),
{
AMD_ENTRYPOINT
:
id
,
PIPE_LOGGING
:
'
true
'
,
VERBOSE_LOGGING
:
true
VSCODE_
AMD_ENTRYPOINT
:
id
,
VSCODE_
PIPE_LOGGING
:
'
true
'
,
V
SCODE_V
ERBOSE_LOGGING
:
true
})
};
...
...
src/vs/code/electron-main/app.ts
浏览文件 @
64eb716d
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
app
,
ipcMain
,
systemPreferences
,
contentTracing
,
protocol
,
BrowserWindow
,
dialog
,
session
}
from
'
electron
'
;
import
{
IProcessEnvironment
,
isWindows
,
isMacintosh
,
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
IProcessEnvironment
,
isWindows
,
isMacintosh
,
isLinux
,
isLinuxSnap
}
from
'
vs/base/common/platform
'
;
import
{
WindowsMainService
}
from
'
vs/platform/windows/electron-main/windowsMainService
'
;
import
{
IWindowOpenable
}
from
'
vs/platform/windows/common/windows
'
;
import
{
ILifecycleMainService
,
LifecycleMainPhase
}
from
'
vs/platform/lifecycle/electron-main/lifecycleMainService
'
;
...
...
@@ -294,7 +294,7 @@ export class CodeApplication extends Disposable {
// - an error after 10s and stop trying to resolve
const
cts
=
new
CancellationTokenSource
();
const
shellEnvSlowWarningHandle
=
setTimeout
(()
=>
window
?.
sendWhenReady
(
'
vscode:showShellEnvSlowWarning
'
,
cts
.
token
),
3000
);
const
shellEnvTimeoutErrorHandle
=
setTimeout
(
function
()
{
const
shellEnvTimeoutErrorHandle
=
setTimeout
(
()
=>
{
cts
.
dispose
(
true
);
window
?.
sendWhenReady
(
'
vscode:showShellEnvTimeoutError
'
,
CancellationToken
.
None
);
acceptShellEnv
({});
...
...
@@ -491,8 +491,8 @@ export class CodeApplication extends Disposable {
break
;
case
'
linux
'
:
if
(
process
.
env
.
SNAP
&&
process
.
env
.
SNAP_REVISION
)
{
services
.
set
(
IUpdateService
,
new
SyncDescriptor
(
SnapUpdateService
,
[
process
.
env
.
SNAP
,
process
.
env
.
SNAP_REVISION
]));
if
(
isLinuxSnap
)
{
services
.
set
(
IUpdateService
,
new
SyncDescriptor
(
SnapUpdateService
,
[
process
.
env
[
'
SNAP
'
],
process
.
env
[
'
SNAP_REVISION
'
]
]));
}
else
{
services
.
set
(
IUpdateService
,
new
SyncDescriptor
(
LinuxUpdateService
));
}
...
...
src/vs/code/electron-main/window.ts
浏览文件 @
64eb716d
...
...
@@ -643,32 +643,32 @@ export class CodeWindow extends Disposable implements ICodeWindow {
}
private
onConfigurationUpdated
():
void
{
// Menubar
const
newMenuBarVisibility
=
this
.
getMenuBarVisibility
();
if
(
newMenuBarVisibility
!==
this
.
currentMenuBarVisibility
)
{
this
.
currentMenuBarVisibility
=
newMenuBarVisibility
;
this
.
setMenuBarVisibility
(
newMenuBarVisibility
);
}
// Do not set to empty configuration at startup if setting is empty to not override configuration through CLI options:
const
env
=
process
.
env
;
// Proxy
let
newHttpProxy
=
(
this
.
configurationService
.
getValue
<
string
>
(
'
http.proxy
'
)
||
''
).
trim
()
||
(
env
.
https_proxy
||
process
.
env
.
HTTPS_PROXY
||
process
.
env
.
http_proxy
||
process
.
env
.
HTTP_PROXY
||
''
).
trim
()
// Not standardized.
||
(
process
.
env
[
'
https_proxy
'
]
||
process
.
env
[
'
HTTPS_PROXY
'
]
||
process
.
env
[
'
http_proxy
'
]
||
process
.
env
[
'
HTTP_PROXY
'
]
||
''
).
trim
()
// Not standardized.
||
undefined
;
if
(
newHttpProxy
?.
endsWith
(
'
/
'
))
{
newHttpProxy
=
newHttpProxy
.
substr
(
0
,
newHttpProxy
.
length
-
1
);
}
const
newNoProxy
=
(
env
.
no_proxy
||
env
.
NO_PROXY
||
''
).
trim
()
||
undefined
;
// Not standardized.
const
newNoProxy
=
(
process
.
env
[
'
no_proxy
'
]
||
process
.
env
[
'
NO_PROXY
'
]
||
''
).
trim
()
||
undefined
;
// Not standardized.
if
((
newHttpProxy
||
''
).
indexOf
(
'
@
'
)
===
-
1
&&
(
newHttpProxy
!==
this
.
currentHttpProxy
||
newNoProxy
!==
this
.
currentNoProxy
))
{
this
.
currentHttpProxy
=
newHttpProxy
;
this
.
currentNoProxy
=
newNoProxy
;
const
proxyRules
=
newHttpProxy
||
''
;
const
proxyBypassRules
=
newNoProxy
?
`
${
newNoProxy
}
,<local>`
:
'
<local>
'
;
this
.
logService
.
trace
(
`Setting proxy to '
${
proxyRules
}
', bypassing '
${
proxyBypassRules
}
'`
);
this
.
_win
.
webContents
.
session
.
setProxy
({
proxyRules
,
proxyBypassRules
,
pacScript
:
''
,
});
this
.
_win
.
webContents
.
session
.
setProxy
({
proxyRules
,
proxyBypassRules
,
pacScript
:
''
});
}
}
...
...
src/vs/code/electron-sandbox/issue/issueReporterMain.ts
浏览文件 @
64eb716d
...
...
@@ -7,7 +7,7 @@ import 'vs/css!./media/issueReporter';
import
'
vs/base/browser/ui/codicons/codiconStyles
'
;
// make sure codicon css is loaded
import
{
INativeHostService
}
from
'
vs/platform/native/electron-sandbox/native
'
;
import
{
NativeHostService
}
from
'
vs/platform/native/electron-sandbox/nativeHostService
'
;
import
{
ipcRenderer
,
process
}
from
'
vs/base/parts/sandbox/electron-sandbox/globals
'
;
import
{
ipcRenderer
}
from
'
vs/base/parts/sandbox/electron-sandbox/globals
'
;
import
{
applyZoom
,
zoomIn
,
zoomOut
}
from
'
vs/platform/windows/electron-sandbox/window
'
;
import
{
$
,
reset
,
safeInnerHtml
,
windowOpenNoOpener
}
from
'
vs/base/browser/dom
'
;
import
{
Button
}
from
'
vs/base/browser/ui/button/button
'
;
...
...
@@ -83,14 +83,12 @@ export class IssueReporter extends Disposable {
this
.
initServices
(
configuration
);
const
isSnap
=
process
.
platform
===
'
linux
'
&&
process
.
env
.
SNAP
&&
process
.
env
.
SNAP_REVISION
;
const
targetExtension
=
configuration
.
data
.
extensionId
?
configuration
.
data
.
enabledExtensions
.
find
(
extension
=>
extension
.
id
===
configuration
.
data
.
extensionId
)
:
undefined
;
this
.
issueReporterModel
=
new
IssueReporterModel
({
issueType
:
configuration
.
data
.
issueType
||
IssueType
.
Bug
,
versionInfo
:
{
vscodeVersion
:
`
${
configuration
.
product
.
nameShort
}
${
configuration
.
product
.
version
}
(
${
configuration
.
product
.
commit
||
'
Commit unknown
'
}
,
${
configuration
.
product
.
date
||
'
Date unknown
'
}
)`
,
os
:
`
${
this
.
configuration
.
os
.
type
}
${
this
.
configuration
.
os
.
arch
}
${
this
.
configuration
.
os
.
release
}${
is
Snap
?
'
snap
'
:
''
}
`
os
:
`
${
this
.
configuration
.
os
.
type
}
${
this
.
configuration
.
os
.
arch
}
${
this
.
configuration
.
os
.
release
}${
platform
.
isLinux
Snap
?
'
snap
'
:
''
}
`
},
extensionsDisabled
:
!!
configuration
.
disableExtensions
,
fileOnExtension
:
configuration
.
data
.
extensionId
?
!
targetExtension
?.
isBuiltin
:
undefined
,
...
...
src/vs/platform/diagnostics/node/diagnosticsService.ts
浏览文件 @
64eb716d
...
...
@@ -314,10 +314,10 @@ export class DiagnosticsService implements IDiagnosticsService {
if
(
isLinux
)
{
systemInfo
.
linuxEnv
=
{
desktopSession
:
process
.
env
.
DESKTOP_SESSION
,
xdgSessionDesktop
:
process
.
env
.
XDG_SESSION_DESKTOP
,
xdgCurrentDesktop
:
process
.
env
.
XDG_CURRENT_DESKTOP
,
xdgSessionType
:
process
.
env
.
XDG_SESSION_TYPE
desktopSession
:
process
.
env
[
'
DESKTOP_SESSION
'
]
,
xdgSessionDesktop
:
process
.
env
[
'
XDG_SESSION_DESKTOP
'
]
,
xdgCurrentDesktop
:
process
.
env
[
'
XDG_CURRENT_DESKTOP
'
]
,
xdgSessionType
:
process
.
env
[
'
XDG_SESSION_TYPE
'
]
};
}
...
...
src/vs/platform/files/node/watcher/nsfw/watcherService.ts
浏览文件 @
64eb716d
...
...
@@ -39,9 +39,9 @@ export class FileWatcher extends Disposable {
serverName
:
'
File Watcher (nsfw)
'
,
args
:
[
'
--type=watcherService
'
],
env
:
{
AMD_ENTRYPOINT
:
'
vs/platform/files/node/watcher/nsfw/watcherApp
'
,
PIPE_LOGGING
:
'
true
'
,
VERBOSE_LOGGING
:
'
true
'
// transmit console logs from server to client
VSCODE_
AMD_ENTRYPOINT
:
'
vs/platform/files/node/watcher/nsfw/watcherApp
'
,
VSCODE_
PIPE_LOGGING
:
'
true
'
,
V
SCODE_V
ERBOSE_LOGGING
:
'
true
'
// transmit console logs from server to client
}
}
));
...
...
src/vs/platform/files/node/watcher/unix/watcherService.ts
浏览文件 @
64eb716d
...
...
@@ -40,9 +40,9 @@ export class FileWatcher extends Disposable {
serverName
:
'
File Watcher (chokidar)
'
,
args
:
[
'
--type=watcherService
'
],
env
:
{
AMD_ENTRYPOINT
:
'
vs/platform/files/node/watcher/unix/watcherApp
'
,
PIPE_LOGGING
:
'
true
'
,
VERBOSE_LOGGING
:
'
true
'
// transmit console logs from server to client
VSCODE_
AMD_ENTRYPOINT
:
'
vs/platform/files/node/watcher/unix/watcherApp
'
,
VSCODE_
PIPE_LOGGING
:
'
true
'
,
V
SCODE_V
ERBOSE_LOGGING
:
'
true
'
// transmit console logs from server to client
}
}
));
...
...
src/vs/platform/native/electron-main/nativeHostMainService.ts
浏览文件 @
64eb716d
...
...
@@ -9,7 +9,7 @@ import { MessageBoxOptions, MessageBoxReturnValue, shell, OpenDevToolsOptions, S
import
{
ILifecycleMainService
}
from
'
vs/platform/lifecycle/electron-main/lifecycleMainService
'
;
import
{
IOpenedWindow
,
IOpenWindowOptions
,
IWindowOpenable
,
IOpenEmptyWindowOptions
,
IColorScheme
}
from
'
vs/platform/windows/common/windows
'
;
import
{
INativeOpenDialogOptions
}
from
'
vs/platform/dialogs/common/dialogs
'
;
import
{
isMacintosh
,
isWindows
,
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
isMacintosh
,
isWindows
,
isLinux
,
isLinuxSnap
}
from
'
vs/base/common/platform
'
;
import
{
ICommonNativeHostService
,
IOSProperties
,
IOSStatistics
}
from
'
vs/platform/native/common/native
'
;
import
{
ISerializableCommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IEnvironmentMainService
}
from
'
vs/platform/environment/electron-main/environmentMainService
'
;
...
...
@@ -333,8 +333,8 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
}
async
openExternal
(
windowId
:
number
|
undefined
,
url
:
string
):
Promise
<
boolean
>
{
if
(
isLinux
&&
process
.
env
.
SNAP
&&
process
.
env
.
SNAP_REVISION
)
{
NativeHostMainService
.
_
safeSnapOpenExternal
(
url
);
if
(
isLinux
Snap
)
{
this
.
safeSnapOpenExternal
(
url
);
}
else
{
shell
.
openExternal
(
url
);
}
...
...
@@ -342,7 +342,9 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
return
true
;
}
private
static
_safeSnapOpenExternal
(
url
:
string
):
void
{
private
safeSnapOpenExternal
(
url
:
string
):
void
{
// Remove some environment variables before opening to avoid issues...
const
gdkPixbufModuleFile
=
process
.
env
[
'
GDK_PIXBUF_MODULE_FILE
'
];
const
gdkPixbufModuleDir
=
process
.
env
[
'
GDK_PIXBUF_MODULEDIR
'
];
delete
process
.
env
[
'
GDK_PIXBUF_MODULE_FILE
'
];
...
...
@@ -350,6 +352,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
shell
.
openExternal
(
url
);
// ...but restore them after
process
.
env
[
'
GDK_PIXBUF_MODULE_FILE
'
]
=
gdkPixbufModuleFile
;
process
.
env
[
'
GDK_PIXBUF_MODULEDIR
'
]
=
gdkPixbufModuleDir
;
}
...
...
src/vs/platform/telemetry/node/commonProperties.ts
浏览文件 @
64eb716d
...
...
@@ -64,7 +64,7 @@ export async function resolveCommonProperties(
}
});
if
(
process
.
platform
===
'
linux
'
&&
process
.
env
.
SNAP
&&
process
.
env
.
SNAP_REVISION
)
{
if
(
Platform
.
isLinuxSnap
)
{
// __GDPR__COMMON__ "common.snap" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
result
[
'
common.snap
'
]
=
'
true
'
;
}
...
...
src/vs/workbench/browser/web.main.ts
浏览文件 @
64eb716d
...
...
@@ -124,6 +124,7 @@ class BrowserMain extends Disposable {
env
:
{
async
retrievePerformanceMarks
()
{
await
timerService
.
whenReady
();
return
timerService
.
getPerformanceMarks
();
}
},
...
...
src/vs/workbench/contrib/debug/node/debugHelperService.ts
浏览文件 @
64eb716d
...
...
@@ -31,8 +31,8 @@ export class NodeDebugHelperService implements IDebugHelperService {
args
:
args
,
env
:
{
ELECTRON_RUN_AS_NODE
:
1
,
PIPE_LOGGING
:
'
true
'
,
AMD_ENTRYPOINT
:
'
vs/workbench/contrib/debug/node/telemetryApp
'
VSCODE_
PIPE_LOGGING
:
'
true
'
,
VSCODE_
AMD_ENTRYPOINT
:
'
vs/workbench/contrib/debug/node/telemetryApp
'
}
}
);
...
...
src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
浏览文件 @
64eb716d
...
...
@@ -6,7 +6,7 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
fromNow
}
from
'
vs/base/common/date
'
;
import
{
mnemonicButtonLabel
}
from
'
vs/base/common/labels
'
;
import
{
isLinux
,
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
isLinux
,
is
LinuxSnap
,
is
Windows
}
from
'
vs/base/common/platform
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
MessageBoxOptions
}
from
'
vs/base/parts/sandbox/common/electronTypes
'
;
import
{
IClipboardService
}
from
'
vs/platform/clipboard/common/clipboardService
'
;
...
...
@@ -161,7 +161,6 @@ export class NativeDialogHandler implements IDialogHandler {
version
=
`
${
version
}
(
${
this
.
productService
.
target
}
setup)`
;
}
const
isSnap
=
process
.
platform
===
'
linux
'
&&
process
.
env
.
SNAP
&&
process
.
env
.
SNAP_REVISION
;
const
osProps
=
await
this
.
nativeHostService
.
getOSProperties
();
const
detailString
=
(
useAgo
:
boolean
):
string
=>
{
...
...
@@ -174,7 +173,7 @@ export class NativeDialogHandler implements IDialogHandler {
process
.
versions
[
'
chrome
'
],
process
.
versions
[
'
node
'
],
process
.
versions
[
'
v8
'
],
`
${
osProps
.
type
}
${
osProps
.
arch
}
${
osProps
.
release
}${
isSnap
?
'
snap
'
:
''
}
`
`
${
osProps
.
type
}
${
osProps
.
arch
}
${
osProps
.
release
}${
is
Linux
Snap
?
'
snap
'
:
''
}
`
);
};
...
...
src/vs/workbench/services/extensions/electron-browser/localProcessExtensionHost.ts
浏览文件 @
64eb716d
...
...
@@ -160,9 +160,9 @@ export class LocalProcessExtensionHost implements IExtensionHost {
this
.
_tryFindDebugPort
()
]).
then
(([
pipeName
,
portNumber
])
=>
{
const
env
=
objects
.
mixin
(
objects
.
deepClone
(
process
.
env
),
{
AMD_ENTRYPOINT
:
'
vs/workbench/services/extensions/node/extensionHostProcess
'
,
PIPE_LOGGING
:
'
true
'
,
VERBOSE_LOGGING
:
true
,
VSCODE_
AMD_ENTRYPOINT
:
'
vs/workbench/services/extensions/node/extensionHostProcess
'
,
VSCODE_
PIPE_LOGGING
:
'
true
'
,
V
SCODE_V
ERBOSE_LOGGING
:
true
,
VSCODE_LOG_NATIVE
:
this
.
_isExtensionDevHost
,
VSCODE_IPC_HOOK_EXTHOST
:
pipeName
,
VSCODE_HANDLES_UNCAUGHT_ERRORS
:
true
,
...
...
@@ -227,7 +227,7 @@ export class LocalProcessExtensionHost implements IExtensionHost {
// For https://github.com/microsoft/vscode/issues/105743
const
extHostCrashDirectory
=
this
.
_environmentService
.
crashReporterDirectory
||
this
.
_environmentService
.
userDataPath
;
opts
.
env
.
BREAKPAD_DUMP_LOCATION
=
join
(
extHostCrashDirectory
,
`
${
ExtensionHostLogFileName
}
Crash Reports`
);
opts
.
env
.
CRASH_REPORTER_START_OPTIONS
=
JSON
.
stringify
(
crashReporterStartOptions
);
opts
.
env
.
VSCODE_
CRASH_REPORTER_START_OPTIONS
=
JSON
.
stringify
(
crashReporterStartOptions
);
}
// Run Extension Host as fork of current process
...
...
src/vs/workbench/services/search/electron-browser/searchService.ts
浏览文件 @
64eb716d
...
...
@@ -67,9 +67,9 @@ export class DiskSearch implements ISearchResultProvider {
// results in the forked process inheriting `--inspect-brk=xxx`.
freshExecArgv
:
true
,
env
:
{
AMD_ENTRYPOINT
:
'
vs/workbench/services/search/node/searchApp
'
,
PIPE_LOGGING
:
'
true
'
,
VERBOSE_LOGGING
:
verboseLogging
VSCODE_
AMD_ENTRYPOINT
:
'
vs/workbench/services/search/node/searchApp
'
,
VSCODE_
PIPE_LOGGING
:
'
true
'
,
V
SCODE_V
ERBOSE_LOGGING
:
verboseLogging
},
useQueue
:
true
};
...
...
src/vs/workbench/services/timer/browser/timerService.ts
浏览文件 @
64eb716d
...
...
@@ -55,6 +55,7 @@ export interface IMemoryInfo {
"timers.ellapsedEditorRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedWorkbench" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedNlsGeneration" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedWaitForShellEnv" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"platform" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"release" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"arch" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
...
...
src/vs/workbench/workbench.web.api.ts
浏览文件 @
64eb716d
...
...
@@ -456,12 +456,11 @@ interface IPerformanceMark {
interface
IWorkbench
{
commands
:
{
/**
* Allows to execute a command, either built-in or from extensions.
*/
executeCommand
(
command
:
string
,
...
args
:
any
[]):
Promise
<
unknown
>
;
}
,
}
env
:
{
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录