Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
// Filter snippets based on resourceUri if provided
if
(
)
{
return
this
.
.
filter
(
=>
.
isFileIncluded
(
)
)
;
}
return
this
.
;
}
getSnippetFiles
(
)
:
any
{
throw
new
Error
(
)
;
}
isEnabled
(
)
:
boolean
{
throw
new
Error
(
)
;
}
updateEnablement
(
)
:
void
{
throw
new
Error
(
)
;
}
updateUsageTimestamp
(
:
)
:
void
{
throw
new
Error
(
)
;
}
}
suite
(
'SnippetsService'
,
function
(
)
{
const
:
=
{
:
.
}
;
let
:
;
let
:
;
let
:
;
let
:
;
setup
(
function
(
)
{
=
new
DisposableStore
(
)
;
=
createModelServices
(
)
;
=
.
get
(
)
;
.
add
(
.
registerLanguage
(
{
:
'fooLang'
,
:
[
'.fooLang'
,
]
}
)
)
;
=
new
SimpleSnippetService
(
[
new
Snippet
(
false
,
[
'fooLang'
]
,
'barTest'
,
'bar'
,
''
,
'barCodeSnippet'
,
''
,
.
,
generateUuid
(
)
)
,
new
Snippet
(
false
,
[
'fooLang'
]
,
'bazzTest'
,
'bazz'
,
''
,
'bazzCodeSnippet'
,
''
,
.
,
generateUuid
(
)
)
]
)
;
}
)
;
teardown
(
(
)
=>
{
.
dispose
(
)
;
}
)
;
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
async
function
asCompletionModel
(
:
,
:
,
:
,
:
=
)
{
const
=
await
.
provideCompletionItems
(
,
.
lift
(
)
,
)
;
const
=
new
CompletionModel
(
.
.
map
(
=>
{
return
new
CompletionItem
(
,
,
,
)
;
}
)
,
.
,
{
:
0
,
:
.
getLineContent
(
.
)
.
substring
(
0
,
.
-
1
)
}
,
.
,
.
.
,
.
.
,
undefined
)
;
return
;
}
test
(
'snippet completions - simple'
,
async
function
(
)
{
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
''
,
'fooLang'
)
)
;
await
.
provideCompletionItems
(
,
new
Position
(
1
,
1
)
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
,
undefined
)
;
.
strictEqual
(
.
.
,
2
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
1
)
,
)
;
.
strictEqual
(
.
.
,
2
)
;
}
)
;
test
(
'snippet completions - simple 2'
,
async
function
(
)
{
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
'hello '
,
'fooLang'
)
)
;
await
.
provideCompletionItems
(
,
new
Position
(
1
,
6
)
/* hello| */
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
,
undefined
)
;
.
strictEqual
(
.
.
,
0
)
;
}
)
;
await
.
provideCompletionItems
(
,
new
Position
(
1
,
7
)
/* hello |*/
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
,
undefined
)
;
.
strictEqual
(
.
.
,
2
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
6
)
/* hello| */
,
)
;
.
strictEqual
(
.
.
,
0
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
7
)
/* hello |*/
,
)
;
.
strictEqual
(
.
.
,
2
)
;
}
)
;
test
(
'snippet completions - with prefix'
,
async
function
(
)
{
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
'bar'
,
'fooLang'
)
)
;
await
.
provideCompletionItems
(
,
new
Position
(
1
,
4
)
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
,
undefined
)
;
.
strictEqual
(
.
.
,
1
)
;
.
deepStrictEqual
(
.
[
0
]
.
,
{
:
'bar'
,
:
'barTest'
}
)
;
.
strictEqual
(
(
.
[
0
]
.
as
)
.
.
,
1
)
;
.
strictEqual
(
.
[
0
]
.
,
'barCodeSnippet'
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
4
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
.
deepStrictEqual
(
.
[
0
]
.
.
,
{
:
'bar'
,
:
'barTest'
}
)
;
.
strictEqual
(
(
.
[
0
]
.
.
as
)
.
.
,
1
)
;
.
strictEqual
(
.
[
0
]
.
.
,
'barCodeSnippet'
)
;
}
)
;
test
(
'snippet completions - with different prefixes'
,
async
function
(
)
{
=
new
SimpleSnippetService
(
[
new
Snippet
(
false
,
[
'fooLang'
]
,
'barTest'
,
'bar'
,
''
,
's1'
,
''
,
.
,
generateUuid
(
)
)
,
new
Snippet
(
false
,
[
'fooLang'
]
,
'name'
,
'bar-bar'
,
''
,
's2'
,
''
,
.
,
generateUuid
(
)
)
]
)
;
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
'bar-bar'
,
'fooLang'
)
)
;
{
await
.
provideCompletionItems
(
,
new
Position
(
1
,
3
)
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
,
undefined
)
;
.
strictEqual
(
.
.
,
2
)
;
.
deepStrictEqual
(
.
[
0
]
.
,
{
:
'bar'
,
:
'barTest'
}
)
;
.
strictEqual
(
.
[
0
]
.
,
's1'
)
;
.
strictEqual
(
(
.
[
0
]
.
as
)
.
.
,
1
)
;
.
deepStrictEqual
(
.
[
1
]
.
,
{
:
'bar-bar'
,
:
'name'
}
)
;
.
strictEqual
(
.
[
1
]
.
,
's2'
)
;
.
strictEqual
(
(
.
[
1
]
.
as
)
.
.
,
1
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
3
)
,
)
;
.
strictEqual
(
.
.
,
2
)
;
.
deepStrictEqual
(
.
[
0
]
.
.
,
{
:
'bar'
,
:
'barTest'
}
)
;
.
strictEqual
(
.
[
0
]
.
.
,
's1'
)
;
.
strictEqual
(
(
.
[
0
]
.
.
as
)
.
.
,
1
)
;
.
deepStrictEqual
(
.
[
1
]
.
.
,
{
:
'bar-bar'
,
:
'name'
}
)
;
.
strictEqual
(
.
[
1
]
.
.
,
's2'
)
;
.
strictEqual
(
(
.
[
1
]
.
.
as
)
.
.
,
1
)
;
}
{
await
.
provideCompletionItems
(
,
new
Position
(
1
,
5
)
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
,
undefined
)
;
.
strictEqual
(
.
.
,
2
)
;
const
[
,
]
=
.
;
.
deepStrictEqual
(
.
,
{
:
'bar'
,
:
'barTest'
}
)
;
.
strictEqual
(
.
,
's1'
)
;
.
strictEqual
(
(
.
as
)
.
.
,
5
)
;
.
deepStrictEqual
(
.
,
{
:
'bar-bar'
,
:
'name'
}
)
;
.
strictEqual
(
.
,
's2'
)
;
.
strictEqual
(
(
.
as
)
.
.
,
1
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
5
)
,
)
;
.
strictEqual
(
.
.
,
2
)
;
const
[
,
]
=
.
.
map
(
=>
.
)
;
.
deepStrictEqual
(
.
,
{
:
'bar-bar'
,
:
'name'
}
)
;
.
strictEqual
(
.
,
's2'
)
;
.
strictEqual
(
(
.
as
)
.
.
,
1
)
;
.
deepStrictEqual
(
.
,
{
:
'bar'
,
:
'barTest'
}
)
;
.
strictEqual
(
.
,
's1'
)
;
.
strictEqual
(
(
.
as
)
.
.
,
5
)
;
}
{
await
.
provideCompletionItems
(
,
new
Position
(
1
,
6
)
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
,
undefined
)
;
.
strictEqual
(
.
.
,
2
)
;
.
deepStrictEqual
(
.
[
0
]
.
,
{
:
'bar'
,
:
'barTest'
}
)
;
.
strictEqual
(
.
[
0
]
.
,
's1'
)
;
.
strictEqual
(
(
.
[
0
]
.
as
)
.
.
,
5
)
;
.
deepStrictEqual
(
.
[
1
]
.
,
{
:
'bar-bar'
,
:
'name'
}
)
;
.
strictEqual
(
.
[
1
]
.
,
's2'
)
;
.
strictEqual
(
(
.
[
1
]
.
as
)
.
.
,
1
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
6
)
,
)
;
.
strictEqual
(
.
.
,
2
)
;
.
deepStrictEqual
(
.
[
0
]
.
.
,
{
:
'bar-bar'
,
:
'name'
}
)
;
.
strictEqual
(
.
[
0
]
.
.
,
's2'
)
;
.
strictEqual
(
(
.
[
0
]
.
.
as
)
.
.
,
1
)
;
.
deepStrictEqual
(
.
[
1
]
.
.
,
{
:
'bar'
,
:
'barTest'
}
)
;
.
strictEqual
(
.
[
1
]
.
.
,
's1'
)
;
.
strictEqual
(
(
.
[
1
]
.
.
as
)
.
.
,
5
)
;
}
}
)
;
test
(
'Cannot use "<?php" as user snippet prefix anymore, #26275'
,
async
function
(
)
{
=
new
SimpleSnippetService
(
[
new
Snippet
(
false
,
[
'fooLang'
]
,
''
,
'<?php'
,
''
,
'insert me'
,
''
,
.
,
generateUuid
(
)
)
]
)
;
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
let
=
instantiateTextModel
(
,
'\t<?php'
,
'fooLang'
)
;
await
.
provideCompletionItems
(
,
new
Position
(
1
,
7
)
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
.
,
1
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
7
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
.
dispose
(
)
;
=
instantiateTextModel
(
,
'\t<?'
,
'fooLang'
)
;
await
.
provideCompletionItems
(
,
new
Position
(
1
,
4
)
,
)
.
then
(
=>
{
.
strictEqual
(
.
.
,
1
)
;
.
strictEqual
(
(
.
[
0
]
.
as
)
.
.
,
2
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
4
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
.
strictEqual
(
(
.
[
0
]
.
.
as
)
.
.
,
2
)
;
.
dispose
(
)
;
=
instantiateTextModel
(
,
'a<?'
,
'fooLang'
)
;
await
.
provideCompletionItems
(
,
new
Position
(
1
,
4
)
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
.
,
1
)
;
.
strictEqual
(
(
.
[
0
]
.
as
)
.
.
,
2
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
4
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
.
strictEqual
(
(
.
[
0
]
.
.
as
)
.
.
,
2
)
;
.
dispose
(
)
;
}
)
;
test
(
'No user snippets in suggestions, when inside the code, #30508'
,
async
function
(
)
{
=
new
SimpleSnippetService
(
[
new
Snippet
(
false
,
[
'fooLang'
]
,
''
,
'foo'
,
''
,
'<foo>$0</foo>'
,
''
,
.
,
generateUuid
(
)
)
]
)
;
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
'<head>\n\t\n>/head>'
,
'fooLang'
)
)
;
await
.
provideCompletionItems
(
,
new
Position
(
1
,
1
)
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
.
,
1
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
1
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
await
.
provideCompletionItems
(
,
new
Position
(
2
,
2
)
,
)
.
then
(
=>
{
.
strictEqual
(
.
.
,
1
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
2
,
2
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
}
)
;
test
(
'SnippetSuggest - ensure extension snippets come last '
,
async
function
(
)
{
=
new
SimpleSnippetService
(
[
new
Snippet
(
false
,
[
'fooLang'
]
,
'second'
,
'second'
,
''
,
'second'
,
''
,
.
,
generateUuid
(
)
)
,
new
Snippet
(
false
,
[
'fooLang'
]
,
'first'
,
'first'
,
''
,
'first'
,
''
,
.
,
generateUuid
(
)
)
]
)
;
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
''
,
'fooLang'
)
)
;
await
.
provideCompletionItems
(
,
new
Position
(
1
,
1
)
,
)
!
.
then
(
=>
{
.
strictEqual
(
.
.
,
2
)
;
const
[
,
]
=
.
;
.
deepStrictEqual
(
.
,
{
:
'first'
,
:
'first'
}
)
;
.
deepStrictEqual
(
.
,
{
:
'second'
,
:
'second'
}
)
;
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
1
)
,
)
;
.
strictEqual
(
.
.
,
2
)
;
const
[
,
]
=
.
;
.
deepStrictEqual
(
.
.
,
{
:
'first'
,
:
'first'
}
)
;
.
deepStrictEqual
(
.
.
,
{
:
'second'
,
:
'second'
}
)
;
}
)
;
test
(
'Dash in snippets prefix broken #53945'
,
async
function
(
)
{
=
new
SimpleSnippetService
(
[
new
Snippet
(
false
,
[
'fooLang'
]
,
'p-a'
,
'p-a'
,
''
,
'second'
,
''
,
.
,
generateUuid
(
)
)
]
)
;
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
'p-'
,
'fooLang'
)
)
;
let
=
await
.
provideCompletionItems
(
,
new
Position
(
1
,
2
)
,
)
!
;
let
=
await
asCompletionModel
(
,
new
Position
(
1
,
2
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
.
strictEqual
(
.
.
,
1
)
;
=
await
.
provideCompletionItems
(
,
new
Position
(
1
,
3
)
,
)
!
;
=
await
asCompletionModel
(
,
new
Position
(
1
,
3
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
.
strictEqual
(
.
.
,
1
)
;
=
await
.
provideCompletionItems
(
,
new
Position
(
1
,
3
)
,
)
!
;
=
await
asCompletionModel
(
,
new
Position
(
1
,
3
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
.
strictEqual
(
.
.
,
1
)
;
}
)
;
test
(
'No snippets suggestion on long lines beyond character 100 #58807'
,
async
function
(
)
{
=
new
SimpleSnippetService
(
[
new
Snippet
(
false
,
[
'fooLang'
]
,
'bug'
,
'bug'
,
''
,
'second'
,
''
,
.
,
generateUuid
(
)
)
]
)
;
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
'Thisisaverylonglinegoingwithmore100bcharactersandthismakesintellisensebecomea Thisisaverylonglinegoingwithmore100bcharactersandthismakesintellisensebecomea b'
,
'fooLang'
)
)
;
const
=
await
.
provideCompletionItems
(
,
new
Position
(
1
,
158
)
,
)
!
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
158
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
.
strictEqual
(
.
.
,
1
)
;
}
)
;
test
(
'Type colon will trigger snippet #60746'
,
async
function
(
)
{
=
new
SimpleSnippetService
(
[
new
Snippet
(
false
,
[
'fooLang'
]
,
'bug'
,
'bug'
,
''
,
'second'
,
''
,
.
,
generateUuid
(
)
)
]
)
;
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
':'
,
'fooLang'
)
)
;
const
=
await
.
provideCompletionItems
(
,
new
Position
(
1
,
2
)
,
)
!
;
.
strictEqual
(
.
.
,
0
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
2
)
,
)
;
.
strictEqual
(
.
.
,
0
)
;
}
)
;
test
(
'substring of prefix can\'t trigger snippet #60737'
,
async
function
(
)
{
=
new
SimpleSnippetService
(
[
new
Snippet
(
false
,
[
'fooLang'
]
,
'mytemplate'
,
'mytemplate'
,
''
,
'second'
,
''
,
.
,
generateUuid
(
)
)
]
)
;
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
'template'
,
'fooLang'
)
)
;
const
=
await
.
provideCompletionItems
(
,
new
Position
(
1
,
9
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
.
deepStrictEqual
(
.
[
0
]
.
,
{
:
'mytemplate'
,
:
'mytemplate'
}
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
9
)
,
)
;
.
strictEqual
(
.
.
,
0
)
;
}
)
;
test
(
'No snippets suggestion beyond character 100 if not at end of line #60247'
,
async
function
(
)
{
=
new
SimpleSnippetService
(
[
new
Snippet
(
false
,
[
'fooLang'
]
,
'bug'
,
'bug'
,
''
,
'second'
,
''
,
.
,
generateUuid
(
)
)
]
)
;
const
=
new
SnippetCompletionProvider
(
,
,
.
add
(
new
TestLanguageConfigurationService
(
)
)
)
;
const
=
.
add
(
instantiateTextModel
(
,
'Thisisaverylonglinegoingwithmore100bcharactersandthismakesintellisensebecomea Thisisaverylonglinegoingwithmore100bcharactersandthismakesintellisensebecomea b text_after_b'
,
'fooLang'
)
)
;
const
=
await
.
provideCompletionItems
(
,
new
Position
(
1
,
158
)
,
)
!
;
.
strictEqual
(
.
.
,
1
)
;
const
=
await
asCompletionModel
(
,
new
Position
(
1
,
158
)
,
)
;
.
strictEqual
(
.
.
,
1
)
;
}
)
;
test
(
'issue #61296: VS code freezes when editing CSS fi`le with emoji'