Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
// Insert line break markers again, according to algorithm
let
=
''
;
if
(
)
{
let
=
0
;
for
(
let
=
0
,
=
.
;
<
;
++
)
{
const
=
.
translateToOutputPosition
(
)
;
if
(
!==
.
)
{
=
.
;
+=
'|'
;
}
+=
.
charAt
(
)
;
}
}
else
{
// No wrapping
=
;
}
return
;
}
function
getLineBreakData
(
:
,
:
number
,
:
number
,
:
number
,
:
,
:
'normal'
|
'keepAll'
,
:
boolean
,
:
string
,
:
|
null
,
:
[
]
|
null
=
null
)
:
|
null
{
const
=
new
FontInfo
(
{
:
1
,
:
'testFontFamily'
,
:
'normal'
,
:
14
,
:
''
,
:
''
,
:
19
,
:
0
,
:
true
,
:
7
,
:
7
*
,
:
true
,
:
7
,
:
7
,
:
7
,
:
7
}
,
false
)
;
const
:
=
{
getLineContent
(
:
number
)
{
return
;
}
,
getLineInjectedText
(
)
{
return
;
}
}
;
const
=
.
createLineBreaksComputer
(
,
,
,
,
,
,
)
;
const
=
?
new
ModelLineProjectionData
(
null
,
null
,
.
.
slice
(
0
)
,
.
.
slice
(
0
)
,
.
)
:
null
;
.
addRequest
(
1
,
)
;
return
.
finalize
(
)
[
0
]
;
}
function
assertLineBreaks
(
:
,
:
number
,
:
number
,
:
string
,
=
.
,
:
'normal'
|
'keepAll'
=
'normal'
)
:
|
null
{
// Create version of `annotatedText` with line break markers removed
const
=
parseAnnotatedText
(
)
.
;
const
=
getLineBreakData
(
,
,
,
2
,
,
,
false
,
,
null
)
;
const
=
toAnnotatedText
(
,
)
;
.
strictEqual
(
,
)
;
return
;
}
suite
(
'Editor ViewModel - MonospaceLineBreaksComputer'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'MonospaceLineBreaksComputer'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
'('
,
'\t).'
)
;
// Empty string
assertLineBreaks
(
,
4
,
5
,
''
)
;
// No wrapping if not necessary
assertLineBreaks
(
,
4
,
5
,
'aaa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aaaaa'
)
;
assertLineBreaks
(
,
4
,
-
1
,
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
)
;
// Acts like hard wrapping if no char found
assertLineBreaks
(
,
4
,
5
,
'aaaaa|a'
)
;
// Honors wrapping character
assertLineBreaks
(
,
4
,
5
,
'aaaaa|.'
)
;
assertLineBreaks
(
,
4
,
5
,
'aaaaa|a.|aaa.|aa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aaaaa|a..|aaa.|aa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aaaaa|a...|aaa.|aa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aaaaa|a....|aaa.|aa'
)
;
// Honors tabs when computing wrapping position
assertLineBreaks
(
,
4
,
5
,
'\t'
)
;
assertLineBreaks
(
,
4
,
5
,
'\t|aaa'
)
;
assertLineBreaks
(
,
4
,
5
,
'\t|a\t|aa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aa\ta'
)
;
assertLineBreaks
(
,
4
,
5
,
'aa\t|aa'
)
;
// Honors wrapping before characters (& gives it priority)
assertLineBreaks
(
,
4
,
5
,
'aaa.|aa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aaa(.|aa'
)
;
// Honors wrapping after characters (& gives it priority)
assertLineBreaks
(
,
4
,
5
,
'aaa))|).aaa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aaa))|).|aaaa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aaa)|().|aaa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aaa|(().|aaa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aa.|(().|aaa'
)
;
assertLineBreaks
(
,
4
,
5
,
'aa.|(.).|aaa'
)
;
}
)
;
test
(
'accounts for fixed injected text width when wrapping'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
5
,
2
,
.
,
'normal'
,
false
,
'abcdef'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
5
,
{
:
'\xa0'
,
:
1
}
,
0
)
]
)
;
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
4
,
7
]
,
:
[
4
,
7
]
}
)
;
}
)
;
test
(
'treats multi-character fixed-width injected text as an atomic span'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
5
,
2
,
.
,
'normal'
,
false
,
'abcdef'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
4
,
{
:
'hello'
,
:
1
}
,
0
)
]
)
;
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
8
,
11
]
,
:
[
8
,
11
]
}
)
;
}
)
;
test
(
'wraps after an escaped line feed followed by fixed-width injected text'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
100
,
2
,
.
,
'normal'
,
true
,
'"a\\nb"'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
5
,
{
:
'hint'
,
:
1
}
,
0
)
]
)
;
.
deepStrictEqual
(
?.
,
[
4
,
10
]
)
;
}
)
;
test
(
'treats adjacent fixed-width injected texts as separate atomic spans'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
5
,
2
,
.
,
'normal'
,
false
,
'abcdef'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
4
,
{
:
'x'
,
:
0.5
}
,
0
)
,
new
LineInjectedText
(
0
,
1
,
4
,
{
:
'y'
,
:
1
}
,
1
)
]
)
;
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
4
,
8
]
,
:
[
4
,
8
]
}
)
;
}
)
;
test
(
'keeps fixed-width injected text wider than the wrap column atomic'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
5
,
2
,
.
,
'normal'
,
false
,
'abcdef'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
4
,
{
:
'x'
,
:
3
}
,
0
)
]
)
;
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
3
,
4
,
7
]
,
:
[
3
,
4
,
7
]
}
)
;
}
)
;
test
(
'wraps before a tab that no longer fits after fixed-width injected text'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
4
,
2
,
.
,
'normal'
,
false
,
'ab\tcd'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
3
,
{
:
'\xa0'
,
:
0.75
}
,
0
)
]
)
;
// `ab` plus a 0.75em wide injection fills 2.75 columns worth of pixels, so the tab (which
// expands from character column 3 to character column 4) no longer fits and the line wraps
// right before it.
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
3
,
6
]
,
:
[
3
,
6
]
}
)
;
}
)
;
test
(
'expands a tab following fixed-width injected text from the character column'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
10
,
2
,
.
,
'normal'
,
false
,
'ab\tcdefgh'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
3
,
{
:
'\xa0'
,
:
1.5
}
,
0
)
]
)
;
// The injection counts as a single character column, so the tab at character column 3 expands
// to character column 4 and the whole line spans 10 columns. Its 1.5em is spent on the wrapping
// decision alone, which runs out of room at `g`. Were that width to leak into the column
// accumulator, the injection would count as 3 columns, the tab would expand to character
// column 8, and the line would already run out of room at `e`.
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
8
,
10
]
,
:
[
8
,
10
]
}
)
;
}
)
;
test
(
'reserves width for a spacing-only injection at the beginning of a line'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
6
,
2
,
.
,
'normal'
,
false
,
'abcdef'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
1
,
{
:
''
,
:
1
}
,
0
)
]
)
;
// 1em is two columns wide here, so the spacer pushes the last two characters onto a second
// line. It consumes no character, so the offsets still refer to the original text.
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
4
,
6
]
,
:
[
4
,
6
]
}
)
;
}
)
;
test
(
'does not create empty lines for oversized spacing-only injected text'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
2
,
2
,
.
,
'normal'
,
false
,
'abc'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
1
,
{
:
''
,
:
2
}
,
0
)
]
)
;
// The spacer alone already overflows the wrap width, but there is no character before it to
// wrap, so it must share the first line with `a` rather than emit an empty leading line.
.
deepStrictEqual
(
?.
,
[
1
,
3
]
)
;
}
)
;
test
(
'lets a spacing-only injection in the middle of a line inherit surrounding break opportunities'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
' '
)
;
const
=
getLineBreakData
(
,
4
,
8
,
2
,
.
,
'normal'
,
false
,
'ab cdef'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
4
,
{
:
''
,
:
1
}
,
0
)
]
)
;
// The spacer is transparent for break opportunities: it neither creates nor suppresses one, so
// the break after the space is still recorded even though the spacer sits on top of it, and the
// line breaks there rather than at `f` where it runs out of room. Its 1em is what makes the line
// run out of room at all: without it the seven characters fit in the eight available columns.
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
3
,
7
]
,
:
[
3
,
7
]
}
)
;
}
)
;
test
(
'ignores a spacing-only injection at the end of a line'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
6
,
2
,
.
,
'normal'
,
false
,
'abcdef'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
7
,
{
:
''
,
:
1
}
,
0
)
]
)
;
// The line is exactly full, and there is no character after the spacer that could be moved to a
// following line, so the spacer cannot introduce a break.
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
6
]
,
:
[
6
]
}
)
;
}
)
;
test
(
'expands a tab following a spacing-only injection from the character column'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
6
,
2
,
.
,
'normal'
,
false
,
'ab\tcd'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
3
,
{
:
''
,
:
1
}
,
0
)
]
)
;
// The spacer occupies no character column, so the tab still expands from character column 2 to
// character column 4. Were its 1em width to leak into the column accumulator, the tab would
// start at character column 4 and expand to character column 8 instead.
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
3
,
5
]
,
:
[
4
,
6
]
}
)
;
}
)
;
test
(
'does not use fixed-width injected whitespace as continuation indentation'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
''
,
''
)
;
const
=
getLineBreakData
(
,
4
,
5
,
2
,
.
,
'normal'
,
false
,
'abcdef'
,
null
,
[
new
LineInjectedText
(
0
,
1
,
1
,
{
:
' '
,
:
0.75
}
,
0
)
]
)
;
.
deepStrictEqual
(
{
:
?.
,
:
?.
}
,
{
:
[
4
,
7
]
,
:
0
}
)
;
}
)
;
function
assertLineBreakDataEqual
(
:
|
null
,
:
|
null
)
:
void
{
if
(
!
||
!
)
{
.
deepStrictEqual
(
,
)
;
return
;
}
.
deepStrictEqual
(
.
,
.
)
;
.
deepStrictEqual
(
.
,
.
)
;
for
(
let
=
0
;
<
.
.
;
++
)
{
const
=
.
abs
(
.
[
]
-
.
[
]
)
;
.
ok
(
<
0.001
)
;
}
}
function
assertIncrementalLineBreaks
(
:
,
:
string
,
:
number
,
:
number
,
:
string
,
:
number
,
:
string
,
=
.
,
:
number
=
2
)
:
void
{
// sanity check the test
.
strictEqual
(
,
parseAnnotatedText
(
)
.
)
;
.
strictEqual
(
,
parseAnnotatedText
(
)
.
)
;
// check that the direct mapping is ok for 1
const
=
getLineBreakData
(
,
,
,
,
,
'normal'
,
false
,
,
null
)
;
.
strictEqual
(
toAnnotatedText
(
,
)
,
)
;
// check that the direct mapping is ok for 2
const
=
getLineBreakData
(
,
,
,
,
,
'normal'
,
false
,
,
null
)
;
.
strictEqual
(
toAnnotatedText
(
,
)
,
)
;
// check that going from 1 to 2 is ok
const
=
getLineBreakData
(
,
,
,
,
,
'normal'
,
false
,
,
)
;
.
strictEqual
(
toAnnotatedText
(
,
)
,
)
;
assertLineBreakDataEqual
(
,
)
;
// check that going from 2 to 1 is ok
const
=
getLineBreakData
(
,
,
,
,
,
'normal'
,
false
,
,
)
;
.
strictEqual
(
toAnnotatedText
(
,
)
,
)
;
assertLineBreakDataEqual
(
,
)
;
}
test
(
'MonospaceLineBreaksComputer incremental 1'
,
(
)
=>
{
const
=
new
MonospaceLineBreaksComputerFactory
(
.
.
,
.
.
)
;
assertIncrementalLineBreaks
(
,
'just some text and more'
,
4
,
10
,
'just some |text and |more'
,
15
,
'just some text |and more'
)
;
assertIncrementalLineBreaks
(
,
'Cu scripserit suscipiantur eos, in affert pericula contentiones sed, cetero sanctus et pro. Ius vidit magna regione te, sit ei elaboraret liberavisse. Mundi verear eu mea, eam vero scriptorem in, vix in menandri assueverit. Natum definiebas cu vim. Vim doming vocibus efficiantur id. In indoctum deseruisse voluptatum vim, ad debitis verterem sed.'
,
4
,
47
,
'Cu scripserit suscipiantur eos, in affert |pericula contentiones sed, cetero sanctus et |pro. Ius vidit magna regione te, sit ei |elaboraret liberavisse. Mundi verear eu mea, |eam vero scriptorem in, vix in menandri |assueverit. Natum definiebas cu vim. Vim |doming vocibus efficiantur id. In indoctum |deseruisse voluptatum vim, ad debitis verterem |sed.'
,
142
,
'Cu scripserit suscipiantur eos, in affert pericula contentiones sed, cetero sanctus et pro. Ius vidit magna regione te, sit ei elaboraret |liberavisse. Mundi verear eu mea, eam vero scriptorem in, vix in menandri assueverit. Natum definiebas cu vim. Vim doming vocibus efficiantur |id. In indoctum deseruisse voluptatum vim, ad debitis verterem sed.'
,
)
;
assertIncrementalLineBreaks
(
,
'An his legere persecuti, oblique delicata efficiantur ex vix, vel at graecis officiis maluisset. Et per impedit voluptua, usu discere maiorum at. Ut assum ornatus temporibus vis, an sea melius pericula. Ea dicunt oblique phaedrum nam, eu duo movet nobis. His melius facilis eu, vim malorum temporibus ne. Nec no sale regione, meliore civibus placerat id eam. Mea alii fabulas definitionem te, agam volutpat ad vis, et per bonorum nonumes repudiandae.'
,
4
,
57
,
'An his legere persecuti, oblique delicata efficiantur ex |vix, vel at graecis officiis maluisset. Et per impedit |voluptua, usu discere maiorum at. Ut assum ornatus |temporibus vis, an sea melius pericula. Ea dicunt |oblique phaedrum nam, eu duo movet nobis. His melius |facilis eu, vim malorum temporibus ne. Nec no sale |regione, meliore civibus placerat id eam. Mea alii |fabulas definitionem te, agam volutpat ad vis, et per |bonorum nonumes repudiandae.'
,
58
,
'An his legere persecuti, oblique delicata efficiantur ex |vix, vel at graecis officiis maluisset. Et per impedit |voluptua, usu discere maiorum at. Ut assum ornatus |temporibus vis, an sea melius pericula. Ea dicunt oblique |phaedrum nam, eu duo movet nobis. His melius facilis eu, |vim malorum temporibus ne. Nec no sale regione, meliore |civibus placerat id eam. Mea alii fabulas definitionem |te, agam volutpat ad vis, et per bonorum nonumes |repudiandae.'