Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
b4679a37
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,发现更多精彩内容 >>
提交
b4679a37
编写于
8月 24, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - move some environment to workbench
上级
f3d97621
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
46 addition
and
57 deletion
+46
-57
src/vs/platform/environment/common/environment.ts
src/vs/platform/environment/common/environment.ts
+1
-14
src/vs/platform/environment/node/environmentService.ts
src/vs/platform/environment/node/environmentService.ts
+0
-14
src/vs/workbench/contrib/update/electron-browser/update.ts
src/vs/workbench/contrib/update/electron-browser/update.ts
+1
-1
src/vs/workbench/contrib/webview/browser/webviewElement.ts
src/vs/workbench/contrib/webview/browser/webviewElement.ts
+4
-4
src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.ts
...welcome/gettingStarted/electron-browser/gettingStarted.ts
+2
-2
src/vs/workbench/services/environment/browser/environmentService.ts
...kbench/services/environment/browser/environmentService.ts
+2
-6
src/vs/workbench/services/environment/common/environmentService.ts
...rkbench/services/environment/common/environmentService.ts
+12
-2
src/vs/workbench/services/environment/node/environmentService.ts
...workbench/services/environment/node/environmentService.ts
+16
-7
src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts
...services/extensions/common/extensionHostProcessManager.ts
+2
-2
src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts
...h/services/extensions/common/remoteExtensionHostClient.ts
+2
-2
src/vs/workbench/services/search/node/searchService.ts
src/vs/workbench/services/search/node/searchService.ts
+4
-3
未找到文件。
src/vs/platform/environment/common/environment.ts
浏览文件 @
b4679a37
...
...
@@ -140,24 +140,15 @@ export interface IEnvironmentService {
extensionTestsLocationURI
?:
URI
;
debugExtensionHost
:
IExtensionHostDebugParams
;
debugSearch
:
IDebugParams
;
logExtensionHostCommunication
:
boolean
;
isBuilt
:
boolean
;
wait
:
boolean
;
status
:
boolean
;
// logging
log
?:
string
;
logsPath
:
string
;
verbose
:
boolean
;
skipGettingStarted
:
boolean
|
undefined
;
skipReleaseNotes
:
boolean
|
undefined
;
skipAddToRecentlyOpened
:
boolean
;
mainIPCHandle
:
string
;
sharedIPCHandle
:
string
;
...
...
@@ -170,9 +161,5 @@ export interface IEnvironmentService {
driverHandle
?:
string
;
driverVerbose
:
boolean
;
webviewEndpoint
?:
string
;
readonly
webviewResourceRoot
:
string
;
readonly
webviewCspSource
:
string
;
readonly
galleryMachineIdResource
?:
URI
;
galleryMachineIdResource
?:
URI
;
}
src/vs/platform/environment/node/environmentService.ts
浏览文件 @
b4679a37
...
...
@@ -236,26 +236,15 @@ export class EnvironmentService implements IEnvironmentService {
return
false
;
}
get
skipGettingStarted
():
boolean
{
return
!!
this
.
_args
[
'
skip-getting-started
'
];
}
get
skipReleaseNotes
():
boolean
{
return
!!
this
.
_args
[
'
skip-release-notes
'
];
}
get
skipAddToRecentlyOpened
():
boolean
{
return
!!
this
.
_args
[
'
skip-add-to-recently-opened
'
];
}
@
memoize
get
debugExtensionHost
():
IExtensionHostDebugParams
{
return
parseExtensionHostPort
(
this
.
_args
,
this
.
isBuilt
);
}
@
memoize
get
debugSearch
():
IDebugParams
{
return
parseSearchPort
(
this
.
_args
,
this
.
isBuilt
);
}
get
isBuilt
():
boolean
{
return
!
process
.
env
[
'
VSCODE_DEV
'
];
}
get
verbose
():
boolean
{
return
!!
this
.
_args
.
verbose
;
}
get
log
():
string
|
undefined
{
return
this
.
_args
.
log
;
}
get
wait
():
boolean
{
return
!!
this
.
_args
.
wait
;
}
get
logExtensionHostCommunication
():
boolean
{
return
!!
this
.
_args
.
logExtensionHostCommunication
;
}
get
status
():
boolean
{
return
!!
this
.
_args
.
status
;
}
@
memoize
...
...
@@ -276,9 +265,6 @@ export class EnvironmentService implements IEnvironmentService {
get
driverHandle
():
string
|
undefined
{
return
this
.
_args
[
'
driver
'
];
}
get
driverVerbose
():
boolean
{
return
!!
this
.
_args
[
'
driver-verbose
'
];
}
readonly
webviewResourceRoot
=
'
vscode-resource:{{resource}}
'
;
readonly
webviewCspSource
=
'
vscode-resource:
'
;
constructor
(
private
_args
:
ParsedArgs
,
private
_execPath
:
string
)
{
if
(
!
process
.
env
[
'
VSCODE_LOGS
'
])
{
const
key
=
toLocalISOString
(
new
Date
()).
replace
(
/-|:|
\.\d
+Z$/g
,
''
);
...
...
src/vs/workbench/contrib/update/electron-browser/update.ts
浏览文件 @
b4679a37
...
...
@@ -119,7 +119,7 @@ export class ProductContribution implements IWorkbenchContribution {
@
IStorageService
storageService
:
IStorageService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
INotificationService
notificationService
:
INotificationService
,
@
I
EnvironmentService
environmentService
:
I
EnvironmentService
,
@
I
WorkbenchEnvironmentService
environmentService
:
IWorkbench
EnvironmentService
,
@
IOpenerService
openerService
:
IOpenerService
,
@
IConfigurationService
configurationService
:
IConfigurationService
,
@
IWindowService
windowService
:
IWindowService
,
...
...
src/vs/workbench/contrib/webview/browser/webviewElement.ts
浏览文件 @
b4679a37
...
...
@@ -7,7 +7,7 @@ import { Emitter } from 'vs/base/common/event';
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Webview
,
WebviewContentOptions
,
WebviewOptions
}
from
'
vs/workbench/contrib/webview/browser/webview
'
;
import
{
IThemeService
,
ITheme
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
I
EnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
I
WorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
areWebviewInputOptionsEqual
}
from
'
vs/workbench/contrib/webview/browser/webviewEditorService
'
;
...
...
@@ -40,14 +40,14 @@ export class IFrameWebview extends Disposable implements Webview {
contentOptions
:
WebviewContentOptions
,
@
IThemeService
themeService
:
IThemeService
,
@
ITunnelService
tunnelService
:
ITunnelService
,
@
I
EnvironmentService
private
readonly
environmentService
:
I
EnvironmentService
,
@
I
WorkbenchEnvironmentService
private
readonly
environmentService
:
IWorkbench
EnvironmentService
,
@
IFileService
private
readonly
fileService
:
IFileService
,
@
IConfigurationService
private
readonly
_configurationService
:
IConfigurationService
,
)
{
super
();
const
useExternalEndpoint
=
this
.
_configurationService
.
getValue
<
string
>
(
'
webview.experimental.useExternalEndpoint
'
);
if
(
typeof
environmentService
.
webviewEndpoint
!==
'
string
'
&&
!
useExternalEndpoint
)
{
if
(
!
useExternalEndpoint
&&
(
!
environmentService
.
options
||
typeof
environmentService
.
options
.
webviewEndpoint
!==
'
string
'
)
)
{
throw
new
Error
(
'
To use iframe based webviews, you must configure `environmentService.webviewEndpoint`
'
);
}
...
...
@@ -145,7 +145,7 @@ export class IFrameWebview extends Disposable implements Webview {
private
get
endpoint
():
string
{
const
useExternalEndpoint
=
this
.
_configurationService
.
getValue
<
string
>
(
'
webview.experimental.useExternalEndpoint
'
);
const
baseEndpoint
=
useExternalEndpoint
?
'
https://{{uuid}}.vscode-webview-test.com/8fa811108f0f0524c473020ef57b6620f6c201e1
'
:
this
.
environmentService
.
webviewEndpoint
!
;
const
baseEndpoint
=
useExternalEndpoint
?
'
https://{{uuid}}.vscode-webview-test.com/8fa811108f0f0524c473020ef57b6620f6c201e1
'
:
this
.
environmentService
.
options
!
.
webviewEndpoint
!
;
const
endpoint
=
baseEndpoint
.
replace
(
'
{{uuid}}
'
,
this
.
id
);
if
(
endpoint
[
endpoint
.
length
-
1
]
===
'
/
'
)
{
return
endpoint
.
slice
(
0
,
endpoint
.
length
-
1
);
...
...
src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.ts
浏览文件 @
b4679a37
...
...
@@ -6,7 +6,7 @@
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ITelemetryService
,
ITelemetryInfo
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
I
EnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
I
WorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
product
from
'
vs/platform/product/node/product
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
...
...
@@ -21,7 +21,7 @@ export class GettingStarted implements IWorkbenchContribution {
constructor
(
@
IStorageService
private
readonly
storageService
:
IStorageService
,
@
I
EnvironmentService
environmentService
:
I
EnvironmentService
,
@
I
WorkbenchEnvironmentService
environmentService
:
IWorkbench
EnvironmentService
,
@
ITelemetryService
private
readonly
telemetryService
:
ITelemetryService
,
@
IOpenerService
private
readonly
openerService
:
IOpenerService
)
{
...
...
src/vs/workbench/services/environment/browser/environmentService.ts
浏览文件 @
b4679a37
...
...
@@ -96,11 +96,9 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
break
:
false
};
this
.
webviewEndpoint
=
options
.
webviewEndpoint
;
this
.
untitledWorkspacesHome
=
URI
.
from
({
scheme
:
Schemas
.
untitled
,
path
:
'
Workspaces
'
});
if
(
document
&&
document
.
location
&&
document
.
location
.
search
)
{
const
map
=
new
Map
<
string
,
string
>
();
const
query
=
document
.
location
.
search
.
substring
(
1
);
const
vars
=
query
.
split
(
'
&
'
);
...
...
@@ -170,7 +168,6 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
verbose
:
boolean
;
skipGettingStarted
:
boolean
;
skipReleaseNotes
:
boolean
;
skipAddToRecentlyOpened
:
boolean
;
mainIPCHandle
:
string
;
sharedIPCHandle
:
string
;
nodeCachedDataDir
?:
string
;
...
...
@@ -179,16 +176,15 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
disableCrashReporter
:
boolean
;
driverHandle
?:
string
;
driverVerbose
:
boolean
;
webviewEndpoint
?:
string
;
galleryMachineIdResource
?:
URI
;
readonly
logFile
:
URI
;
get
webviewResourceRoot
():
string
{
return
this
.
webviewEndpoint
?
this
.
webviewEndpoint
+
'
/vscode-resource{{resource}}
'
:
'
vscode-resource:{{resource}}
'
;
return
this
.
options
.
webviewEndpoint
?
`
${
this
.
options
.
webviewEndpoint
}
/vscode-resource{{resource}}`
:
'
vscode-resource:{{resource}}
'
;
}
get
webviewCspSource
():
string
{
return
this
.
webviewEndpoint
?
thi
s
.
webviewEndpoint
:
'
vscode-resource:
'
;
return
this
.
options
.
webviewEndpoint
?
this
.
option
s
.
webviewEndpoint
:
'
vscode-resource:
'
;
}
}
...
...
src/vs/workbench/services/environment/common/environmentService.ts
浏览文件 @
b4679a37
...
...
@@ -5,7 +5,7 @@
import
{
createDecorator
,
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IEnvironmentService
,
IDebugParams
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IWorkbenchConstructionOptions
}
from
'
vs/workbench/workbench.web.api
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
...
...
@@ -17,7 +17,17 @@ export interface IWorkbenchEnvironmentService extends IEnvironmentService {
readonly
configuration
:
IWindowConfiguration
;
readonly
options
?:
IWorkbenchConstructionOptions
;
readonly
logFile
:
URI
;
readonly
logExtensionHostCommunication
:
boolean
;
readonly
debugSearch
:
IDebugParams
;
readonly
webviewResourceRoot
:
string
;
readonly
webviewCspSource
:
string
;
readonly
skipGettingStarted
:
boolean
|
undefined
;
readonly
skipReleaseNotes
:
boolean
|
undefined
;
readonly
options
?:
IWorkbenchConstructionOptions
;
}
src/vs/workbench/services/environment/node/environmentService.ts
浏览文件 @
b4679a37
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
EnvironmentService
}
from
'
vs/platform/environment/node/environmentService
'
;
import
{
EnvironmentService
,
parseSearchPort
}
from
'
vs/platform/environment/node/environmentService
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
memoize
}
from
'
vs/base/common/decorators
'
;
...
...
@@ -12,27 +12,36 @@ import { Schemas } from 'vs/base/common/network';
import
{
toBackupWorkspaceResource
}
from
'
vs/workbench/services/backup/common/backup
'
;
import
{
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
join
}
from
'
vs/base/common/path
'
;
import
{
IDebugParams
}
from
'
vs/platform/environment/common/environment
'
;
export
class
WorkbenchEnvironmentService
extends
EnvironmentService
implements
IWorkbenchEnvironmentService
{
_serviceBrand
!
:
ServiceIdentifier
<
any
>
;
readonly
webviewResourceRoot
=
'
vscode-resource:{{resource}}
'
;
readonly
webviewCspSource
=
'
vscode-resource:
'
;
constructor
(
private
_
configuration
:
IWindowConfiguration
,
readonly
configuration
:
IWindowConfiguration
,
execPath
:
string
)
{
super
(
_
configuration
,
execPath
);
super
(
configuration
,
execPath
);
this
.
_configuration
.
backupWorkspaceResource
=
this
.
_configuration
.
backupPath
?
toBackupWorkspaceResource
(
this
.
_
configuration
.
backupPath
,
this
)
:
undefined
;
this
.
configuration
.
backupWorkspaceResource
=
this
.
configuration
.
backupPath
?
toBackupWorkspaceResource
(
this
.
configuration
.
backupPath
,
this
)
:
undefined
;
}
get
configuration
():
IWindowConfiguration
{
return
this
.
_configuration
;
}
get
skipGettingStarted
():
boolean
{
return
!!
this
.
args
[
'
skip-getting-started
'
];
}
get
skipReleaseNotes
():
boolean
{
return
!!
this
.
args
[
'
skip-release-notes
'
];
}
@
memoize
get
userRoamingDataHome
():
URI
{
return
this
.
appSettingsHome
.
with
({
scheme
:
Schemas
.
userData
});
}
@
memoize
get
logFile
():
URI
{
return
URI
.
file
(
join
(
this
.
logsPath
,
`renderer
${
this
.
configuration
.
windowId
}
.log`
));
}
get
logExtensionHostCommunication
():
boolean
{
return
!!
this
.
args
.
logExtensionHostCommunication
;
}
@
memoize
get
debugSearch
():
IDebugParams
{
return
parseSearchPort
(
this
.
args
,
this
.
isBuilt
);
}
}
src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts
浏览文件 @
b4679a37
...
...
@@ -8,7 +8,7 @@ import { Emitter, Event } from 'vs/base/common/event';
import
{
Disposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
IMessagePassingProtocol
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
I
EnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
I
WorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ExtHostCustomersRegistry
}
from
'
vs/workbench/api/common/extHostCustomers
'
;
import
{
ExtHostContext
,
ExtHostExtensionServiceShape
,
IExtHostContext
,
MainContext
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
...
...
@@ -59,7 +59,7 @@ export class ExtensionHostProcessManager extends Disposable {
private
readonly
_remoteAuthority
:
string
,
initialActivationEvents
:
string
[],
@
IInstantiationService
private
readonly
_instantiationService
:
IInstantiationService
,
@
I
EnvironmentService
private
readonly
_environmentService
:
I
EnvironmentService
,
@
I
WorkbenchEnvironmentService
private
readonly
_environmentService
:
IWorkbench
EnvironmentService
,
)
{
super
();
this
.
_extensionHostProcessFinishedActivateEvents
=
Object
.
create
(
null
);
...
...
src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts
浏览文件 @
b4679a37
...
...
@@ -5,7 +5,7 @@
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
IMessagePassingProtocol
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
I
EnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
I
WorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
connectRemoteAgentExtensionHost
,
IRemoteExtensionHostStartParams
,
IConnectionOptions
,
ISocketFactory
}
from
'
vs/platform/remote/common/remoteAgentConnection
'
;
...
...
@@ -49,7 +49,7 @@ export class RemoteExtensionHostClient extends Disposable implements IExtensionH
private
readonly
_initDataProvider
:
IInitDataProvider
,
private
readonly
_socketFactory
:
ISocketFactory
,
@
IWorkspaceContextService
private
readonly
_contextService
:
IWorkspaceContextService
,
@
I
EnvironmentService
private
readonly
_environmentService
:
I
EnvironmentService
,
@
I
WorkbenchEnvironmentService
private
readonly
_environmentService
:
IWorkbench
EnvironmentService
,
@
ITelemetryService
private
readonly
_telemetryService
:
ITelemetryService
,
@
ILifecycleService
private
readonly
_lifecycleService
:
ILifecycleService
,
@
ILogService
private
readonly
_logService
:
ILogService
,
...
...
src/vs/workbench/services/search/node/searchService.ts
浏览文件 @
b4679a37
...
...
@@ -12,7 +12,8 @@ import { URI as uri } from 'vs/base/common/uri';
import
{
getNextTickChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
Client
,
IIPCOptions
}
from
'
vs/base/parts/ipc/node/ipc.cp
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IDebugParams
,
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IDebugParams
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
FileMatch
,
IFileMatch
,
IFileQuery
,
IProgressMessage
,
IRawSearchService
,
ISearchComplete
,
ISearchConfiguration
,
ISearchProgressItem
,
ISearchResultProvider
,
ISerializedFileMatch
,
ISerializedSearchComplete
,
ISerializedSearchProgressItem
,
isSerializedSearchComplete
,
isSerializedSearchSuccess
,
ITextQuery
,
ISearchService
}
from
'
vs/workbench/services/search/common/search
'
;
...
...
@@ -35,7 +36,7 @@ export class LocalSearchService extends SearchService {
@
ILogService
logService
:
ILogService
,
@
IExtensionService
extensionService
:
IExtensionService
,
@
IFileService
fileService
:
IFileService
,
@
I
EnvironmentService
readonly
environmentService
:
I
EnvironmentService
,
@
I
WorkbenchEnvironmentService
readonly
environmentService
:
IWorkbench
EnvironmentService
,
@
IInstantiationService
readonly
instantiationService
:
IInstantiationService
)
{
super
(
modelService
,
untitledEditorService
,
editorService
,
telemetryService
,
logService
,
extensionService
,
fileService
);
...
...
@@ -204,4 +205,4 @@ export class DiskSearch implements ISearchResultProvider {
}
}
registerSingleton
(
ISearchService
,
LocalSearchService
,
true
);
\ No newline at end of file
registerSingleton
(
ISearchService
,
LocalSearchService
,
true
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录