Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c5601021
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 搜索 >>
提交
c5601021
编写于
10月 07, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - reduce usage of environmentService.configuration
Inline machineId and sessionId
上级
3b993525
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
68 addition
and
44 deletion
+68
-44
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
+1
-1
src/vs/workbench/contrib/configExporter/electron-sandbox/configurationExportHelper.contribution.ts
...lectron-sandbox/configurationExportHelper.contribution.ts
+1
-1
src/vs/workbench/contrib/update/browser/update.ts
src/vs/workbench/contrib/update/browser/update.ts
+3
-3
src/vs/workbench/electron-browser/desktop.main.ts
src/vs/workbench/electron-browser/desktop.main.ts
+15
-15
src/vs/workbench/electron-sandbox/desktop.main.ts
src/vs/workbench/electron-sandbox/desktop.main.ts
+9
-9
src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts
src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts
+3
-0
src/vs/workbench/services/environment/browser/environmentService.ts
...kbench/services/environment/browser/environmentService.ts
+5
-2
src/vs/workbench/services/environment/common/environmentService.ts
...rkbench/services/environment/common/environmentService.ts
+2
-0
src/vs/workbench/services/environment/electron-browser/environmentService.ts
...rvices/environment/electron-browser/environmentService.ts
+26
-12
src/vs/workbench/services/environment/electron-sandbox/environmentService.ts
...rvices/environment/electron-sandbox/environmentService.ts
+2
-0
src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts
...h/services/telemetry/electron-browser/telemetryService.ts
+1
-1
未找到文件。
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
浏览文件 @
c5601021
...
...
@@ -449,7 +449,7 @@ export class CustomMenubarControl extends MenubarControl {
case
StateType
.
Idle
:
return
new
Action
(
'
update.check
'
,
nls
.
localize
({
key
:
'
checkForUpdates
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Check for &&Updates...
"
),
undefined
,
true
,
()
=>
this
.
updateService
.
checkForUpdates
(
this
.
environmentService
.
configuration
.
sessionId
));
this
.
updateService
.
checkForUpdates
(
this
.
environmentService
.
sessionId
));
case
StateType
.
CheckingForUpdates
:
return
new
Action
(
'
update.checking
'
,
nls
.
localize
(
'
checkingForUpdates
'
,
"
Checking for Updates...
"
),
undefined
,
false
);
...
...
src/vs/workbench/contrib/configExporter/electron-sandbox/configurationExportHelper.contribution.ts
浏览文件 @
c5601021
...
...
@@ -17,7 +17,7 @@ export class ExtensionPoints implements IWorkbenchContribution {
@
INativeWorkbenchEnvironmentService
environmentService
:
INativeWorkbenchEnvironmentService
)
{
// Config Exporter
if
(
environmentService
.
configuration
[
'
export-default-configuration
'
])
{
if
(
environmentService
.
args
[
'
export-default-configuration
'
])
{
instantiationService
.
createInstance
(
DefaultConfigurationExportHelper
);
}
}
...
...
src/vs/workbench/contrib/update/browser/update.ts
浏览文件 @
c5601021
...
...
@@ -224,7 +224,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
case
StateType
.
Idle
:
if
(
state
.
error
)
{
this
.
onError
(
state
.
error
);
}
else
if
(
this
.
state
.
type
===
StateType
.
CheckingForUpdates
&&
this
.
state
.
context
===
this
.
environmentService
.
configuration
.
sessionId
)
{
}
else
if
(
this
.
state
.
type
===
StateType
.
CheckingForUpdates
&&
this
.
state
.
context
===
this
.
environmentService
.
sessionId
)
{
this
.
onUpdateNotAvailable
();
}
break
;
...
...
@@ -409,7 +409,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
}
private
registerGlobalActivityActions
():
void
{
CommandsRegistry
.
registerCommand
(
'
update.check
'
,
()
=>
this
.
updateService
.
checkForUpdates
(
this
.
environmentService
.
configuration
.
sessionId
));
CommandsRegistry
.
registerCommand
(
'
update.check
'
,
()
=>
this
.
updateService
.
checkForUpdates
(
this
.
environmentService
.
sessionId
));
MenuRegistry
.
appendMenuItem
(
MenuId
.
GlobalActivity
,
{
group
:
'
6_update
'
,
command
:
{
...
...
@@ -543,7 +543,7 @@ export class CheckForVSCodeUpdateAction extends Action {
}
run
():
Promise
<
void
>
{
return
this
.
updateService
.
checkForUpdates
(
this
.
environmentService
.
configuration
.
sessionId
);
return
this
.
updateService
.
checkForUpdates
(
this
.
environmentService
.
sessionId
);
}
}
src/vs/workbench/electron-browser/desktop.main.ts
浏览文件 @
c5601021
...
...
@@ -71,27 +71,27 @@ class DesktopMain extends Disposable {
this
.
reviveUris
();
// Setup perf
importEntries
(
this
.
environmentService
.
configuration
.
perfEntries
);
importEntries
(
this
.
configuration
.
perfEntries
);
// Browser config
const
zoomLevel
=
this
.
configuration
.
zoomLevel
||
0
;
setZoomFactor
(
zoomLevelToZoomFactor
(
zoomLevel
));
setZoomLevel
(
zoomLevel
,
true
/* isTrusted */
);
setFullscreen
(
!!
this
.
environmentService
.
configuration
.
fullscreen
);
setFullscreen
(
!!
this
.
configuration
.
fullscreen
);
}
private
reviveUris
()
{
if
(
this
.
environmentService
.
configuration
.
folderUri
)
{
this
.
environmentService
.
configuration
.
folderUri
=
URI
.
revive
(
this
.
environmentService
.
configuration
.
folderUri
);
if
(
this
.
configuration
.
folderUri
)
{
this
.
configuration
.
folderUri
=
URI
.
revive
(
this
.
configuration
.
folderUri
);
}
if
(
this
.
environmentService
.
configuration
.
workspace
)
{
this
.
environmentService
.
configuration
.
workspace
=
reviveWorkspaceIdentifier
(
this
.
environmentService
.
configuration
.
workspace
);
if
(
this
.
configuration
.
workspace
)
{
this
.
configuration
.
workspace
=
reviveWorkspaceIdentifier
(
this
.
configuration
.
workspace
);
}
const
filesToWait
=
this
.
environmentService
.
configuration
.
filesToWait
;
const
filesToWait
=
this
.
configuration
.
filesToWait
;
const
filesToWaitPaths
=
filesToWait
?.
paths
;
[
filesToWaitPaths
,
this
.
environmentService
.
configuration
.
filesToOpenOrCreate
,
this
.
environmentService
.
configuration
.
filesToDiff
].
forEach
(
paths
=>
{
[
filesToWaitPaths
,
this
.
configuration
.
filesToOpenOrCreate
,
this
.
configuration
.
filesToDiff
].
forEach
(
paths
=>
{
if
(
Array
.
isArray
(
paths
))
{
paths
.
forEach
(
path
=>
{
if
(
path
.
fileUri
)
{
...
...
@@ -125,12 +125,12 @@ class DesktopMain extends Disposable {
this
.
_register
(
instantiationService
.
createInstance
(
NativeWindow
));
// Driver
if
(
this
.
environmentService
.
configuration
.
driver
)
{
if
(
this
.
configuration
.
driver
)
{
instantiationService
.
invokeFunction
(
async
accessor
=>
this
.
_register
(
await
registerWindowDriver
(
accessor
,
this
.
configuration
.
windowId
)));
}
// Logging
services
.
logService
.
trace
(
'
workbench configuration
'
,
JSON
.
stringify
(
this
.
environmentService
.
configuration
));
services
.
logService
.
trace
(
'
workbench configuration
'
,
JSON
.
stringify
(
this
.
configuration
));
}
private
registerListeners
(
workbench
:
Workbench
,
storageService
:
NativeStorageService
):
void
{
...
...
@@ -231,7 +231,7 @@ class DesktopMain extends Disposable {
fileService
.
registerProvider
(
Schemas
.
file
,
diskFileSystemProvider
);
// User Data Provider
fileService
.
registerProvider
(
Schemas
.
userData
,
new
FileUserDataProvider
(
this
.
environmentService
.
appSettingsHome
,
this
.
environmentService
.
configuration
.
backupPath
?
URI
.
file
(
this
.
environmentService
.
configuration
.
backupPath
)
:
undefined
,
diskFileSystemProvider
,
this
.
environmentService
,
logService
));
fileService
.
registerProvider
(
Schemas
.
userData
,
new
FileUserDataProvider
(
this
.
environmentService
.
appSettingsHome
,
this
.
configuration
.
backupPath
?
URI
.
file
(
this
.
configuration
.
backupPath
)
:
undefined
,
diskFileSystemProvider
,
this
.
environmentService
,
logService
));
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
...
...
@@ -299,14 +299,14 @@ class DesktopMain extends Disposable {
private
async
resolveWorkspaceInitializationPayload
(
resourceIdentityService
:
IResourceIdentityService
):
Promise
<
IWorkspaceInitializationPayload
>
{
// Multi-root workspace
if
(
this
.
environmentService
.
configuration
.
workspace
)
{
return
this
.
environmentService
.
configuration
.
workspace
;
if
(
this
.
configuration
.
workspace
)
{
return
this
.
configuration
.
workspace
;
}
// Single-folder workspace
let
workspaceInitializationPayload
:
IWorkspaceInitializationPayload
|
undefined
;
if
(
this
.
environmentService
.
configuration
.
folderUri
)
{
workspaceInitializationPayload
=
await
this
.
resolveSingleFolderWorkspaceInitializationPayload
(
this
.
environmentService
.
configuration
.
folderUri
,
resourceIdentityService
);
if
(
this
.
configuration
.
folderUri
)
{
workspaceInitializationPayload
=
await
this
.
resolveSingleFolderWorkspaceInitializationPayload
(
this
.
configuration
.
folderUri
,
resourceIdentityService
);
}
// Fallback to empty workspace if we have no payload yet.
...
...
src/vs/workbench/electron-sandbox/desktop.main.ts
浏览文件 @
c5601021
...
...
@@ -52,27 +52,27 @@ class DesktopMain extends Disposable {
this
.
reviveUris
();
// Setup perf
importEntries
(
this
.
environmentService
.
configuration
.
perfEntries
);
importEntries
(
this
.
configuration
.
perfEntries
);
// Browser config
const
zoomLevel
=
this
.
configuration
.
zoomLevel
||
0
;
setZoomFactor
(
zoomLevelToZoomFactor
(
zoomLevel
));
setZoomLevel
(
zoomLevel
,
true
/* isTrusted */
);
setFullscreen
(
!!
this
.
environmentService
.
configuration
.
fullscreen
);
setFullscreen
(
!!
this
.
configuration
.
fullscreen
);
}
private
reviveUris
()
{
if
(
this
.
environmentService
.
configuration
.
folderUri
)
{
this
.
environmentService
.
configuration
.
folderUri
=
URI
.
revive
(
this
.
environmentService
.
configuration
.
folderUri
);
if
(
this
.
configuration
.
folderUri
)
{
this
.
configuration
.
folderUri
=
URI
.
revive
(
this
.
configuration
.
folderUri
);
}
if
(
this
.
environmentService
.
configuration
.
workspace
)
{
this
.
environmentService
.
configuration
.
workspace
=
reviveWorkspaceIdentifier
(
this
.
environmentService
.
configuration
.
workspace
);
if
(
this
.
configuration
.
workspace
)
{
this
.
configuration
.
workspace
=
reviveWorkspaceIdentifier
(
this
.
configuration
.
workspace
);
}
const
filesToWait
=
this
.
environmentService
.
configuration
.
filesToWait
;
const
filesToWait
=
this
.
configuration
.
filesToWait
;
const
filesToWaitPaths
=
filesToWait
?.
paths
;
[
filesToWaitPaths
,
this
.
environmentService
.
configuration
.
filesToOpenOrCreate
,
this
.
environmentService
.
configuration
.
filesToDiff
].
forEach
(
paths
=>
{
[
filesToWaitPaths
,
this
.
configuration
.
filesToOpenOrCreate
,
this
.
configuration
.
filesToDiff
].
forEach
(
paths
=>
{
if
(
Array
.
isArray
(
paths
))
{
paths
.
forEach
(
path
=>
{
if
(
path
.
fileUri
)
{
...
...
@@ -106,7 +106,7 @@ class DesktopMain extends Disposable {
this
.
_register
(
instantiationService
.
createInstance
(
NativeWindow
));
// Logging
services
.
logService
.
trace
(
'
workbench configuration
'
,
JSON
.
stringify
(
this
.
environmentService
.
configuration
));
services
.
logService
.
trace
(
'
workbench configuration
'
,
JSON
.
stringify
(
this
.
configuration
));
}
private
registerListeners
(
workbench
:
Workbench
,
storageService
:
SimpleStorageService
):
void
{
...
...
src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts
浏览文件 @
c5601021
...
...
@@ -89,6 +89,9 @@ export class SimpleNativeWorkbenchEnvironmentService implements INativeWorkbench
get
backupWorkspaceHome
():
URI
{
return
joinPath
(
this
.
userRoamingDataHome
,
'
Backups
'
,
'
workspace
'
);
}
get
logsPath
():
string
{
return
joinPath
(
this
.
userRoamingDataHome
,
'
logs
'
).
path
;
}
sessionId
=
this
.
configuration
.
sessionId
;
machineId
=
this
.
configuration
.
machineId
;
options
?:
IWorkbenchConstructionOptions
|
undefined
;
logExtensionHostCommunication
?:
boolean
|
undefined
;
extensionEnabledProposedApi
?:
string
[]
|
undefined
;
...
...
src/vs/workbench/services/environment/browser/environmentService.ts
浏览文件 @
c5601021
...
...
@@ -104,6 +104,9 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
@
memoize
get
remoteAuthority
():
string
|
undefined
{
return
this
.
options
.
remoteAuthority
;
}
@
memoize
get
sessionId
():
string
{
return
this
.
configuration
.
sessionId
;
}
@
memoize
get
isBuilt
():
boolean
{
return
!!
this
.
productService
.
commit
;
}
...
...
@@ -231,6 +234,8 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
get
verbose
():
boolean
{
return
this
.
payload
?.
get
(
'
verbose
'
)
===
'
true
'
;
}
get
logExtensionHostCommunication
():
boolean
{
return
this
.
payload
?.
get
(
'
logExtensionHostCommunication
'
)
===
'
true
'
;
}
get
skipReleaseNotes
():
boolean
{
return
false
;
}
private
payload
:
Map
<
string
,
string
>
|
undefined
;
constructor
(
...
...
@@ -286,6 +291,4 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
return
extensionHostDebugEnvironment
;
}
get
skipReleaseNotes
():
boolean
{
return
false
;
}
}
src/vs/workbench/services/environment/common/environmentService.ts
浏览文件 @
c5601021
...
...
@@ -32,6 +32,8 @@ export interface IWorkbenchEnvironmentService extends IEnvironmentService {
readonly
remoteAuthority
?:
string
;
readonly
sessionId
:
string
;
readonly
logFile
:
URI
;
readonly
backupWorkspaceHome
?:
URI
;
...
...
src/vs/workbench/services/environment/electron-browser/environmentService.ts
浏览文件 @
c5601021
...
...
@@ -16,23 +16,28 @@ export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService
declare
readonly
_serviceBrand
:
undefined
;
@
memoize
get
webviewExternalEndpoint
():
string
{
const
baseEndpoint
=
'
https://{{uuid}}.vscode-webview-test.com/{{commit}}
'
;
get
machineId
()
{
return
this
.
configuration
.
machineId
;
}
return
baseEndpoint
.
replace
(
'
{{commit}}
'
,
this
.
productService
.
commit
||
'
0d728c31ebdf03869d2687d9be0b017667c9ff37
'
);
}
@
memoize
get
sessionId
()
{
return
this
.
configuration
.
sessionId
;
}
@
memoize
get
webviewResourceRoot
():
string
{
return
`
${
Schemas
.
vscodeWebviewResource
}
://{{uuid}}/{{resource}}`
;
}
get
remoteAuthority
()
{
return
this
.
configuration
.
remoteAuthority
;
}
@
memoize
get
webviewCspSource
():
string
{
return
`
${
Schemas
.
vscodeWebviewResource
}
:`
;
}
get
execPath
()
{
return
this
.
configuration
.
execPath
;
}
@
memoize
get
userRoamingDataHome
():
URI
{
return
this
.
appSettingsHome
.
with
({
scheme
:
Schemas
.
userData
});
}
// Do not memoize as `backupPath` can change in configuration
get
backupWorkspaceHome
():
URI
|
undefined
{
return
this
.
configuration
.
backupPath
?
URI
.
file
(
this
.
configuration
.
backupPath
).
with
({
scheme
:
this
.
userRoamingDataHome
.
scheme
})
:
undefined
;
}
// Do NOT! memoize as `backupPath` can change in configuration
get
backupWorkspaceHome
():
URI
|
undefined
{
if
(
this
.
configuration
.
backupPath
)
{
return
URI
.
file
(
this
.
configuration
.
backupPath
).
with
({
scheme
:
this
.
userRoamingDataHome
.
scheme
});
}
return
undefined
;
}
@
memoize
get
logFile
():
URI
{
return
URI
.
file
(
join
(
this
.
logsPath
,
`renderer
${
this
.
configuration
.
windowId
}
.log`
));
}
...
...
@@ -40,6 +45,19 @@ export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService
@
memoize
get
extHostLogsPath
():
URI
{
return
URI
.
file
(
join
(
this
.
logsPath
,
`exthost
${
this
.
configuration
.
windowId
}
`
));
}
@
memoize
get
webviewExternalEndpoint
():
string
{
const
baseEndpoint
=
'
https://{{uuid}}.vscode-webview-test.com/{{commit}}
'
;
return
baseEndpoint
.
replace
(
'
{{commit}}
'
,
this
.
productService
.
commit
||
'
0d728c31ebdf03869d2687d9be0b017667c9ff37
'
);
}
@
memoize
get
webviewResourceRoot
():
string
{
return
`
${
Schemas
.
vscodeWebviewResource
}
://{{uuid}}/{{resource}}`
;
}
@
memoize
get
webviewCspSource
():
string
{
return
`
${
Schemas
.
vscodeWebviewResource
}
:`
;
}
@
memoize
get
skipReleaseNotes
():
boolean
{
return
!!
this
.
args
[
'
skip-release-notes
'
];
}
...
...
@@ -59,10 +77,6 @@ export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService
return
undefined
;
}
readonly
execPath
=
this
.
configuration
.
execPath
;
readonly
remoteAuthority
=
this
.
configuration
.
remoteAuthority
;
constructor
(
readonly
configuration
:
INativeWorkbenchConfiguration
,
private
readonly
productService
:
IProductService
...
...
src/vs/workbench/services/environment/electron-sandbox/environmentService.ts
浏览文件 @
c5601021
...
...
@@ -21,6 +21,8 @@ export interface INativeWorkbenchEnvironmentService extends IWorkbenchEnvironmen
readonly
configuration
:
INativeWorkbenchConfiguration
;
readonly
machineId
:
string
;
readonly
crashReporterDirectory
?:
string
;
readonly
crashReporterId
?:
string
;
...
...
src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts
浏览文件 @
c5601021
...
...
@@ -39,7 +39,7 @@ export class TelemetryService extends Disposable implements ITelemetryService {
const
channel
=
sharedProcessService
.
getChannel
(
'
telemetryAppender
'
);
const
config
:
ITelemetryServiceConfig
=
{
appender
:
combinedAppender
(
new
TelemetryAppenderClient
(
channel
),
new
LogAppender
(
logService
)),
commonProperties
:
resolveWorkbenchCommonProperties
(
storageService
,
productService
.
commit
,
productService
.
version
,
environmentService
.
configuration
.
machineId
,
productService
.
msftInternalDomains
,
environmentService
.
installSourcePath
,
environmentService
.
remoteAuthority
),
commonProperties
:
resolveWorkbenchCommonProperties
(
storageService
,
productService
.
commit
,
productService
.
version
,
environmentService
.
machineId
,
productService
.
msftInternalDomains
,
environmentService
.
installSourcePath
,
environmentService
.
remoteAuthority
),
piiPaths
:
environmentService
.
extensionsPath
?
[
environmentService
.
appRoot
,
environmentService
.
extensionsPath
]
:
[
environmentService
.
appRoot
],
sendErrorTelemetry
:
true
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录