@@ -40,3 +40,42 @@ withFixture('basic', (c) => {
40
40
] ,
41
41
} )
42
42
} )
43
+
44
+ withFixture ( 'v4/basic' , ( c ) => {
45
+ async function testDocumentLinks ( name , { text, lang, expected } ) {
46
+ test . concurrent ( name , async ( { expect } ) => {
47
+ let textDocument = await c . openDocument ( { text, lang } )
48
+ let res = await c . sendRequest ( 'textDocument/documentLink' , {
49
+ textDocument,
50
+ } )
51
+
52
+ expect ( res ) . toEqual ( expected )
53
+ } )
54
+ }
55
+
56
+ testDocumentLinks ( 'config: file exists' , {
57
+ text : '@config "tailwind.config.js";' ,
58
+ lang : 'css' ,
59
+ expected : [
60
+ {
61
+ target : `file://${ path
62
+ . resolve ( './tests/fixtures/v4/basic/tailwind.config.js' )
63
+ . replace ( / @ / g, '%40' ) } `,
64
+ range : { start : { line : 0 , character : 8 } , end : { line : 0 , character : 28 } } ,
65
+ } ,
66
+ ] ,
67
+ } )
68
+
69
+ testDocumentLinks ( 'config: file does not exist' , {
70
+ text : '@config "does-not-exist.js";' ,
71
+ lang : 'css' ,
72
+ expected : [
73
+ {
74
+ target : `file://${ path
75
+ . resolve ( './tests/fixtures/v4/basic/does-not-exist.js' )
76
+ . replace ( / @ / g, '%40' ) } `,
77
+ range : { start : { line : 0 , character : 8 } , end : { line : 0 , character : 27 } } ,
78
+ } ,
79
+ ] ,
80
+ } )
81
+ } )
0 commit comments