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({
981981 expect ( completionD ?. items . length ) . not . toBe ( 0 )
982982 } ,
983983} )
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(
23072307 } )
23082308
23092309 base . walkDecls ( ( node ) => {
2310+ if ( node . value === 'var(--tw-border-style)' ) return
2311+ if ( node . value === 'var(--tw-outline-style)' ) return
2312+
23102313 decls . push ( node )
23112314 } )
23122315
Original file line number Diff line number Diff line change 22
33## Prerelease
44
5- - Nothing yet!
5+ - Simplify completion details for border and outline utilities ( [ # 1384 ] ( https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1384 ) )
66
77# 0.14.19
88
You can’t perform that action at this time.
0 commit comments