File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
packages/tailwindcss-language-server Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,16 @@ export async function loadDesignSystem(
85
85
} else if ( str [ i ] === ';' ) {
86
86
result += ';\n'
87
87
} else if ( str [ i ] === ':' ) {
88
- result += ': '
88
+ let prev = str . charCodeAt ( i - 1 )
89
+ if (
90
+ ( prev >= 65 && prev <= 90 ) ||
91
+ ( prev >= 97 && prev <= 122 ) ||
92
+ ( prev >= 48 && prev <= 57 )
93
+ ) {
94
+ result += ': '
95
+ } else {
96
+ result += ':'
97
+ }
89
98
} else {
90
99
result += str [ i ]
91
100
}
@@ -98,10 +107,9 @@ export async function loadDesignSystem(
98
107
for ( let i = 0 ; i < lines . length ; ++ i ) {
99
108
let line = lines [ i ]
100
109
if ( line . includes ( '}' ) ) depth --
101
- let indent = ' ' . repeat ( Math . max ( 0 , depth ) )
102
- line = indent + line
110
+ let indent = ' ' . repeat ( Math . max ( 0 , depth ) )
111
+ lines [ i ] = indent + line
103
112
if ( line . includes ( '{' ) ) depth ++
104
- lines [ i ] = line
105
113
}
106
114
107
115
let pretty = lines . join ( '\n' ) . trim ( )
Original file line number Diff line number Diff line change @@ -442,7 +442,7 @@ withFixture('v4/basic', (c) => {
442
442
detail : 'text-transform: uppercase' ,
443
443
documentation : {
444
444
kind : 'markdown' ,
445
- value : '```css\n.uppercase {\n text-transform: uppercase;\n}\n```' ,
445
+ value : '```css\n.uppercase {\n text-transform: uppercase;\n}\n```' ,
446
446
} ,
447
447
} )
448
448
} )
You can’t perform that action at this time.
0 commit comments