ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / extensions / markdown-language-features / src / test / pasteUrl.test.ts 365 строк · изменён 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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
import * as assert from 'assert' ;
import 'mocha' ;
import * as vscode from 'vscode' ;
import { InMemoryDocument } from '../client/inMemoryDocument' ;
import { createInsertUriListEdit, imageEditKind, linkEditKind } from '../languageFeatures/copyFiles/shared' ;
import { InsertMarkdownLink, findValidUriInText, shouldInsertMarkdownLinkByDefault } from '../languageFeatures/copyFiles/smartDropOrPaste' ;
import { noopToken } from '../util/cancellation' ;
import { UriList }
createNewMarkdownEngine
joinLines
contents
vscode Uri contents
result
vscode Uri UriList
assert result label
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
assert
edit UriList
assert edit edits snippet value
edit UriList
assert edit edits snippet value
edit UriList
assert edit edits snippet value
edit UriList
assert edit edits snippet value
edit UriList
assert edit edits snippet value
edit UriList
assert edit edits snippet value
edit UriList
linkKindHint linkEditKind
assert edit edits snippet value
edit UriList
linkKindHint imageEditKind
assert edit edits snippet value
assert
InsertMarkdownLink SmartWithSelection noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
katex default
katex
katex katex default
engine
engine katex
assert
engine InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink SmartWithSelection noopToken
assert
InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink SmartWithSelection noopToken
assert
InsertMarkdownLink SmartWithSelection noopToken
assert
InsertMarkdownLink SmartWithSelection noopToken
assert
InsertMarkdownLink SmartWithSelection noopToken
assert
InsertMarkdownLink SmartWithSelection noopToken
assert
InsertMarkdownLink Smart noopToken
textDoc
assert
textDoc InsertMarkdownLink Smart noopToken
assert
textDoc InsertMarkdownLink Smart noopToken
assert
InsertMarkdownLink Smart noopToken
from
'../util/uriList'
;
import
{
}
from
'./engine'
;
import
{
}
from
'./util'
;
function
makeTestDoc
(
:
string
)
{
return
new
InMemoryDocument
(
.
.
file
(
'test.md'
)
,
)
;
}
suite
(
'createEditAddingLinksForUriList'
,
(
)
=>
{
test
(
'Markdown Link Pasting should occur for a valid link (end to end)'
,
async
(
)
=>
{
const
=
createInsertUriListEdit
(
new
InMemoryDocument
(
.
.
file
(
'test.md'
)
,
'hello world!'
)
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
12
)
]
,
.
from
(
'https://www.microsoft.com/'
)
)
;
.
strictEqual
(
?.
,
'Insert Markdown Link'
)
;
}
)
;
suite
(
'validateLink'
,
(
)
=>
{
test
(
'Markdown pasting should occur for a valid link'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'https://www.microsoft.com/'
)
,
'https://www.microsoft.com/'
)
;
}
)
;
test
(
'Markdown pasting should occur for a valid link preceded by a new line'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'\r\nhttps://www.microsoft.com/'
)
,
'https://www.microsoft.com/'
)
;
}
)
;
test
(
'Markdown pasting should occur for a valid link followed by a new line'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'https://www.microsoft.com/\r\n'
)
,
'https://www.microsoft.com/'
)
;
}
)
;
test
(
'Markdown pasting should not occur for a valid hostname and invalid protool'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'invalid:www.microsoft.com'
)
,
undefined
)
;
}
)
;
test
(
'Markdown pasting should not occur for plain text'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'hello world!'
)
,
undefined
)
;
}
)
;
test
(
'Markdown pasting should not occur for plain text including a colon'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'hello: world!'
)
,
undefined
)
;
}
)
;
test
(
'Markdown pasting should not occur for plain text including a slashes'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'helloworld!'
)
,
undefined
)
;
}
)
;
test
(
'Markdown pasting should not occur for a link followed by text'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'https://www.microsoft.com/ hello world!'
)
,
undefined
)
;
}
)
;
test
(
'Markdown pasting should occur for a link preceded or followed by spaces'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
' https://www.microsoft.com/ '
)
,
'https://www.microsoft.com/'
)
;
}
)
;
test
(
'Markdown pasting should not occur for a link with an invalid scheme'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'hello:www.microsoft.com'
)
,
undefined
)
;
}
)
;
test
(
'Markdown pasting should not occur for multiple links being pasted'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'https://www.microsoft.com/\r\nhttps://www.microsoft.com/\r\nhttps://www.microsoft.com/\r\nhttps://www.microsoft.com/'
)
,
undefined
)
;
}
)
;
test
(
'Markdown pasting should not occur for multiple links with spaces being pasted'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'https://www.microsoft.com/ \r\nhttps://www.microsoft.com/\r\nhttps://www.microsoft.com/\r\n hello \r\nhttps://www.microsoft.com/'
)
,
undefined
)
;
}
)
;
test
(
'Markdown pasting should not occur for just a valid uri scheme'
,
(
)
=>
{
.
strictEqual
(
findValidUriInText
(
'https://'
)
,
undefined
)
;
}
)
;
}
)
;
suite
(
'createInsertUriListEdit'
,
(
)
=>
{
test
(
'Should create snippet with < > when pasted link has an mismatched parentheses'
,
(
)
=>
{
const
=
createInsertUriListEdit
(
makeTestDoc
(
''
)
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
.
from
(
'https://www.mic(rosoft.com'
)
)
;
.
strictEqual
(
?.
?.
[
0
]
.
.
,
'[${1:text}](<https://www.mic(rosoft.com>)'
)
;
}
)
;
test
(
'Should create Markdown link snippet when pasteAsMarkdownLink is true'
,
(
)
=>
{
const
=
createInsertUriListEdit
(
makeTestDoc
(
''
)
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
.
from
(
'https://www.microsoft.com'
)
)
;
.
strictEqual
(
?.
?.
[
0
]
.
.
,
'[${1:text}](https://www.microsoft.com)'
)
;
}
)
;
test
(
'Should use an unencoded URI string in Markdown link when passing in an external browser link'
,
(
)
=>
{
const
=
createInsertUriListEdit
(
makeTestDoc
(
''
)
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
.
from
(
'https://www.microsoft.com'
)
)
;
.
strictEqual
(
?.
?.
[
0
]
.
.
,
'[${1:text}](https://www.microsoft.com)'
)
;
}
)
;
test
(
'Should not decode an encoded URI string when passing in an external browser link'
,
(
)
=>
{
const
=
createInsertUriListEdit
(
makeTestDoc
(
''
)
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
.
from
(
'https://www.microsoft.com/%20'
)
)
;
.
strictEqual
(
?.
?.
[
0
]
.
.
,
'[${1:text}](https://www.microsoft.com/%20)'
)
;
}
)
;
test
(
'Should not encode an unencoded URI string when passing in an external browser link'
,
(
)
=>
{
const
=
createInsertUriListEdit
(
makeTestDoc
(
''
)
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
.
from
(
'https://www.example.com/path?query=value&another=value#fragment'
)
)
;
.
strictEqual
(
?.
?.
[
0
]
.
.
,
'[${1:text}](https://www.example.com/path?query=value&another=value#fragment)'
)
;
}
)
;
test
(
'Should add image for image file by default'
,
(
)
=>
{
const
=
createInsertUriListEdit
(
makeTestDoc
(
''
)
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
.
from
(
'https://www.example.com/cat.png'
)
)
;
.
strictEqual
(
?.
?.
[
0
]
.
.
,
''
)
;
}
)
;
test
(
'Should be able to override insert style to use link'
,
(
)
=>
{
const
=
createInsertUriListEdit
(
makeTestDoc
(
''
)
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
.
from
(
'https://www.example.com/cat.png'
)
,
{
:
,
}
)
;
.
strictEqual
(
?.
?.
[
0
]
.
.
,
'[${1:text}](https://www.example.com/cat.png)'
)
;
}
)
;
test
(
'Should be able to override insert style to use images'
,
(
)
=>
{
const
=
createInsertUriListEdit
(
makeTestDoc
(
''
)
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
.
from
(
'https://www.example.com/'
)
,
{
:
,
}
)
;
.
strictEqual
(
?.
?.
[
0
]
.
.
,
''
)
;
}
)
;
}
)
;
suite
(
'shouldInsertMarkdownLinkByDefault'
,
(
)
=>
{
test
(
'Smart should be enabled for selected plain text'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'hello world'
)
,
.
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
12
)
]
,
)
,
true
)
;
}
)
;
test
(
'Smart should be enabled in headers'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'# title'
)
,
.
,
[
new
vscode
.
Range
(
0
,
2
,
0
,
2
)
]
,
)
,
true
)
;
}
)
;
test
(
'Smart should be enabled in lists'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'1. text'
)
,
.
,
[
new
vscode
.
Range
(
0
,
3
,
0
,
3
)
]
,
)
,
true
)
;
}
)
;
test
(
'Smart should be enabled in blockquotes'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'> text'
)
,
.
,
[
new
vscode
.
Range
(
0
,
3
,
0
,
3
)
]
,
)
,
true
)
;
}
)
;
test
(
'Smart should be disabled in indented code blocks'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
' code'
)
,
.
,
[
new
vscode
.
Range
(
0
,
4
,
0
,
4
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should be disabled in fenced code blocks'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'```\r\n\r\n```'
)
,
.
,
[
new
vscode
.
Range
(
0
,
5
,
0
,
5
)
]
,
)
,
false
)
;
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'~~~\r\n\r\n~~~'
)
,
.
,
[
new
vscode
.
Range
(
0
,
5
,
0
,
5
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should be disabled in math blocks'
,
async
(
)
=>
{
let
:
any
=
(
await
import
(
'@vscode/markdown-it-katex'
)
)
.
;
if
(
typeof
===
'object'
)
{
=
.
;
}
const
=
createNewMarkdownEngine
(
)
;
(
await
.
getEngine
(
undefined
)
)
.
use
(
)
;
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
,
makeTestDoc
(
'$$\r\n\r\n$$'
)
,
.
,
[
new
vscode
.
Range
(
0
,
5
,
0
,
5
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should be disabled in link definitions'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'[ref]: http://example.com'
)
,
.
,
[
new
vscode
.
Range
(
0
,
4
,
0
,
6
)
]
,
)
,
false
)
;
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'[ref]: '
)
,
.
,
[
new
vscode
.
Range
(
0
,
7
,
0
,
7
)
]
,
)
,
false
)
;
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'[ref]: '
)
,
.
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should be disabled in html blocks'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'<p>\na\n</p>'
)
,
.
,
[
new
vscode
.
Range
(
1
,
0
,
1
,
0
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should be disabled in html blocks where paste creates the block'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'<p>\n\n</p>'
)
,
.
,
[
new
vscode
.
Range
(
1
,
0
,
1
,
0
)
]
,
)
,
false
,
'Between two html tags should be treated as html block'
)
;
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'<p>\n\ntext'
)
,
.
,
[
new
vscode
.
Range
(
1
,
0
,
1
,
0
)
]
,
)
,
false
,
'Between opening html tag and text should be treated as html block'
)
;
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'<p>\n\n\n</p>'
)
,
.
,
[
new
vscode
.
Range
(
1
,
0
,
1
,
0
)
]
,
)
,
true
,
'Extra new line after paste should not be treated as html block'
)
;
}
)
;
test
(
'Smart should be disabled in Markdown links'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'[a](bcdef)'
)
,
.
,
[
new
vscode
.
Range
(
0
,
4
,
0
,
6
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should be disabled in Markdown images'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
''
)
,
.
,
[
new
vscode
.
Range
(
0
,
5
,
0
,
10
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should be disabled in inline code'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'``'
)
,
.
,
[
new
vscode
.
Range
(
0
,
1
,
0
,
1
)
]
,
)
,
false
,
'Should be disabled inside of inline code'
)
;
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'``'
)
,
.
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
)
,
true
,
'Should be enabled when cursor is outside but next to inline code'
)
;
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'`a`'
)
,
.
,
[
new
vscode
.
Range
(
0
,
3
,
0
,
3
)
]
,
)
,
true
,
'Should be enabled when cursor is outside but next to inline code'
)
;
}
)
;
test
(
'Smart should be enabled when pasting over inline code '
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'`xyz`'
)
,
.
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
5
)
]
,
)
,
true
)
;
}
)
;
test
(
'Smart should be disabled in inline math'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'$$'
)
,
.
,
[
new
vscode
.
Range
(
0
,
1
,
0
,
1
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should be enabled for empty selection'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'xyz'
)
,
.
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
)
,
true
)
;
}
)
;
test
(
'SmartWithSelection should disable for empty selection'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'xyz'
)
,
.
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should disable for selected link'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'https://www.microsoft.com'
)
,
.
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
25
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should disable for selected link with trailing whitespace'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
' https://www.microsoft.com '
)
,
.
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
30
)
]
,
)
,
false
)
;
}
)
;
test
(
'Should evaluate pasteAsMarkdownLink as true for a link pasted in square brackets'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'[abc]'
)
,
.
,
[
new
vscode
.
Range
(
0
,
1
,
0
,
4
)
]
,
)
,
true
)
;
}
)
;
test
(
'Should evaluate pasteAsMarkdownLink as false for selected whitespace and new lines'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
' \r\n\r\n'
)
,
.
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
7
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should be disabled inside of autolinks'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
'<>'
)
,
.
,
[
new
vscode
.
Range
(
0
,
1
,
0
,
1
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should be disabled in frontmatter'
,
async
(
)
=>
{
const
=
makeTestDoc
(
joinLines
(
` --- `
,
` layout: post `
,
` title: Blogging Like a Hacker `
,
` --- `
,
` `
,
` Link Text `
)
)
;
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
,
.
,
[
new
vscode
.
Range
(
0
,
0
,
0
,
0
)
]
,
)
,
false
)
;
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
,
.
,
[
new
vscode
.
Range
(
1
,
0
,
1
,
0
)
]
,
)
,
false
)
;
}
)
;
test
(
'Smart should enabled after frontmatter'
,
async
(
)
=>
{
.
strictEqual
(
await
shouldInsertMarkdownLinkByDefault
(
createNewMarkdownEngine
(
)
,
makeTestDoc
(
joinLines
(
` --- `
,
` layout: post `
,
` title: Blogging Like a Hacker `
,
` --- `
,
` `
,
` Link Text `
)
)
,
.
,
[
new
vscode
.
Range
(
5
,
0
,
5
,
0
)
]
,
)
,
true
)
;
}
)
;
}
)
;
}
)
;