Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
f965a2c5
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
f965a2c5
编写于
2月 13, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #43197
上级
10f4d562
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
20 deletion
+14
-20
src/vs/platform/configuration/common/configurationRegistry.ts
...vs/platform/configuration/common/configurationRegistry.ts
+8
-2
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostConfiguration.ts
src/vs/workbench/api/node/extHostConfiguration.ts
+3
-15
src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
...nch/services/extensions/electron-browser/extensionHost.ts
+2
-2
未找到文件。
src/vs/platform/configuration/common/configurationRegistry.ts
浏览文件 @
f965a2c5
...
...
@@ -336,7 +336,13 @@ export function validateProperty(property: string): string {
return
null
;
}
export
function
getScopes
(
keys
:
string
[]):
ConfigurationScope
[]
{
export
function
getScopes
():
{
[
key
:
string
]:
ConfigurationScope
}
{
const
scopes
=
{};
const
configurationProperties
=
configurationRegistry
.
getConfigurationProperties
();
return
keys
.
map
(
key
=>
configurationProperties
[
key
].
scope
);
for
(
const
key
of
Object
.
keys
(
configurationProperties
))
{
scopes
[
key
]
=
configurationProperties
[
key
].
scope
;
}
scopes
[
'
launch
'
]
=
ConfigurationScope
.
RESOURCE
;
scopes
[
'
task
'
]
=
ConfigurationScope
.
RESOURCE
;
return
scopes
;
}
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
f965a2c5
...
...
@@ -83,7 +83,7 @@ export interface IInitData {
}
export
interface
IConfigurationInitData
extends
IConfigurationData
{
configurationScopes
:
ConfigurationScope
[]
;
configurationScopes
:
{
[
key
:
string
]:
ConfigurationScope
}
;
}
export
interface
IWorkspaceConfigurationChangeEventData
{
...
...
src/vs/workbench/api/node/extHostConfiguration.ts
浏览文件 @
f965a2c5
...
...
@@ -41,14 +41,14 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape {
private
readonly
_onDidChangeConfiguration
=
new
Emitter
<
vscode
.
ConfigurationChangeEvent
>
();
private
readonly
_proxy
:
MainThreadConfigurationShape
;
private
readonly
_extHostWorkspace
:
ExtHostWorkspace
;
private
_configurationScopes
:
Map
<
string
,
ConfigurationScope
>
;
private
_configurationScopes
:
{
[
key
:
string
]:
ConfigurationScope
}
;
private
_configuration
:
Configuration
;
constructor
(
proxy
:
MainThreadConfigurationShape
,
extHostWorkspace
:
ExtHostWorkspace
,
data
:
IConfigurationInitData
)
{
this
.
_proxy
=
proxy
;
this
.
_extHostWorkspace
=
extHostWorkspace
;
this
.
_configuration
=
Configuration
.
parse
(
data
);
this
.
_
readConfigurationScopes
(
data
.
configurationScopes
)
;
this
.
_
configurationScopes
=
data
.
configurationScopes
;
}
get
onDidChangeConfiguration
():
Event
<
vscode
.
ConfigurationChangeEvent
>
{
...
...
@@ -129,7 +129,7 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape {
}
private
_validateConfigurationAccess
(
key
:
string
,
resource
:
URI
,
extensionId
:
string
):
void
{
const
scope
=
this
.
_configurationScopes
.
get
(
key
)
;
const
scope
=
this
.
_configurationScopes
[
key
]
;
const
extensionIdText
=
extensionId
?
`[
${
extensionId
}
] `
:
''
;
if
(
ConfigurationScope
.
RESOURCE
===
scope
)
{
if
(
resource
===
void
0
)
{
...
...
@@ -145,18 +145,6 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape {
}
}
private
_readConfigurationScopes
(
scopes
:
ConfigurationScope
[]):
void
{
this
.
_configurationScopes
=
new
Map
<
string
,
ConfigurationScope
>
();
if
(
scopes
.
length
)
{
const
defaultKeys
=
this
.
_configuration
.
keys
(
this
.
_extHostWorkspace
.
workspace
).
default
;
if
(
defaultKeys
.
length
===
scopes
.
length
)
{
for
(
let
i
=
0
;
i
<
defaultKeys
.
length
;
i
++
)
{
this
.
_configurationScopes
.
set
(
defaultKeys
[
i
],
scopes
[
i
]);
}
}
}
}
private
_toConfigurationChangeEvent
(
data
:
IWorkspaceConfigurationChangeEventData
):
vscode
.
ConfigurationChangeEvent
{
const
changedConfiguration
=
new
ConfigurationModel
(
data
.
changedConfiguration
.
contents
,
data
.
changedConfiguration
.
keys
,
data
.
changedConfiguration
.
overrides
);
const
changedConfigurationByResource
:
StrictResourceMap
<
ConfigurationModel
>
=
new
StrictResourceMap
<
ConfigurationModel
>
();
...
...
src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
浏览文件 @
f965a2c5
...
...
@@ -358,7 +358,7 @@ export class ExtensionHostProcessWorker {
private
_createExtHostInitData
():
TPromise
<
IInitData
>
{
return
TPromise
.
join
<
any
>
([
this
.
_telemetryService
.
getTelemetryInfo
(),
this
.
_extensionService
.
getExtensions
()]).
then
(([
telemetryInfo
,
extensionDescriptions
])
=>
{
const
configurationData
:
IConfigurationInitData
=
{
...
this
.
_configurationService
.
getConfigurationData
(),
configurationScopes
:
[]
};
const
configurationData
:
IConfigurationInitData
=
{
...
this
.
_configurationService
.
getConfigurationData
(),
configurationScopes
:
{}
};
const
r
:
IInitData
=
{
parentPid
:
process
.
pid
,
environment
:
{
...
...
@@ -376,7 +376,7 @@ export class ExtensionHostProcessWorker {
workspace
:
this
.
_contextService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
?
null
:
<
IWorkspaceData
>
this
.
_contextService
.
getWorkspace
(),
extensions
:
extensionDescriptions
,
// Send configurations scopes only in development mode.
configuration
:
!
this
.
_environmentService
.
isBuilt
||
this
.
_environmentService
.
isExtensionDevelopment
?
{
...
configurationData
,
configurationScopes
:
getScopes
(
this
.
_configurationService
.
keys
().
default
)
}
:
configurationData
,
configuration
:
!
this
.
_environmentService
.
isBuilt
||
this
.
_environmentService
.
isExtensionDevelopment
?
{
...
configurationData
,
configurationScopes
:
getScopes
()
}
:
configurationData
,
telemetryInfo
,
args
:
this
.
_environmentService
.
args
,
execPath
:
this
.
_environmentService
.
execPath
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录