Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
33e545ee
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,发现更多精彩内容 >>
提交
33e545ee
编写于
12月 12, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add and fix tests
上级
59111abe
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
649 addition
and
266 deletion
+649
-266
src/vs/platform/configuration/common/configuration.ts
src/vs/platform/configuration/common/configuration.ts
+10
-8
src/vs/platform/configuration/common/configurationModels.ts
src/vs/platform/configuration/common/configurationModels.ts
+41
-2
src/vs/platform/configuration/test/common/configurationModels.test.ts
...orm/configuration/test/common/configurationModels.test.ts
+504
-66
src/vs/workbench/api/common/extHostConfiguration.ts
src/vs/workbench/api/common/extHostConfiguration.ts
+1
-1
src/vs/workbench/services/configuration/common/configurationModels.ts
...ench/services/configuration/common/configurationModels.ts
+20
-43
src/vs/workbench/services/configuration/test/common/configurationModels.test.ts
...ces/configuration/test/common/configurationModels.test.ts
+68
-141
src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts
...ch/test/electron-browser/api/extHostConfiguration.test.ts
+5
-5
未找到文件。
src/vs/platform/configuration/common/configuration.ts
浏览文件 @
33e545ee
...
@@ -160,10 +160,12 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
...
@@ -160,10 +160,12 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
if
(
to
&&
from
)
{
if
(
to
&&
from
)
{
for
(
const
key
of
from
.
keys
)
{
for
(
const
key
of
from
.
keys
)
{
const
value1
=
getConfigurationValue
(
from
.
contents
,
key
);
if
(
to
.
keys
.
indexOf
(
key
)
!==
-
1
)
{
const
value2
=
getConfigurationValue
(
to
.
contents
,
key
);
const
value1
=
getConfigurationValue
(
from
.
contents
,
key
);
if
(
!
objects
.
equals
(
value1
,
value2
))
{
const
value2
=
getConfigurationValue
(
to
.
contents
,
key
);
updated
.
push
(
key
);
if
(
!
objects
.
equals
(
value1
,
value2
))
{
updated
.
push
(
key
);
}
}
}
}
}
}
}
...
@@ -173,7 +175,7 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
...
@@ -173,7 +175,7 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
const
result
:
IStringDictionary
<
IOverrides
>
=
{};
const
result
:
IStringDictionary
<
IOverrides
>
=
{};
for
(
const
override
of
overrides
)
{
for
(
const
override
of
overrides
)
{
for
(
const
identifier
of
override
.
identifiers
)
{
for
(
const
identifier
of
override
.
identifiers
)
{
result
[
identifier
]
=
override
;
result
[
keyFromOverrideIdentifier
(
identifier
)
]
=
override
;
}
}
}
}
return
result
;
return
result
;
...
@@ -185,7 +187,7 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
...
@@ -185,7 +187,7 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
for
(
const
key
of
added
)
{
for
(
const
key
of
added
)
{
const
override
=
toOverridesByIdentifier
[
key
];
const
override
=
toOverridesByIdentifier
[
key
];
if
(
override
)
{
if
(
override
)
{
overrides
.
push
([
key
,
override
.
keys
]);
overrides
.
push
([
overrideIdentifierFromKey
(
key
)
,
override
.
keys
]);
}
}
}
}
}
}
...
@@ -193,7 +195,7 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
...
@@ -193,7 +195,7 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
for
(
const
key
of
removed
)
{
for
(
const
key
of
removed
)
{
const
override
=
fromOverridesByIdentifier
[
key
];
const
override
=
fromOverridesByIdentifier
[
key
];
if
(
override
)
{
if
(
override
)
{
overrides
.
push
([
key
,
override
.
keys
]);
overrides
.
push
([
overrideIdentifierFromKey
(
key
)
,
override
.
keys
]);
}
}
}
}
}
}
...
@@ -204,7 +206,7 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
...
@@ -204,7 +206,7 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
const
toOverride
=
toOverridesByIdentifier
[
key
];
const
toOverride
=
toOverridesByIdentifier
[
key
];
if
(
fromOverride
&&
toOverride
)
{
if
(
fromOverride
&&
toOverride
)
{
const
result
=
compare
({
contents
:
fromOverride
.
contents
,
keys
:
fromOverride
.
keys
,
overrides
:
[]
},
{
contents
:
toOverride
.
contents
,
keys
:
toOverride
.
keys
,
overrides
:
[]
});
const
result
=
compare
({
contents
:
fromOverride
.
contents
,
keys
:
fromOverride
.
keys
,
overrides
:
[]
},
{
contents
:
toOverride
.
contents
,
keys
:
toOverride
.
keys
,
overrides
:
[]
});
overrides
.
push
([
key
,
[...
result
.
added
,
...
result
.
removed
,
...
result
.
updated
]]);
overrides
.
push
([
overrideIdentifierFromKey
(
key
)
,
[...
result
.
added
,
...
result
.
removed
,
...
result
.
updated
]]);
}
}
}
}
}
}
...
...
src/vs/platform/configuration/common/configurationModels.ts
浏览文件 @
33e545ee
...
@@ -466,7 +466,8 @@ export class Configuration {
...
@@ -466,7 +466,8 @@ export class Configuration {
compareAndUpdateDefaultConfiguration
(
defaults
:
ConfigurationModel
,
keys
:
string
[]):
IConfigurationChange
{
compareAndUpdateDefaultConfiguration
(
defaults
:
ConfigurationModel
,
keys
:
string
[]):
IConfigurationChange
{
const
overrides
:
[
string
,
string
[]][]
=
keys
const
overrides
:
[
string
,
string
[]][]
=
keys
.
filter
(
key
=>
OVERRIDE_PROPERTY_PATTERN
.
test
(
key
))
.
filter
(
key
=>
OVERRIDE_PROPERTY_PATTERN
.
test
(
key
))
.
map
(
overrideIdentifier
=>
{
.
map
(
key
=>
{
const
overrideIdentifier
=
overrideIdentifierFromKey
(
key
);
const
fromKeys
=
this
.
_defaultConfiguration
.
getKeysForOverrideIdentifier
(
overrideIdentifier
);
const
fromKeys
=
this
.
_defaultConfiguration
.
getKeysForOverrideIdentifier
(
overrideIdentifier
);
const
toKeys
=
defaults
.
getKeysForOverrideIdentifier
(
overrideIdentifier
);
const
toKeys
=
defaults
.
getKeysForOverrideIdentifier
(
overrideIdentifier
);
const
keys
=
[
const
keys
=
[
...
@@ -489,6 +490,44 @@ export class Configuration {
...
@@ -489,6 +490,44 @@ export class Configuration {
return
{
keys
,
overrides
};
return
{
keys
,
overrides
};
}
}
compareAndUpdateRemoteUserConfiguration
(
user
:
ConfigurationModel
):
IConfigurationChange
{
const
{
added
,
updated
,
removed
,
overrides
}
=
compare
(
this
.
remoteUserConfiguration
,
user
);
let
keys
=
[...
added
,
...
updated
,
...
removed
];
if
(
keys
.
length
)
{
this
.
updateRemoteUserConfiguration
(
user
);
}
return
{
keys
,
overrides
};
}
compareAndUpdateWorkspaceConfiguration
(
workspaceConfiguration
:
ConfigurationModel
):
IConfigurationChange
{
const
{
added
,
updated
,
removed
,
overrides
}
=
compare
(
this
.
workspaceConfiguration
,
workspaceConfiguration
);
let
keys
=
[...
added
,
...
updated
,
...
removed
];
if
(
keys
.
length
)
{
this
.
updateWorkspaceConfiguration
(
workspaceConfiguration
);
}
return
{
keys
,
overrides
};
}
compareAndUpdateFolderConfiguration
(
resource
:
URI
,
folderConfiguration
:
ConfigurationModel
):
IConfigurationChange
{
const
currentFolderConfiguration
=
this
.
folderConfigurations
.
get
(
resource
);
const
{
added
,
updated
,
removed
,
overrides
}
=
compare
(
currentFolderConfiguration
,
folderConfiguration
);
let
keys
=
[...
added
,
...
updated
,
...
removed
];
if
(
keys
.
length
)
{
this
.
updateFolderConfiguration
(
resource
,
folderConfiguration
);
}
return
{
keys
,
overrides
};
}
compareAndDeleteFolderConfiguration
(
folder
:
URI
):
IConfigurationChange
{
const
folderConfig
=
this
.
folderConfigurations
.
get
(
folder
);
if
(
!
folderConfig
)
{
throw
new
Error
(
'
Unknown folder
'
);
}
this
.
deleteFolderConfiguration
(
folder
);
const
{
added
,
updated
,
removed
,
overrides
}
=
compare
(
folderConfig
,
undefined
);
return
{
keys
:
[...
added
,
...
updated
,
...
removed
],
overrides
};
}
get
defaults
():
ConfigurationModel
{
get
defaults
():
ConfigurationModel
{
return
this
.
_defaultConfiguration
;
return
this
.
_defaultConfiguration
;
}
}
...
@@ -675,7 +714,7 @@ export class ConfigurationChangeEvent implements IConfigurationChangeEvent {
...
@@ -675,7 +714,7 @@ export class ConfigurationChangeEvent implements IConfigurationChangeEvent {
this
.
affectedKeys
=
values
(
keysSet
);
this
.
affectedKeys
=
values
(
keysSet
);
const
configurationModel
=
new
ConfigurationModel
();
const
configurationModel
=
new
ConfigurationModel
();
this
.
affectedKeys
.
forEach
(
key
=>
this
.
affectedKeysTree
.
setValue
(
key
,
{}));
this
.
affectedKeys
.
forEach
(
key
=>
configurationModel
.
setValue
(
key
,
{}));
this
.
affectedKeysTree
=
configurationModel
.
contents
;
this
.
affectedKeysTree
=
configurationModel
.
contents
;
}
}
...
...
src/vs/platform/configuration/test/common/configurationModels.test.ts
浏览文件 @
33e545ee
此差异已折叠。
点击以展开。
src/vs/workbench/api/common/extHostConfiguration.ts
浏览文件 @
33e545ee
...
@@ -257,7 +257,7 @@ export class ExtHostConfigProvider {
...
@@ -257,7 +257,7 @@ export class ExtHostConfigProvider {
private
_toConfigurationChangeEvent
(
change
:
IConfigurationChange
,
previous
:
{
data
:
IConfigurationData
,
workspace
:
Workspace
|
undefined
}):
vscode
.
ConfigurationChangeEvent
{
private
_toConfigurationChangeEvent
(
change
:
IConfigurationChange
,
previous
:
{
data
:
IConfigurationData
,
workspace
:
Workspace
|
undefined
}):
vscode
.
ConfigurationChangeEvent
{
const
event
=
new
ConfigurationChangeEvent
(
change
,
previous
,
this
.
_configuration
,
this
.
_extHostWorkspace
.
workspace
);
const
event
=
new
ConfigurationChangeEvent
(
change
,
previous
,
this
.
_configuration
,
this
.
_extHostWorkspace
.
workspace
);
return
Object
.
freeze
({
return
Object
.
freeze
({
affectsConfiguration
:
(
section
:
string
,
resource
?:
URI
)
=>
event
.
affectsConfiguration
(
section
,
{
resource
}
)
affectsConfiguration
:
(
section
:
string
,
resource
?:
URI
)
=>
event
.
affectsConfiguration
(
section
,
resource
?
{
resource
}
:
undefined
)
});
});
}
}
...
...
src/vs/workbench/services/configuration/common/configurationModels.ts
浏览文件 @
33e545ee
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
import
{
equals
}
from
'
vs/base/common/objects
'
;
import
{
equals
}
from
'
vs/base/common/objects
'
;
import
{
compare
,
toValuesTree
,
IConfigurationModel
,
IConfigurationOverrides
,
IConfigurationValue
,
IConfigurationChange
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
toValuesTree
,
IConfigurationModel
,
IConfigurationOverrides
,
IConfigurationValue
,
IConfigurationChange
,
overrideIdentifierFromKey
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
Configuration
as
BaseConfiguration
,
ConfigurationModelParser
,
ConfigurationModel
}
from
'
vs/platform/configuration/common/configurationModels
'
;
import
{
Configuration
as
BaseConfiguration
,
ConfigurationModelParser
,
ConfigurationModel
}
from
'
vs/platform/configuration/common/configurationModels
'
;
import
{
IStoredWorkspaceFolder
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IStoredWorkspaceFolder
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
Workspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Workspace
}
from
'
vs/platform/workspace/common/workspace
'
;
...
@@ -115,62 +115,39 @@ export class Configuration extends BaseConfiguration {
...
@@ -115,62 +115,39 @@ export class Configuration extends BaseConfiguration {
return
super
.
keys
(
this
.
_workspace
);
return
super
.
keys
(
this
.
_workspace
);
}
}
compareAndUpdateRemoteUserConfiguration
(
user
:
ConfigurationModel
):
IConfigurationChange
{
const
{
added
,
updated
,
removed
,
overrides
}
=
compare
(
this
.
remoteUserConfiguration
,
user
);
let
keys
=
[...
added
,
...
updated
,
...
removed
];
if
(
keys
.
length
)
{
super
.
updateRemoteUserConfiguration
(
user
);
}
return
{
keys
,
overrides
};
}
compareAndUpdateWorkspaceConfiguration
(
workspaceConfiguration
:
ConfigurationModel
):
IConfigurationChange
{
const
{
added
,
updated
,
removed
,
overrides
}
=
compare
(
this
.
workspaceConfiguration
,
workspaceConfiguration
);
let
keys
=
[...
added
,
...
updated
,
...
removed
];
if
(
keys
.
length
)
{
super
.
updateWorkspaceConfiguration
(
workspaceConfiguration
);
}
return
{
keys
,
overrides
};
}
compareAndUpdateFolderConfiguration
(
resource
:
URI
,
folderConfiguration
:
ConfigurationModel
):
IConfigurationChange
{
const
currentFolderConfiguration
=
this
.
folderConfigurations
.
get
(
resource
);
const
{
added
,
updated
,
removed
,
overrides
}
=
compare
(
currentFolderConfiguration
,
folderConfiguration
);
let
keys
=
[...
added
,
...
updated
,
...
removed
];
if
(
keys
.
length
)
{
super
.
updateFolderConfiguration
(
resource
,
folderConfiguration
);
}
return
{
keys
,
overrides
};
}
compareAndDeleteFolderConfiguration
(
folder
:
URI
):
IConfigurationChange
{
compareAndDeleteFolderConfiguration
(
folder
:
URI
):
IConfigurationChange
{
if
(
this
.
_workspace
&&
this
.
_workspace
.
folders
.
length
>
0
&&
this
.
_workspace
.
folders
[
0
].
uri
.
toString
()
===
folder
.
toString
())
{
if
(
this
.
_workspace
&&
this
.
_workspace
.
folders
.
length
>
0
&&
this
.
_workspace
.
folders
[
0
].
uri
.
toString
()
===
folder
.
toString
())
{
// Do not remove workspace configuration
// Do not remove workspace configuration
return
{
keys
:
[],
overrides
:
[]
};
return
{
keys
:
[],
overrides
:
[]
};
}
}
const
folderConfig
=
this
.
folderConfigurations
.
get
(
folder
);
return
super
.
compareAndDeleteFolderConfiguration
(
folder
);
if
(
!
folderConfig
)
{
throw
new
Error
(
'
Unknown folder
'
);
}
super
.
deleteFolderConfiguration
(
folder
);
const
{
added
,
updated
,
removed
,
overrides
}
=
compare
(
folderConfig
,
undefined
);
return
{
keys
:
[...
added
,
...
updated
,
...
removed
],
overrides
};
}
}
compare
(
other
:
Configuration
):
IConfigurationChange
{
compare
(
other
:
Configuration
):
IConfigurationChange
{
const
compare
=
(
fromKeys
:
string
[],
toKeys
:
string
[],
overrideIdentifier
?:
string
):
string
[]
=>
{
const
compare
=
(
fromKeys
:
string
[],
toKeys
:
string
[],
overrideIdentifier
?:
string
):
string
[]
=>
{
return
[
const
keys
:
string
[]
=
[];
...
toKeys
.
filter
(
key
=>
fromKeys
.
indexOf
(
key
)
===
-
1
),
keys
.
push
(...
toKeys
.
filter
(
key
=>
fromKeys
.
indexOf
(
key
)
===
-
1
));
...
fromKeys
.
filter
(
key
=>
toKeys
.
indexOf
(
key
)
===
-
1
),
keys
.
push
(...
fromKeys
.
filter
(
key
=>
toKeys
.
indexOf
(
key
)
===
-
1
));
...
fromKeys
.
filter
(
key
=>
!
equals
(
this
.
getValue
(
key
,
{
overrideIdentifier
}),
other
.
getValue
(
key
,
{
overrideIdentifier
}))
keys
.
push
(...
fromKeys
.
filter
(
key
=>
{
||
(
this
.
_workspace
&&
this
.
_workspace
.
folders
.
some
(
folder
=>
!
equals
(
this
.
getValue
(
key
,
{
resource
:
folder
.
uri
,
overrideIdentifier
}),
other
.
getValue
(
key
,
{
resource
:
folder
.
uri
,
overrideIdentifier
})))))
// Ignore if the key does not exist in both models
];
if
(
toKeys
.
indexOf
(
key
)
===
-
1
)
{
return
false
;
}
// Compare workspace value
if
(
!
equals
(
this
.
getValue
(
key
,
{
overrideIdentifier
}),
other
.
getValue
(
key
,
{
overrideIdentifier
})))
{
return
true
;
}
// Compare workspace folder value
return
this
.
_workspace
&&
this
.
_workspace
.
folders
.
some
(
folder
=>
!
equals
(
this
.
getValue
(
key
,
{
resource
:
folder
.
uri
,
overrideIdentifier
}),
other
.
getValue
(
key
,
{
resource
:
folder
.
uri
,
overrideIdentifier
})));
}));
return
keys
;
};
};
const
keys
=
compare
(
this
.
allKeys
(),
other
.
allKeys
());
const
keys
=
compare
(
this
.
allKeys
(),
other
.
allKeys
());
const
overrides
:
[
string
,
string
[]][]
=
[];
const
overrides
:
[
string
,
string
[]][]
=
[];
for
(
const
key
of
keys
)
{
for
(
const
key
of
keys
)
{
if
(
OVERRIDE_PROPERTY_PATTERN
.
test
(
key
))
{
if
(
OVERRIDE_PROPERTY_PATTERN
.
test
(
key
))
{
overrides
.
push
([
key
,
compare
(
this
.
getAllKeysForOverrideIdentifier
(
key
),
other
.
getAllKeysForOverrideIdentifier
(
key
),
key
)]);
const
overrideIdentifier
=
overrideIdentifierFromKey
(
key
);
overrides
.
push
([
overrideIdentifier
,
compare
(
this
.
getAllKeysForOverrideIdentifier
(
overrideIdentifier
),
other
.
getAllKeysForOverrideIdentifier
(
overrideIdentifier
),
overrideIdentifier
)]);
}
}
}
}
return
{
keys
,
overrides
};
return
{
keys
,
overrides
};
...
...
src/vs/workbench/services/configuration/test/common/configurationModels.test.ts
浏览文件 @
33e545ee
...
@@ -3,15 +3,13 @@
...
@@ -3,15 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
*
as
assert
from
'
assert
'
;
import
{
join
}
from
'
vs/base/common/path
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
WorkspaceConfigurationChangeEvent
,
StandaloneConfigurationModelParser
,
AllKeysConfigurationChangeEvent
,
Configuration
}
from
'
vs/workbench/services/configuration/common/configurationModels
'
;
import
{
StandaloneConfigurationModelParser
,
Configuration
}
from
'
vs/workbench/services/configuration/common/configurationModels
'
;
import
{
Workspace
,
WorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ConfigurationModelParser
,
ConfigurationModel
}
from
'
vs/platform/configuration/common/configurationModels
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
ConfigurationChangeEvent
,
ConfigurationModel
,
ConfigurationModelParser
}
from
'
vs/platform/configuration/common/configurationModels
'
;
import
{
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
,
ConfigurationScope
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
,
ConfigurationScope
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
ResourceMap
}
from
'
vs/base/common/map
'
;
import
{
ResourceMap
}
from
'
vs/base/common/map
'
;
import
{
Workspace
,
WorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
suite
(
'
FolderSettingsModelParser
'
,
()
=>
{
suite
(
'
FolderSettingsModelParser
'
,
()
=>
{
...
@@ -66,7 +64,7 @@ suite('FolderSettingsModelParser', () => {
...
@@ -66,7 +64,7 @@ suite('FolderSettingsModelParser', () => {
testObject
.
parseContent
(
JSON
.
stringify
({
'
[json]
'
:
{
'
FolderSettingsModelParser.window
'
:
'
window
'
,
'
FolderSettingsModelParser.resource
'
:
'
resource
'
,
'
FolderSettingsModelParser.application
'
:
'
application
'
,
'
FolderSettingsModelParser.machine
'
:
'
executable
'
}
}));
testObject
.
parseContent
(
JSON
.
stringify
({
'
[json]
'
:
{
'
FolderSettingsModelParser.window
'
:
'
window
'
,
'
FolderSettingsModelParser.resource
'
:
'
resource
'
,
'
FolderSettingsModelParser.application
'
:
'
application
'
,
'
FolderSettingsModelParser.machine
'
:
'
executable
'
}
}));
assert
.
deepEqual
(
testObject
.
configurationModel
.
overrides
,
[{
'
contents
'
:
{
'
FolderSettingsModelParser
'
:
{
'
resource
'
:
'
resource
'
}
},
'
identifiers
'
:
[
'
json
'
]
}]);
assert
.
deepEqual
(
testObject
.
configurationModel
.
overrides
,
[{
'
contents
'
:
{
'
FolderSettingsModelParser
'
:
{
'
resource
'
:
'
resource
'
}
},
'
identifiers
'
:
[
'
json
'
]
,
'
keys
'
:
[
'
FolderSettingsModelParser.resource
'
]
}]);
});
});
test
(
'
reprocess folder settings excludes application and machine setting
'
,
()
=>
{
test
(
'
reprocess folder settings excludes application and machine setting
'
,
()
=>
{
...
@@ -112,143 +110,72 @@ suite('StandaloneConfigurationModelParser', () => {
...
@@ -112,143 +110,72 @@ suite('StandaloneConfigurationModelParser', () => {
});
});
suite
(
'
WorkspaceConfigurationChangeEvent
'
,
()
=>
{
suite
(
'
Workspace Configuration
'
,
()
=>
{
test
(
'
changeEvent affecting workspace folders
'
,
()
=>
{
const
defaultConfigurationModel
=
toConfigurationModel
({
let
configurationChangeEvent
=
new
ConfigurationChangeEvent
();
'
editor.lineNumbers
'
:
'
on
'
,
configurationChangeEvent
.
change
([
'
window.title
'
]);
'
editor.fontSize
'
:
12
,
configurationChangeEvent
.
change
([
'
window.zoomLevel
'
],
URI
.
file
(
'
folder1
'
));
'
window.zoomLevel
'
:
1
,
configurationChangeEvent
.
change
([
'
workbench.editor.enablePreview
'
],
URI
.
file
(
'
folder2
'
));
'
[markdown]
'
:
{
configurationChangeEvent
.
change
([
'
window.restoreFullscreen
'
],
URI
.
file
(
'
folder1
'
));
'
editor.wordWrap
'
:
'
off
'
configurationChangeEvent
.
change
([
'
window.restoreWindows
'
],
URI
.
file
(
'
folder2
'
));
},
configurationChangeEvent
.
telemetryData
(
ConfigurationTarget
.
WORKSPACE
,
{});
'
window.title
'
:
'
custom
'
,
'
workbench.enableTabs
'
:
false
,
let
testObject
=
new
WorkspaceConfigurationChangeEvent
(
configurationChangeEvent
,
new
Workspace
(
'
id
'
,
'
editor.insertSpaces
'
:
true
[
new
WorkspaceFolder
({
index
:
0
,
name
:
'
1
'
,
uri
:
URI
.
file
(
'
folder1
'
)
}),
new
WorkspaceFolder
({
index
:
1
,
name
:
'
2
'
,
uri
:
URI
.
file
(
'
folder2
'
)
}),
new
WorkspaceFolder
({
index
:
2
,
name
:
'
3
'
,
uri
:
URI
.
file
(
'
folder3
'
)
})]));
assert
.
deepEqual
(
testObject
.
affectedKeys
,
[
'
window.title
'
,
'
window.zoomLevel
'
,
'
window.restoreFullscreen
'
,
'
workbench.editor.enablePreview
'
,
'
window.restoreWindows
'
]);
assert
.
equal
(
testObject
.
source
,
ConfigurationTarget
.
WORKSPACE
);
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.zoomLevel
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.zoomLevel
'
,
URI
.
file
(
'
folder1
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.zoomLevel
'
,
URI
.
file
(
join
(
'
folder1
'
,
'
file1
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.zoomLevel
'
,
URI
.
file
(
'
file1
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.zoomLevel
'
,
URI
.
file
(
'
file2
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.zoomLevel
'
,
URI
.
file
(
join
(
'
folder2
'
,
'
file2
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.zoomLevel
'
,
URI
.
file
(
join
(
'
folder3
'
,
'
file3
'
))));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreFullscreen
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreFullscreen
'
,
URI
.
file
(
join
(
'
folder1
'
,
'
file1
'
))));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreFullscreen
'
,
URI
.
file
(
'
folder1
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.restoreFullscreen
'
,
URI
.
file
(
'
file1
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.restoreFullscreen
'
,
URI
.
file
(
'
file2
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.restoreFullscreen
'
,
URI
.
file
(
join
(
'
folder2
'
,
'
file2
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.restoreFullscreen
'
,
URI
.
file
(
join
(
'
folder3
'
,
'
file3
'
))));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreWindows
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreWindows
'
,
URI
.
file
(
'
folder2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreWindows
'
,
URI
.
file
(
join
(
'
folder2
'
,
'
file2
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.restoreWindows
'
,
URI
.
file
(
'
file2
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.restoreWindows
'
,
URI
.
file
(
join
(
'
folder1
'
,
'
file1
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
window.restoreWindows
'
,
URI
.
file
(
join
(
'
folder3
'
,
'
file3
'
))));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
'
folder1
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
join
(
'
folder1
'
,
'
file1
'
))));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
'
folder2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
join
(
'
folder2
'
,
'
file2
'
))));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
'
folder3
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
join
(
'
folder3
'
,
'
file3
'
))));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
'
file1
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
'
file2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
'
file3
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
'
folder1
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
join
(
'
folder1
'
,
'
file1
'
))));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
'
folder2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
join
(
'
folder2
'
,
'
file2
'
))));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
'
folder3
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
join
(
'
folder3
'
,
'
file3
'
))));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
'
file1
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
'
file2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
'
file3
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor.enablePreview
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor.enablePreview
'
,
URI
.
file
(
'
folder2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor.enablePreview
'
,
URI
.
file
(
join
(
'
folder2
'
,
'
file2
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
workbench.editor.enablePreview
'
,
URI
.
file
(
'
folder1
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
workbench.editor.enablePreview
'
,
URI
.
file
(
join
(
'
folder1
'
,
'
file1
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
workbench.editor.enablePreview
'
,
URI
.
file
(
'
folder3
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor
'
,
URI
.
file
(
'
folder2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor
'
,
URI
.
file
(
join
(
'
folder2
'
,
'
file2
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
workbench.editor
'
,
URI
.
file
(
'
folder1
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
workbench.editor
'
,
URI
.
file
(
join
(
'
folder1
'
,
'
file1
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
workbench.editor
'
,
URI
.
file
(
'
folder3
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench
'
,
URI
.
file
(
'
folder2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench
'
,
URI
.
file
(
join
(
'
folder2
'
,
'
file2
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
workbench
'
,
URI
.
file
(
'
folder1
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
workbench
'
,
URI
.
file
(
'
folder3
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
files
'
));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
files
'
,
URI
.
file
(
'
folder1
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
files
'
,
URI
.
file
(
join
(
'
folder1
'
,
'
file1
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
files
'
,
URI
.
file
(
'
folder2
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
files
'
,
URI
.
file
(
join
(
'
folder2
'
,
'
file2
'
))));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
files
'
,
URI
.
file
(
'
folder3
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
files
'
,
URI
.
file
(
join
(
'
folder3
'
,
'
file3
'
))));
});
});
});
test
(
'
Test compare same configurations
'
,
()
=>
{
const
workspace
=
new
Workspace
(
'
a
'
,
[
new
WorkspaceFolder
({
index
:
0
,
name
:
'
a
'
,
uri
:
URI
.
file
(
'
folder1
'
)
}),
new
WorkspaceFolder
({
index
:
1
,
name
:
'
b
'
,
uri
:
URI
.
file
(
'
folder2
'
)
}),
new
WorkspaceFolder
({
index
:
2
,
name
:
'
c
'
,
uri
:
URI
.
file
(
'
folder3
'
)
})]);
suite
(
'
AllKeysConfigurationChangeEvent
'
,
()
=>
{
const
configuration1
=
new
Configuration
(
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ResourceMap
<
ConfigurationModel
>
(),
new
ConfigurationModel
(),
new
ResourceMap
<
ConfigurationModel
>
(),
workspace
);
configuration1
.
updateDefaultConfiguration
(
defaultConfigurationModel
);
test
(
'
changeEvent affects keys for any resource
'
,
()
=>
{
configuration1
.
updateLocalUserConfiguration
(
toConfigurationModel
({
'
window.title
'
:
'
native
'
,
'
[typescript]
'
:
{
'
editor.insertSpaces
'
:
false
}
}));
const
configuraiton
=
new
Configuration
(
new
ConfigurationModel
({},
[
'
window.title
'
,
'
window.zoomLevel
'
,
'
window.restoreFullscreen
'
,
'
workbench.editor.enablePreview
'
,
'
window.restoreWindows
'
]),
configuration1
.
updateWorkspaceConfiguration
(
toConfigurationModel
({
'
editor.lineNumbers
'
:
'
on
'
}));
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ResourceMap
(),
new
ConfigurationModel
(),
new
ResourceMap
(),
null
!
);
configuration1
.
updateFolderConfiguration
(
URI
.
file
(
'
folder1
'
),
toConfigurationModel
({
'
editor.fontSize
'
:
14
}));
let
testObject
=
new
AllKeysConfigurationChangeEvent
(
configuraiton
,
ConfigurationTarget
.
USER
,
null
);
configuration1
.
updateFolderConfiguration
(
URI
.
file
(
'
folder2
'
),
toConfigurationModel
({
'
editor.wordWrap
'
:
'
on
'
}));
assert
.
deepEqual
(
testObject
.
affectedKeys
,
[
'
window.title
'
,
'
window.zoomLevel
'
,
'
window.restoreFullscreen
'
,
'
workbench.editor.enablePreview
'
,
'
window.restoreWindows
'
]);
const
configuration2
=
new
Configuration
(
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ResourceMap
<
ConfigurationModel
>
(),
new
ConfigurationModel
(),
new
ResourceMap
<
ConfigurationModel
>
(),
workspace
);
configuration2
.
updateDefaultConfiguration
(
defaultConfigurationModel
);
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.zoomLevel
'
));
configuration2
.
updateLocalUserConfiguration
(
toConfigurationModel
({
'
window.title
'
:
'
native
'
,
'
[typescript]
'
:
{
'
editor.insertSpaces
'
:
false
}
}));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.zoomLevel
'
,
URI
.
file
(
'
file1
'
)));
configuration2
.
updateWorkspaceConfiguration
(
toConfigurationModel
({
'
editor.lineNumbers
'
:
'
on
'
}));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.zoomLevel
'
,
URI
.
file
(
'
file2
'
)));
configuration2
.
updateFolderConfiguration
(
URI
.
file
(
'
folder1
'
),
toConfigurationModel
({
'
editor.fontSize
'
:
14
}));
configuration2
.
updateFolderConfiguration
(
URI
.
file
(
'
folder2
'
),
toConfigurationModel
({
'
editor.wordWrap
'
:
'
on
'
}));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreFullscreen
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreFullscreen
'
,
URI
.
file
(
'
file1
'
)));
const
actual
=
configuration2
.
compare
(
configuration1
);
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreFullscreen
'
,
URI
.
file
(
'
file2
'
)));
assert
.
deepEqual
(
actual
,
{
keys
:
[],
overrides
:
[]
});
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreWindows
'
));
});
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreWindows
'
,
URI
.
file
(
'
file2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.restoreWindows
'
,
URI
.
file
(
'
file1
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
'
file1
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window.title
'
,
URI
.
file
(
'
file2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
'
file1
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
window
'
,
URI
.
file
(
'
file2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor.enablePreview
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor.enablePreview
'
,
URI
.
file
(
'
file2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor.enablePreview
'
,
URI
.
file
(
'
file1
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor
'
));
test
(
'
Test compare different configurations
'
,
()
=>
{
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor
'
,
URI
.
file
(
'
file2
'
)));
const
workspace
=
new
Workspace
(
'
a
'
,
[
new
WorkspaceFolder
({
index
:
0
,
name
:
'
a
'
,
uri
:
URI
.
file
(
'
folder1
'
)
}),
new
WorkspaceFolder
({
index
:
1
,
name
:
'
b
'
,
uri
:
URI
.
file
(
'
folder2
'
)
}),
new
WorkspaceFolder
({
index
:
2
,
name
:
'
c
'
,
uri
:
URI
.
file
(
'
folder3
'
)
})]);
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench.editor
'
,
URI
.
file
(
'
file1
'
)));
const
configuration1
=
new
Configuration
(
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ResourceMap
<
ConfigurationModel
>
(),
new
ConfigurationModel
(),
new
ResourceMap
<
ConfigurationModel
>
(),
workspace
);
configuration1
.
updateDefaultConfiguration
(
defaultConfigurationModel
);
configuration1
.
updateLocalUserConfiguration
(
toConfigurationModel
({
'
window.title
'
:
'
native
'
,
'
[typescript]
'
:
{
'
editor.insertSpaces
'
:
false
}
}));
configuration1
.
updateWorkspaceConfiguration
(
toConfigurationModel
({
'
editor.lineNumbers
'
:
'
on
'
}));
configuration1
.
updateFolderConfiguration
(
URI
.
file
(
'
folder1
'
),
toConfigurationModel
({
'
editor.fontSize
'
:
14
}));
configuration1
.
updateFolderConfiguration
(
URI
.
file
(
'
folder2
'
),
toConfigurationModel
({
'
editor.wordWrap
'
:
'
on
'
}));
const
configuration2
=
new
Configuration
(
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ConfigurationModel
(),
new
ResourceMap
<
ConfigurationModel
>
(),
new
ConfigurationModel
(),
new
ResourceMap
<
ConfigurationModel
>
(),
workspace
);
configuration2
.
updateDefaultConfiguration
(
defaultConfigurationModel
);
configuration2
.
updateLocalUserConfiguration
(
toConfigurationModel
({
'
workbench.enableTabs
'
:
true
,
'
[typescript]
'
:
{
'
editor.insertSpaces
'
:
true
}
}));
configuration2
.
updateWorkspaceConfiguration
(
toConfigurationModel
({
'
editor.fontSize
'
:
11
}));
configuration2
.
updateFolderConfiguration
(
URI
.
file
(
'
folder1
'
),
toConfigurationModel
({
'
editor.insertSpaces
'
:
true
}));
configuration2
.
updateFolderConfiguration
(
URI
.
file
(
'
folder2
'
),
toConfigurationModel
({
'
[markdown]
'
:
{
'
editor.wordWrap
'
:
'
on
'
,
'
editor.lineNumbers
'
:
'
relative
'
},
}));
const
actual
=
configuration2
.
compare
(
configuration1
);
assert
.
deepEqual
(
actual
,
{
keys
:
[
'
editor.wordWrap
'
,
'
editor.fontSize
'
,
'
[markdown]
'
,
'
window.title
'
,
'
workbench.enableTabs
'
,
'
[typescript]
'
],
overrides
:
[[
'
markdown
'
,
[
'
editor.lineNumbers
'
,
'
editor.wordWrap
'
]],
[
'
typescript
'
,
[
'
editor.insertSpaces
'
]]]
});
});
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench
'
));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench
'
,
URI
.
file
(
'
file2
'
)));
assert
.
ok
(
testObject
.
affectsConfiguration
(
'
workbench
'
,
URI
.
file
(
'
file1
'
)));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
files
'
));
assert
.
ok
(
!
testObject
.
affectsConfiguration
(
'
files
'
,
URI
.
file
(
'
file1
'
)));
});
});
});
function
toConfigurationModel
(
obj
:
any
):
ConfigurationModel
{
const
parser
=
new
ConfigurationModelParser
(
'
test
'
);
parser
.
parseContent
(
JSON
.
stringify
(
obj
));
return
parser
.
configurationModel
;
}
src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts
浏览文件 @
33e545ee
...
@@ -608,7 +608,7 @@ suite('ExtHostConfiguration', function () {
...
@@ -608,7 +608,7 @@ suite('ExtHostConfiguration', function () {
createConfigurationData
({
createConfigurationData
({
'
farboo
'
:
{
'
farboo
'
:
{
'
config
'
:
false
,
'
config
'
:
false
,
'
updated
c
onfig
'
:
false
'
updated
C
onfig
'
:
false
}
}
}),
}),
new
NullLogService
()
new
NullLogService
()
...
@@ -617,16 +617,16 @@ suite('ExtHostConfiguration', function () {
...
@@ -617,16 +617,16 @@ suite('ExtHostConfiguration', function () {
const
newConfigData
=
createConfigurationData
({
const
newConfigData
=
createConfigurationData
({
'
farboo
'
:
{
'
farboo
'
:
{
'
config
'
:
false
,
'
config
'
:
false
,
'
updated
c
onfig
'
:
true
,
'
updated
C
onfig
'
:
true
,
'
newConfig
'
:
true
,
'
newConfig
'
:
true
,
}
}
});
});
const
configEventData
:
IConfigurationChange
=
{
keys
:
[
'
farboo.updatedConfig
'
],
overrides
:
[]
};
const
configEventData
:
IConfigurationChange
=
{
keys
:
[
'
farboo.updatedConfig
'
,
'
farboo.newConfig
'
],
overrides
:
[]
};
testObject
.
onDidChangeConfiguration
(
e
=>
{
testObject
.
onDidChangeConfiguration
(
e
=>
{
assert
.
deepEqual
(
testObject
.
getConfiguration
().
get
(
'
farboo
'
),
{
assert
.
deepEqual
(
testObject
.
getConfiguration
().
get
(
'
farboo
'
),
{
'
config
'
:
false
,
'
config
'
:
false
,
'
updated
c
onfig
'
:
true
,
'
updated
C
onfig
'
:
true
,
'
newConfig
'
:
true
,
'
newConfig
'
:
true
,
});
});
...
@@ -640,7 +640,7 @@ suite('ExtHostConfiguration', function () {
...
@@ -640,7 +640,7 @@ suite('ExtHostConfiguration', function () {
assert
.
ok
(
e
.
affectsConfiguration
(
'
farboo.newConfig
'
));
assert
.
ok
(
e
.
affectsConfiguration
(
'
farboo.newConfig
'
));
assert
.
ok
(
e
.
affectsConfiguration
(
'
farboo.newConfig
'
,
workspaceFolder
.
uri
));
assert
.
ok
(
e
.
affectsConfiguration
(
'
farboo.newConfig
'
,
workspaceFolder
.
uri
));
assert
.
ok
(
!
e
.
affectsConfiguration
(
'
farboo.newConfig
'
,
URI
.
file
(
'
any
'
)));
assert
.
ok
(
e
.
affectsConfiguration
(
'
farboo.newConfig
'
,
URI
.
file
(
'
any
'
)));
assert
.
ok
(
!
e
.
affectsConfiguration
(
'
farboo.config
'
));
assert
.
ok
(
!
e
.
affectsConfiguration
(
'
farboo.config
'
));
assert
.
ok
(
!
e
.
affectsConfiguration
(
'
farboo.config
'
,
workspaceFolder
.
uri
));
assert
.
ok
(
!
e
.
affectsConfiguration
(
'
farboo.config
'
,
workspaceFolder
.
uri
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录