ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / editor / test / common / modes / linkComputer.test.ts 287 строк · изменён 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
import assert from 'assert' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js' ;
import { ILink } from '../../../common/languages.js' ;
import { ILinkComputerTarget, computeLinks } from '../../../common/languages/linkComputer.js' ;
class SimpleLinkComputerTarget implements ILinkComputerTarget {
constructor ( private _lines: string [ ] ) {
}
public getLineCount ( ) : number {
_lines length
lineNumber
_lines lineNumber
lines ILink
target lines
target
text extractedLink
startColumn
endColumn
chr
i
i i extractedLink length i
chr extractedLink i
chr chr
startColumn i
i extractedLink length i i
chr extractedLink i
chr chr
endColumn i
r text
assert r
range
startLineNumber
startColumn startColumn
endLineNumber
endColumn endColumn
url extractedLink startColumn endColumn
r
assert r
return
this
.
.
;
}
public
getLineContent
(
:
number
)
:
string
{
return
this
.
[
-
1
]
;
}
}
function
myComputeLinks
(
:
string
[
]
)
:
[
]
{
const
=
new
SimpleLinkComputerTarget
(
)
;
return
computeLinks
(
)
;
}
function
assertLink
(
:
string
,
:
string
)
:
void
{
let
=
0
,
=
0
,
:
string
,
=
0
;
for
(
=
0
;
<
.
;
++
)
{
=
.
charAt
(
)
;
if
(
!==
' '
&&
!==
'\t'
)
{
=
+
1
;
break
;
}
}
for
(
=
.
-
1
;
>=
0
;
--
)
{
=
.
charAt
(
)
;
if
(
!==
' '
&&
!==
'\t'
)
{
=
+
2
;
break
;
}
}
const
=
myComputeLinks
(
[
]
)
;
.
deepStrictEqual
(
,
[
{
:
{
:
1
,
:
,
:
1
,
:
}
,
:
.
substring
(
-
1
,
-
1
)
}
]
)
;
}
suite
(
'Editor Modes - Link Computer'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'Null model'
,
(
)
=>
{
const
=
computeLinks
(
null
)
;
.
deepStrictEqual
(
,
[
]
)
;
}
)
;
test
(
'Parsing'
,
(
)
=>
{
assertLink
(
'x = "http://foo.bar";'
,
' http://foo.bar '
)
;
assertLink
(
'x = (http://foo.bar);'
,
' http://foo.bar '
)
;
assertLink
(
'x = [http://foo.bar];'
,
' http://foo.bar '
)
;
assertLink
(
'x = \'http://foo.bar\';'
,
' http://foo.bar '
)
;
assertLink
(
'x = http://foo.bar ;'
,
' http://foo.bar '
)
;
assertLink
(
'x = <http://foo.bar>;'
,
' http://foo.bar '
)
;
assertLink
(
'x = {http://foo.bar};'
,
' http://foo.bar '
)
;
assertLink
(
'(see http://foo.bar)'
,
' http://foo.bar '
)
;
assertLink
(
'[see http://foo.bar]'
,
' http://foo.bar '
)
;
assertLink
(
'{see http://foo.bar}'
,
' http://foo.bar '
)
;
assertLink
(
'<see http://foo.bar>'
,
' http://foo.bar '
)
;
assertLink
(
'<url>http://mylink.com</url>'
,
' http://mylink.com '
)
;
assertLink
(
'// Click here to learn more. https://go.microsoft.com/fwlink/?LinkID=513275&clcid=0x409'
,
' https://go.microsoft.com/fwlink/?LinkID=513275&clcid=0x409'
)
;
assertLink
(
'// Click here to learn more. https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx'
,
' https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx'
)
;
assertLink
(
'// https://github.com/projectkudu/kudu/blob/master/Kudu.Core/Scripts/selectNodeVersion.js'
,
' https://github.com/projectkudu/kudu/blob/master/Kudu.Core/Scripts/selectNodeVersion.js'
)
;
assertLink
(
'<!-- !!! Do not remove !!! WebContentRef(link:https://go.microsoft.com/fwlink/?LinkId=166007, area:Admin, updated:2015, nextUpdate:2016, tags:SqlServer) !!! Do not remove !!! -->'
,
' https://go.microsoft.com/fwlink/?LinkId=166007 '
)
;
assertLink
(
'For instructions, see https://go.microsoft.com/fwlink/?LinkId=166007.</value>'
,
' https://go.microsoft.com/fwlink/?LinkId=166007 '
)
;
assertLink
(
'For instructions, see https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx.</value>'
,
' https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx '
)
;
assertLink
(
'x = "https://en.wikipedia.org/wiki/Zürich";'
,
' https://en.wikipedia.org/wiki/Zürich '
)
;
assertLink
(
'請參閱 http://go.microsoft.com/fwlink/?LinkId=761051。'
,
' http://go.microsoft.com/fwlink/?LinkId=761051 '
)
;
assertLink
(
'(請參閱 http://go.microsoft.com/fwlink/?LinkId=761051)'
,
' http://go.microsoft.com/fwlink/?LinkId=761051 '
)
;
assertLink
(
'x = "file:///foo.bar";'
,
' file:///foo.bar '
)
;
assertLink
(
'x = "file://c:/foo.bar";'
,
' file://c:/foo.bar '
)
;
assertLink
(
'x = "file://shares/foo.bar";'
,
' file://shares/foo.bar '
)
;
assertLink
(
'x = "file://shäres/foo.bar";'
,
' file://shäres/foo.bar '
)
;
assertLink
(
'Some text, then http://www.bing.com.'
,
' http://www.bing.com '
)
;
assertLink
(
'let url = `http://***/_api/web/lists/GetByTitle(\'Teambuildingaanvragen\')/items`;'
,
' http://***/_api/web/lists/GetByTitle(\'Teambuildingaanvragen\')/items '
)
;
}
)
;
test
(
'issue #7855'
,
(
)
=>
{
assertLink
(
'7. At this point, ServiceMain has been called. There is no functionality presently in ServiceMain, but you can consult the [MSDN documentation](https://msdn.microsoft.com/en-us/library/windows/desktop/ms687414(v=vs.85).aspx) to add functionality as desired!'
,
' https://msdn.microsoft.com/en-us/library/windows/desktop/ms687414(v=vs.85).aspx '
)
;
}
)
;
test
(
'issue #62278: "Ctrl + click to follow link" for IPv6 URLs'
,
(
)
=>
{
assertLink
(
'let x = "http://[::1]:5000/connect/token"'
,
' http://[::1]:5000/connect/token '
)
;
}
)
;
test
(
'issue #70254: bold links dont open in markdown file using editor mode with ctrl + click'
,
(
)
=>
{
assertLink
(
'2. Navigate to **https://portal.azure.com**'
,
' https://portal.azure.com '
)
;
}
)
;
test
(
'issue #86358: URL wrong recognition pattern'
,
(
)
=>
{
assertLink
(
'POST|https://portal.azure.com|2019-12-05|'
,
' https://portal.azure.com '
)
;
}
)
;
test
(
'issue #67022: Space as end of hyperlink isn\'t always good idea'
,
(
)
=>
{
assertLink
(
'aa https://foo.bar/[this is foo site] aa'
,
' https://foo.bar/[this is foo site] '
)
;
}
)
;
test
(
'issue #100353: Link detection stops at &(double-byte)'
,
(
)
=>
{
assertLink
(
'aa http://tree-mark.chips.jp/レーズン&ベリーミックス aa'
,
' http://tree-mark.chips.jp/レーズン&ベリーミックス '
)
;
}
)
;
test
(
'issue #121438: Link detection stops at【...】'
,
(
)
=>
{
assertLink
(
'aa https://zh.wikipedia.org/wiki/【我推的孩子】 aa'
,
' https://zh.wikipedia.org/wiki/【我推的孩子】 '
)
;
}
)
;
test
(
'issue #121438: Link detection stops at《...》'
,
(
)
=>
{
assertLink
(
'aa https://zh.wikipedia.org/wiki/《新青年》编辑部旧址 aa'
,
' https://zh.wikipedia.org/wiki/《新青年》编辑部旧址 '
)
;
}
)
;
test
(
'issue #121438: Link detection stops at “...”'
,
(
)
=>
{
assertLink
(
'aa https://zh.wikipedia.org/wiki/“常凯申”误译事件 aa'
,
' https://zh.wikipedia.org/wiki/“常凯申”误译事件 '
)
;
}
)
;
test
(
'issue #150905: Colon after bare hyperlink is treated as its part'
,
(
)
=>
{
assertLink
(
'https://site.web/page.html: blah blah blah'
,
'https://site.web/page.html '
)
;
}
)
;
test
(
'issue #156875: Links include quotes '
,
(
)
=>
{
assertLink
(
` "This file has been converted from https://github.com/jeff-hykin/better-c-syntax/blob/master/autogenerated/c.tmLanguage.json", `
,
` https://github.com/jeff-hykin/better-c-syntax/blob/master/autogenerated/c.tmLanguage.json `
,
)
;
}
)
;
test
(
'issue #225513: Cmd-Click doesn\'t work on JSDoc {@link URL|LinkText} format '
,
(
)
=>
{
assertLink
(
` * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers|Promise.withResolvers} `
,
` https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers `
,
)
;
}
)
;
}
)
;