ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / services / configuration / test / common / configurationModels.test.ts 219 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
import assert from 'assert' ;
import { Registry } from '../../../../../platform/registry/common/platform.js' ;
import { StandaloneConfigurationModelParser, Configuration } from '../../common/configurationModels.js' ;
import { ConfigurationModelParser, ConfigurationModel, ConfigurationParseOptions } from '../../../../../platform/configuration/common/configurationModels.js' ;
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from '../../../../../platform/configuration/common/configurationRegistry.js' ;
import { ResourceMap } from '../../../../../base/common/map.js' ;
import { WorkspaceFolder
Workspace
ensureNoDisposablesAreLeakedInTestSuite
NullLogService
configurationRegistry Registry ConfigurationExtensions Configuration
configurationRegistry
scope ConfigurationScope
scope ConfigurationScope
scope ConfigurationScope
scope ConfigurationScope
testObject
testObject scopes ConfigurationScope ConfigurationScope
expected Object
expected Object
expected
expected
assert testObject configurationModel contents expected
testObject
testObject scopes ConfigurationScope
expected Object
expected Object
expected
assert testObject configurationModel contents expected
testObject
testObject scopes ConfigurationScope ConfigurationScope
expected Object
expected Object
expected
expected
assert testObject configurationModel overrides expected
parseOptions ConfigurationParseOptions scopes ConfigurationScope ConfigurationScope
testObject
testObject parseOptions
expected Object
expected Object
expected
expected
assert testObject configurationModel contents expected
configurationRegistry Registry ConfigurationExtensions Configuration
configurationRegistry
scope ConfigurationScope
scope ConfigurationScope
testObject parseOptions
expected Object
expected Object
expected
assert testObject configurationModel contents expected
testObject
testObject
expected Object
expected Object
expected
expected
assert testObject configurationModel contents expected
defaultConfigurationModel
workspace index name uri index name uri index name uri
configuration1 ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel workspace
configuration1 defaultConfigurationModel
configuration1
configuration1
configuration1
configuration1
configuration2 ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel workspace
configuration2 defaultConfigurationModel
configuration2
configuration2
configuration2
configuration2
actual configuration2 configuration1
assert actual keys overrides
workspace index name uri index name uri index name uri
configuration1 ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel workspace
configuration1 defaultConfigurationModel
configuration1
configuration1
configuration1
configuration1
configuration2 ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel workspace
configuration2 defaultConfigurationModel
configuration2
configuration2
configuration2
configuration2
actual configuration2 configuration1
assert actual keys overrides
obj Record ConfigurationModel
parser
parser obj
parser configurationModel
}
from
'../../../../../platform/workspace/common/workspace.js'
;
import
{
URI
}
from
'../../../../../base/common/uri.js'
;
import
{
}
from
'../../../../../platform/workspace/test/common/testWorkspace.js'
;
import
{
}
from
'../../../../../base/test/common/utils.js'
;
import
{
}
from
'../../../../../platform/log/common/log.js'
;
suite
(
'FolderSettingsModelParser'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
suiteSetup
(
(
)
=>
{
const
=
.
as < IConfigurationRegistry>
(
.
)
;
.
registerConfiguration
(
{
'id'
:
'FolderSettingsModelParser_1'
,
'type'
:
'object'
,
'properties'
:
{
'FolderSettingsModelParser.window'
:
{
'type'
:
'string'
,
'default'
:
'isSet'
}
,
'FolderSettingsModelParser.resource'
:
{
'type'
:
'string'
,
'default'
:
'isSet'
,
:
.
RESOURCE
,
}
,
'FolderSettingsModelParser.resourceLanguage'
:
{
'type'
:
'string'
,
'default'
:
'isSet'
,
:
.
LANGUAGE_OVERRIDABLE
,
}
,
'FolderSettingsModelParser.application'
:
{
'type'
:
'string'
,
'default'
:
'isSet'
,
:
.
APPLICATION
}
,
'FolderSettingsModelParser.machine'
:
{
'type'
:
'string'
,
'default'
:
'isSet'
,
:
.
MACHINE
}
}
}
)
;
}
)
;
test
(
'parse all folder settings'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'settings'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'FolderSettingsModelParser.window'
:
'window'
,
'FolderSettingsModelParser.resource'
:
'resource'
,
'FolderSettingsModelParser.application'
:
'application'
,
'FolderSettingsModelParser.machine'
:
'executable'
}
)
,
{
:
[
.
RESOURCE
,
.
WINDOW
]
}
)
;
const
=
.
create
(
null
)
;
[
'FolderSettingsModelParser'
]
=
.
create
(
null
)
;
[
'FolderSettingsModelParser'
]
[
'window'
]
=
'window'
;
[
'FolderSettingsModelParser'
]
[
'resource'
]
=
'resource'
;
.
deepStrictEqual
(
.
.
,
)
;
}
)
;
test
(
'parse resource folder settings'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'settings'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'FolderSettingsModelParser.window'
:
'window'
,
'FolderSettingsModelParser.resource'
:
'resource'
,
'FolderSettingsModelParser.application'
:
'application'
,
'FolderSettingsModelParser.machine'
:
'executable'
}
)
,
{
:
[
.
RESOURCE
]
}
)
;
const
=
.
create
(
null
)
;
[
'FolderSettingsModelParser'
]
=
.
create
(
null
)
;
[
'FolderSettingsModelParser'
]
[
'resource'
]
=
'resource'
;
.
deepStrictEqual
(
.
.
,
)
;
}
)
;
test
(
'parse resource and resource language settings'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'settings'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'[json]'
:
{
'FolderSettingsModelParser.window'
:
'window'
,
'FolderSettingsModelParser.resource'
:
'resource'
,
'FolderSettingsModelParser.resourceLanguage'
:
'resourceLanguage'
,
'FolderSettingsModelParser.application'
:
'application'
,
'FolderSettingsModelParser.machine'
:
'executable'
}
}
)
,
{
:
[
.
RESOURCE
,
.
LANGUAGE_OVERRIDABLE
]
}
)
;
const
=
.
create
(
null
)
;
[
'FolderSettingsModelParser'
]
=
.
create
(
null
)
;
[
'FolderSettingsModelParser'
]
[
'resource'
]
=
'resource'
;
[
'FolderSettingsModelParser'
]
[
'resourceLanguage'
]
=
'resourceLanguage'
;
.
deepStrictEqual
(
.
.
,
[
{
'contents'
:
,
'identifiers'
:
[
'json'
]
,
'keys'
:
[
'FolderSettingsModelParser.resource'
,
'FolderSettingsModelParser.resourceLanguage'
]
}
]
)
;
}
)
;
test
(
'reparse folder settings excludes application and machine setting'
,
(
)
=>
{
const
:
=
{
:
[
.
RESOURCE
,
.
WINDOW
]
}
;
const
=
new
ConfigurationModelParser
(
'settings'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'FolderSettingsModelParser.resource'
:
'resource'
,
'FolderSettingsModelParser.anotherApplicationSetting'
:
'executable'
}
)
,
)
;
let
=
.
create
(
null
)
;
[
'FolderSettingsModelParser'
]
=
.
create
(
null
)
;
[
'FolderSettingsModelParser'
]
[
'resource'
]
=
'resource'
;
[
'FolderSettingsModelParser'
]
[
'anotherApplicationSetting'
]
=
'executable'
;
.
deepStrictEqual
(
.
.
,
)
;
const
=
.
as < IConfigurationRegistry>
(
.
)
;
.
registerConfiguration
(
{
'id'
:
'FolderSettingsModelParser_2'
,
'type'
:
'object'
,
'properties'
:
{
'FolderSettingsModelParser.anotherApplicationSetting'
:
{
'type'
:
'string'
,
'default'
:
'isSet'
,
:
.
APPLICATION
}
,
'FolderSettingsModelParser.anotherMachineSetting'
:
{
'type'
:
'string'
,
'default'
:
'isSet'
,
:
.
MACHINE
}
}
}
)
;
.
reparse
(
)
;
=
.
create
(
null
)
;
[
'FolderSettingsModelParser'
]
=
.
create
(
null
)
;
[
'FolderSettingsModelParser'
]
[
'resource'
]
=
'resource'
;
.
deepStrictEqual
(
.
.
,
)
;
}
)
;
}
)
;
suite
(
'StandaloneConfigurationModelParser'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'parse tasks stand alone configuration model'
,
(
)
=>
{
const
=
new
StandaloneConfigurationModelParser
(
'tasks'
,
'tasks'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'version'
:
'1.1.1'
,
'tasks'
:
[
]
}
)
)
;
const
=
.
create
(
null
)
;
[
'tasks'
]
=
.
create
(
null
)
;
[
'tasks'
]
[
'version'
]
=
'1.1.1'
;
[
'tasks'
]
[
'tasks'
]
=
[
]
;
.
deepStrictEqual
(
.
.
,
)
;
}
)
;
}
)
;
suite
(
'Workspace Configuration'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
const
=
toConfigurationModel
(
{
'editor.lineNumbers'
:
'on'
,
'editor.fontSize'
:
12
,
'window.zoomLevel'
:
1
,
'[markdown]'
:
{
'editor.wordWrap'
:
'off'
}
,
'window.title'
:
'custom'
,
'workbench.enableTabs'
:
false
,
'editor.insertSpaces'
:
true
}
)
;
test
(
'Test compare same configurations'
,
(
)
=>
{
const
=
new
Workspace
(
'a'
,
[
new
WorkspaceFolder
(
{
:
0
,
:
'a'
,
:
URI
.
file
(
'folder1'
)
}
)
,
new
WorkspaceFolder
(
{
:
1
,
:
'b'
,
:
URI
.
file
(
'folder2'
)
}
)
,
new
WorkspaceFolder
(
{
:
2
,
:
'c'
,
:
URI
.
file
(
'folder3'
)
}
)
]
)
;
const
=
new
Configuration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
new
ResourceMap< ConfigurationModel>
(
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
new
ResourceMap< ConfigurationModel>
(
)
,
,
new
NullLogService
(
)
)
;
.
updateDefaultConfiguration
(
)
;
.
updateLocalUserConfiguration
(
toConfigurationModel
(
{
'window.title'
:
'native'
,
'[typescript]'
:
{
'editor.insertSpaces'
:
false
}
}
)
)
;
.
updateWorkspaceConfiguration
(
toConfigurationModel
(
{
'editor.lineNumbers'
:
'on'
}
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'folder1'
)
,
toConfigurationModel
(
{
'editor.fontSize'
:
14
}
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'folder2'
)
,
toConfigurationModel
(
{
'editor.wordWrap'
:
'on'
}
)
)
;
const
=
new
Configuration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
new
ResourceMap< ConfigurationModel>
(
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
new
ResourceMap< ConfigurationModel>
(
)
,
,
new
NullLogService
(
)
)
;
.
updateDefaultConfiguration
(
)
;
.
updateLocalUserConfiguration
(
toConfigurationModel
(
{
'window.title'
:
'native'
,
'[typescript]'
:
{
'editor.insertSpaces'
:
false
}
}
)
)
;
.
updateWorkspaceConfiguration
(
toConfigurationModel
(
{
'editor.lineNumbers'
:
'on'
}
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'folder1'
)
,
toConfigurationModel
(
{
'editor.fontSize'
:
14
}
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'folder2'
)
,
toConfigurationModel
(
{
'editor.wordWrap'
:
'on'
}
)
)
;
const
=
.
compare
(
)
;
.
deepStrictEqual
(
,
{
:
[
]
,
:
[
]
}
)
;
}
)
;
test
(
'Test compare different configurations'
,
(
)
=>
{
const
=
new
Workspace
(
'a'
,
[
new
WorkspaceFolder
(
{
:
0
,
:
'a'
,
:
URI
.
file
(
'folder1'
)
}
)
,
new
WorkspaceFolder
(
{
:
1
,
:
'b'
,
:
URI
.
file
(
'folder2'
)
}
)
,
new
WorkspaceFolder
(
{
:
2
,
:
'c'
,
:
URI
.
file
(
'folder3'
)
}
)
]
)
;
const
=
new
Configuration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
new
ResourceMap< ConfigurationModel>
(
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
new
ResourceMap< ConfigurationModel>
(
)
,
,
new
NullLogService
(
)
)
;
.
updateDefaultConfiguration
(
)
;
.
updateLocalUserConfiguration
(
toConfigurationModel
(
{
'window.title'
:
'native'
,
'[typescript]'
:
{
'editor.insertSpaces'
:
false
}
}
)
)
;
.
updateWorkspaceConfiguration
(
toConfigurationModel
(
{
'editor.lineNumbers'
:
'on'
}
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'folder1'
)
,
toConfigurationModel
(
{
'editor.fontSize'
:
14
}
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'folder2'
)
,
toConfigurationModel
(
{
'editor.wordWrap'
:
'on'
}
)
)
;
const
=
new
Configuration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
new
ResourceMap< ConfigurationModel>
(
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
new
ResourceMap< ConfigurationModel>
(
)
,
,
new
NullLogService
(
)
)
;
.
updateDefaultConfiguration
(
)
;
.
updateLocalUserConfiguration
(
toConfigurationModel
(
{
'workbench.enableTabs'
:
true
,
'[typescript]'
:
{
'editor.insertSpaces'
:
true
}
}
)
)
;
.
updateWorkspaceConfiguration
(
toConfigurationModel
(
{
'editor.fontSize'
:
11
}
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'folder1'
)
,
toConfigurationModel
(
{
'editor.insertSpaces'
:
true
}
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'folder2'
)
,
toConfigurationModel
(
{
'[markdown]'
:
{
'editor.wordWrap'
:
'on'
,
'editor.lineNumbers'
:
'relative'
}
,
}
)
)
;
const
=
.
compare
(
)
;
.
deepStrictEqual
(
,
{
:
[
'editor.wordWrap'
,
'editor.fontSize'
,
'[markdown]'
,
'window.title'
,
'workbench.enableTabs'
,
'[typescript]'
]
,
:
[
[
'markdown'
,
[
'editor.lineNumbers'
,
'editor.wordWrap'
]
]
,
[
'typescript'
,
[
'editor.insertSpaces'
]
]
]
}
)
;
}
)
;
}
)
;
function
toConfigurationModel
(
:
<
string
,
unknown
>
)
:
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
)
)
;
return
.
;
}