File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed
tailwindcss-language-server/tests/completions
tailwindcss-language-service/src Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -981,3 +981,36 @@ defineTest({
981
981
expect ( completionD ?. items . length ) . not . toBe ( 0 )
982
982
} ,
983
983
} )
984
+
985
+ defineTest ( {
986
+ name : 'Completions for outline and border utilities have simplified details' ,
987
+ fs : {
988
+ 'app.css' : css `
989
+ @import 'tailwindcss';
990
+ ` ,
991
+ } ,
992
+ prepare : async ( { root } ) => ( { client : await createClient ( { root } ) } ) ,
993
+ handle : async ( { client } ) => {
994
+ let document = await client . open ( {
995
+ lang : 'html' ,
996
+ text : html `< div class ="border-0 outline-0 "> </ div > ` ,
997
+ } )
998
+
999
+ // <div class="border-0 outline-0"></div>
1000
+ // ^
1001
+ let completionA = await document . completions ( { line : 0 , character : 20 } )
1002
+
1003
+ // <div class="border-0 outline-0"></div>
1004
+ // ^
1005
+ let completionB = await document . completions ( { line : 0 , character : 30 } )
1006
+
1007
+ let border = completionA ?. items . find ( ( item ) => item . label === 'border-0' )
1008
+ let outline = completionB ?. items . find ( ( item ) => item . label === 'outline-0' )
1009
+
1010
+ let borderResolved = await client . conn . sendRequest ( 'completionItem/resolve' , border )
1011
+ let outlineResolved = await client . conn . sendRequest ( 'completionItem/resolve' , outline )
1012
+
1013
+ expect ( borderResolved ) . toMatchObject ( { detail : 'border-width: 0px;' } )
1014
+ expect ( outlineResolved ) . toMatchObject ( { detail : 'outline-width: 0px;' } )
1015
+ } ,
1016
+ } )
Original file line number Diff line number Diff line change @@ -2307,6 +2307,9 @@ export async function resolveCompletionItem(
2307
2307
} )
2308
2308
2309
2309
base . walkDecls ( ( node ) => {
2310
+ if ( node . value === 'var(--tw-border-style)' ) return
2311
+ if ( node . value === 'var(--tw-outline-style)' ) return
2312
+
2310
2313
decls . push ( node )
2311
2314
} )
2312
2315
Original file line number Diff line number Diff line change 2
2
3
3
## Prerelease
4
4
5
- - Nothing yet!
5
+ - Simplify completion details for border and outline utilities ( [ # 1384 ] ( https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1384 ) )
6
6
7
7
# 0.14.19
8
8
You can’t perform that action at this time.
0 commit comments