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 / extensions / test / common / extensionManifestPropertiesService.test.ts 300 строк · изменён 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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
import assert from 'assert' ;
import { DisposableStore } from '../../../../../base/common/lifecycle.js' ;
import { isWeb } from '../../../../../base/common/platform.js' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js' ;
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js' ;
import { TestConfigurationService } from '../../../../../platform/configuration/test/common/testConfigurationService.js' ;
import { ExtensionUntrustedWorkspaceSupportType, IExtensionManifest } from '../../../../../platform/extensions/common/extensions.js' ;
import TestInstantiationService
NullLogService
IProductService
IWorkspaceTrustEnablementService
ExtensionManifestPropertiesService
TestProductService TestWorkspaceTrustEnablementService
disposables DisposableStore
testObject ExtensionManifestPropertiesService
disposables
testObject disposables TestProductService
disposables
assert testObject IExtensionManifest extensionDependencies isWeb
assert testObject IExtensionManifest extensionPack isWeb
assert testObject IExtensionManifest extensionPack extensionDependencies isWeb
assert testObject IExtensionManifest contributes something isWeb
assert testObject IExtensionManifest extensionPack contributes something isWeb
assert testObject IExtensionManifest
assert testObject IExtensionManifest browser
assert testObject IExtensionManifest main
assert testObject IExtensionManifest main browser isWeb
assert testObject IExtensionManifest main browser extensionKind isWeb
assert testObject IExtensionManifest browser
assert testObject IExtensionManifest extensionKind isWeb
testObject disposables TestProductService remote extensionKind
assert testObject IExtensionManifest browser publisher name
testObject disposables TestProductService remote extensionKind
assert testObject IExtensionManifest browser publisher name
assert testObject browser extensionKind
assert testObject main extensionKind
assert testObject main extensionKind
disposables DisposableStore
testConfigurationService TestConfigurationService
testObject ExtensionManifestPropertiesService
disposables
testConfigurationService
testObject
disposables
properties Partial IExtensionManifest IExtensionManifest
Object name publisher version properties IExtensionManifest
ExtensionManifestPropertiesService
disposables TestProductService testConfigurationService
testObject
assert
testObject contributes themes
testObject main contributes themes
testObject contributes commands
testConfigurationService
testObject
assert
testObject main contributes commands
testObject name contributes themes
isWeb
testObject ExtensionManifestPropertiesService
instantiationService TestInstantiationService
testConfigurationService TestConfigurationService
instantiationService
testConfigurationService
instantiationService IConfigurationService testConfigurationService
testObject
instantiationService
extensionManifest IExtensionManifest expected ExtensionUntrustedWorkspaceSupportType
testObject instantiationService ExtensionManifestPropertiesService
untrustedWorkspaceSupport testObject extensionManifest
assert untrustedWorkspaceSupport expected
properties IExtensionManifest
Object name publisher version properties IExtensionManifest
instantiationService IProductService
instantiationService IWorkspaceTrustEnablementService
extensionManifest
extensionManifest
instantiationService IProductService
instantiationService IWorkspaceTrustEnablementService
extensionManifest main
extensionManifest
instantiationService IProductService
instantiationService IWorkspaceTrustEnablementService
testConfigurationService supportUntrustedWorkspaces supported
extensionManifest main capabilities untrustedWorkspaces supported
extensionManifest
instantiationService IProductService
instantiationService IWorkspaceTrustEnablementService
testConfigurationService supportUntrustedWorkspaces supported
extensionManifest main capabilities untrustedWorkspaces supported
extensionManifest
instantiationService IProductService
instantiationService IWorkspaceTrustEnablementService
testConfigurationService supportUntrustedWorkspaces supported version
extensionManifest main capabilities untrustedWorkspaces supported
extensionManifest
instantiationService IProductService
instantiationService IWorkspaceTrustEnablementService
testConfigurationService supportUntrustedWorkspaces supported version
extensionManifest main capabilities untrustedWorkspaces supported
extensionManifest
instantiationService IProductService
instantiationService IWorkspaceTrustEnablementService
testConfigurationService supportUntrustedWorkspaces supported version
extensionManifest main capabilities untrustedWorkspaces supported
extensionManifest
instantiationService IProductService extensionUntrustedWorkspaceSupport
instantiationService IWorkspaceTrustEnablementService
extensionManifest main
extensionManifest
instantiationService IProductService extensionUntrustedWorkspaceSupport
instantiationService IWorkspaceTrustEnablementService
extensionManifest main
extensionManifest
instantiationService IProductService extensionUntrustedWorkspaceSupport override
instantiationService IWorkspaceTrustEnablementService
extensionManifest main capabilities untrustedWorkspaces supported
extensionManifest
instantiationService IProductService extensionUntrustedWorkspaceSupport override
instantiationService IWorkspaceTrustEnablementService
extensionManifest main capabilities untrustedWorkspaces supported
extensionManifest
instantiationService IProductService
instantiationService IWorkspaceTrustEnablementService
extensionManifest main capabilities untrustedWorkspaces supported
extensionManifest
instantiationService IProductService
instantiationService IWorkspaceTrustEnablementService
extensionManifest main
extensionManifest
{
}
from
'../../../../../platform/instantiation/test/common/instantiationServiceMock.js'
;
import
{
}
from
'../../../../../platform/log/common/log.js'
;
import
{
}
from
'../../../../../platform/product/common/productService.js'
;
import
{
}
from
'../../../../../platform/workspace/common/workspaceTrust.js'
;
import
{
EXTENSIONS_SUPPORT_AGENTS_WINDOW
,
}
from
'../../common/extensionManifestPropertiesService.js'
;
import
{
,
}
from
'../../../../test/common/workbenchTestServices.js'
;
suite
(
'ExtensionManifestPropertiesService - ExtensionKind'
,
(
)
=>
{
let
:
;
let
:
;
setup
(
(
)
=>
{
=
new
DisposableStore
(
)
;
=
.
add
(
new
ExtensionManifestPropertiesService
(
,
new
TestConfigurationService
(
)
,
new
TestWorkspaceTrustEnablementService
(
)
,
new
NullLogService
(
)
)
)
;
}
)
;
teardown
(
(
)
=>
{
.
dispose
(
)
;
}
)
;
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'declarative with extension dependencies'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
[
'ext1'
]
}
)
,
?
[
'workspace'
,
'web'
]
:
[
'workspace'
]
)
;
}
)
;
test
(
'declarative extension pack'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
[
'ext1'
,
'ext2'
]
}
)
,
?
[
'workspace'
,
'web'
]
:
[
'workspace'
]
)
;
}
)
;
test
(
'declarative extension pack and extension dependencies'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
[
'ext1'
,
'ext2'
]
,
:
[
'ext1'
,
'ext2'
]
}
)
,
?
[
'workspace'
,
'web'
]
:
[
'workspace'
]
)
;
}
)
;
test
(
'declarative with unknown contribution point => workspace, web in web and => workspace in desktop'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
<
any
>
{
'unknownPoint'
:
{
:
true
}
}
}
)
,
?
[
'workspace'
,
'web'
]
:
[
'workspace'
]
)
;
}
)
;
test
(
'declarative extension pack with unknown contribution point'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
[
'ext1'
,
'ext2'
]
,
:
<
any
>
{
'unknownPoint'
:
{
:
true
}
}
}
)
,
?
[
'workspace'
,
'web'
]
:
[
'workspace'
]
)
;
}
)
;
test
(
'simple declarative => ui, workspace, web'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
}
)
,
[
'ui'
,
'workspace'
,
'web'
]
)
;
}
)
;
test
(
'only browser => web'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
'main.browser.js'
}
)
,
[
'web'
]
)
;
}
)
;
test
(
'only main => workspace'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
'main.js'
}
)
,
[
'workspace'
]
)
;
}
)
;
test
(
'main and browser => workspace, web in web and workspace in desktop'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
'main.js'
,
:
'main.browser.js'
}
)
,
?
[
'workspace'
,
'web'
]
:
[
'workspace'
]
)
;
}
)
;
test
(
'browser entry point with workspace extensionKind => workspace, web in web and workspace in desktop'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
'main.js'
,
:
'main.browser.js'
,
:
[
'workspace'
]
}
)
,
?
[
'workspace'
,
'web'
]
:
[
'workspace'
]
)
;
}
)
;
test
(
'only browser entry point with out extensionKind => web'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
'main.browser.js'
}
)
,
[
'web'
]
)
;
}
)
;
test
(
'simple descriptive with workspace, ui extensionKind => workspace, ui, web in web and workspace, ui in desktop'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
[
'workspace'
,
'ui'
]
}
)
,
?
[
'workspace'
,
'ui'
,
'web'
]
:
[
'workspace'
,
'ui'
]
)
;
}
)
;
test
(
'opt out from web through settings even if it can run in web'
,
(
)
=>
{
=
.
add
(
new
ExtensionManifestPropertiesService
(
,
new
TestConfigurationService
(
{
:
{
:
{
'pub.a'
:
[
'-web'
]
}
}
}
)
,
new
TestWorkspaceTrustEnablementService
(
)
,
new
NullLogService
(
)
)
)
;
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
'main.browser.js'
,
:
'pub'
,
:
'a'
}
)
,
[
'ui'
,
'workspace'
]
)
;
}
)
;
test
(
'opt out from web and include only workspace through settings even if it can run in web'
,
(
)
=>
{
=
.
add
(
new
ExtensionManifestPropertiesService
(
,
new
TestConfigurationService
(
{
:
{
:
{
'pub.a'
:
[
'-web'
,
'workspace'
]
}
}
}
)
,
new
TestWorkspaceTrustEnablementService
(
)
,
new
NullLogService
(
)
)
)
;
.
deepStrictEqual
(
.
getExtensionKind
(
<
>
{
:
'main.browser.js'
,
:
'pub'
,
:
'a'
}
)
,
[
'workspace'
]
)
;
}
)
;
test
(
'extension cannot opt out from web'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
any
>
{
:
'main.browser.js'
,
:
[
'-web'
]
}
)
,
[
'web'
]
)
;
}
)
;
test
(
'extension cannot opt into web'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
any
>
{
:
'main.js'
,
:
[
'web'
,
'workspace'
,
'ui'
]
}
)
,
[
'workspace'
,
'ui'
]
)
;
}
)
;
test
(
'extension cannot opt into web only'
,
(
)
=>
{
.
deepStrictEqual
(
.
getExtensionKind
(
<
any
>
{
:
'main.js'
,
:
[
'web'
]
}
)
,
[
'workspace'
]
)
;
}
)
;
}
)
;
suite
(
'ExtensionManifestPropertiesService - SessionsWindowSupport'
,
(
)
=>
{
let
:
;
let
:
;
let
:
;
setup
(
(
)
=>
{
=
new
DisposableStore
(
)
;
=
new
TestConfigurationService
(
)
;
}
)
;
teardown
(
(
)
=>
{
.
dispose
(
)
;
.
dispose
(
)
;
}
)
;
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
function
getExtensionManifest
(
:
<
>
=
{
}
)
:
{
return
.
create
(
{
:
'a'
,
:
'pub'
,
:
'1.0.0'
,
...
}
)
as
;
}
function
createTestObject
(
)
:
{
return
.
add
(
new
ExtensionManifestPropertiesService
(
,
,
new
TestWorkspaceTrustEnablementService
(
)
,
new
NullLogService
(
)
)
)
;
}
test
(
'defaults to declarative extensions without executable code and supported contributions'
,
(
)
=>
{
=
createTestObject
(
)
;
.
deepStrictEqual
(
[
.
canExecuteOnSessionsWindow
(
getExtensionManifest
(
{
:
{
:
[
]
}
}
)
)
,
.
canExecuteOnSessionsWindow
(
getExtensionManifest
(
{
:
'./out/extension.js'
,
:
{
:
[
]
}
}
)
)
,
.
canExecuteOnSessionsWindow
(
getExtensionManifest
(
{
:
{
:
[
]
}
}
)
)
,
]
,
[
true
,
false
,
false
]
)
;
}
)
;
test
(
'uses configured sessions window support override'
,
async
(
)
=>
{
await
.
setUserConfiguration
(
EXTENSIONS_SUPPORT_AGENTS_WINDOW
,
{
'pub.a'
:
true
,
'pub.b'
:
false
}
)
;
=
createTestObject
(
)
;
.
deepStrictEqual
(
[
.
canExecuteOnSessionsWindow
(
getExtensionManifest
(
{
:
'./out/extension.js'
,
:
{
:
[
]
}
}
)
)
,
.
canExecuteOnSessionsWindow
(
getExtensionManifest
(
{
:
'b'
,
:
{
:
[
]
}
}
)
)
,
]
,
[
true
,
false
]
)
;
}
)
;
}
)
;
if
(
!
)
{
suite
(
'ExtensionManifestPropertiesService - ExtensionUntrustedWorkspaceSupportType'
,
(
)
=>
{
let
:
;
let
:
;
let
:
;
setup
(
async
(
)
=>
{
=
new
TestInstantiationService
(
)
;
=
new
TestConfigurationService
(
)
;
.
stub
(
,
)
;
}
)
;
teardown
(
(
)
=>
{
.
dispose
(
)
;
.
dispose
(
)
;
}
)
;
function
assertUntrustedWorkspaceSupport
(
:
,
:
)
:
void
{
=
.
createInstance
(
)
;
const
=
.
getExtensionUntrustedWorkspaceSupportType
(
)
;
.
strictEqual
(
,
)
;
}
function
getExtensionManifest
(
:
any
=
{
}
)
:
{
return
.
create
(
{
:
'a'
,
:
'pub'
,
:
'1.0.0'
,
...
}
)
as
;
}
test
(
'test extension workspace trust request when main entry point is missing'
,
(
)
=>
{
.
stub
(
,
{
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
const
=
getExtensionManifest
(
)
;
assertUntrustedWorkspaceSupport
(
,
true
)
;
}
)
;
test
(
'test extension workspace trust request when workspace trust is disabled'
,
async
(
)
=>
{
.
stub
(
,
{
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
false
)
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
}
)
;
assertUntrustedWorkspaceSupport
(
,
true
)
;
}
)
;
test
(
'test extension workspace trust request when "true" override exists in settings.json'
,
async
(
)
=>
{
.
stub
(
,
{
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
await
.
setUserConfiguration
(
'extensions'
,
{
:
{
'pub.a'
:
{
:
true
}
}
}
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
,
:
{
:
{
:
'limited'
}
}
}
)
;
assertUntrustedWorkspaceSupport
(
,
true
)
;
}
)
;
test
(
'test extension workspace trust request when override (false) exists in settings.json'
,
async
(
)
=>
{
.
stub
(
,
{
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
await
.
setUserConfiguration
(
'extensions'
,
{
:
{
'pub.a'
:
{
:
false
}
}
}
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
,
:
{
:
{
:
'limited'
}
}
}
)
;
assertUntrustedWorkspaceSupport
(
,
false
)
;
}
)
;
test
(
'test extension workspace trust request when override (true) for the version exists in settings.json'
,
async
(
)
=>
{
.
stub
(
,
{
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
await
.
setUserConfiguration
(
'extensions'
,
{
:
{
'pub.a'
:
{
:
true
,
:
'1.0.0'
}
}
}
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
,
:
{
:
{
:
'limited'
}
}
}
)
;
assertUntrustedWorkspaceSupport
(
,
true
)
;
}
)
;
test
(
'test extension workspace trust request when override (false) for the version exists in settings.json'
,
async
(
)
=>
{
.
stub
(
,
{
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
await
.
setUserConfiguration
(
'extensions'
,
{
:
{
'pub.a'
:
{
:
false
,
:
'1.0.0'
}
}
}
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
,
:
{
:
{
:
'limited'
}
}
}
)
;
assertUntrustedWorkspaceSupport
(
,
false
)
;
}
)
;
test
(
'test extension workspace trust request when override for a different version exists in settings.json'
,
async
(
)
=>
{
.
stub
(
,
{
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
await
.
setUserConfiguration
(
'extensions'
,
{
:
{
'pub.a'
:
{
:
true
,
:
'2.0.0'
}
}
}
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
,
:
{
:
{
:
'limited'
}
}
}
)
;
assertUntrustedWorkspaceSupport
(
,
'limited'
)
;
}
)
;
test
(
'test extension workspace trust request when default (true) exists in product.json'
,
(
)
=>
{
.
stub
(
,
{
:
{
'pub.a'
:
{
default
:
true
}
}
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
}
)
;
assertUntrustedWorkspaceSupport
(
,
true
)
;
}
)
;
test
(
'test extension workspace trust request when default (false) exists in product.json'
,
(
)
=>
{
.
stub
(
,
{
:
{
'pub.a'
:
{
default
:
false
}
}
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
}
)
;
assertUntrustedWorkspaceSupport
(
,
false
)
;
}
)
;
test
(
'test extension workspace trust request when override (limited) exists in product.json'
,
(
)
=>
{
.
stub
(
,
{
:
{
'pub.a'
:
{
:
'limited'
}
}
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
,
:
{
:
{
:
true
}
}
}
)
;
assertUntrustedWorkspaceSupport
(
,
'limited'
)
;
}
)
;
test
(
'test extension workspace trust request when override (false) exists in product.json'
,
(
)
=>
{
.
stub
(
,
{
:
{
'pub.a'
:
{
:
false
}
}
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
,
:
{
:
{
:
true
}
}
}
)
;
assertUntrustedWorkspaceSupport
(
,
false
)
;
}
)
;
test
(
'test extension workspace trust request when value exists in package.json'
,
(
)
=>
{
.
stub
(
,
{
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
,
:
{
:
{
:
'limited'
}
}
}
)
;
assertUntrustedWorkspaceSupport
(
,
'limited'
)
;
}
)
;
test
(
'test extension workspace trust request when no value exists in package.json'
,
(
)
=>
{
.
stub
(
,
{
}
)
;
.
stub
(
,
new
TestWorkspaceTrustEnablementService
(
)
)
;
const
=
getExtensionManifest
(
{
:
'./out/extension.js'
}
)
;
assertUntrustedWorkspaceSupport
(
,
false
)
;
}
)
;
}
)
;
}