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
|
diff --git a/packages/tailwindcss-language-service/src/hoverProvider.ts b/packages/tailwindcss-language-service/src/hoverProvider.ts
index 6322c40b501030eba1d3fea8ee51d935c6b6f42b..3171e02b21159854b1f3d3e3625861b945ed10cf 100644
--- a/packages/tailwindcss-language-service/src/hoverProvider.ts
+++ b/packages/tailwindcss-language-service/src/hoverProvider.ts
@@ -6,14 +6,15 @@ import { isCssContext } from './util/css'
import { findClassNameAtPosition } from './util/find'
import { validateApply } from './util/validateApply'
import { getClassNameParts } from './util/getClassNameAtPosition'
+import { getDocumentSettings } from './util/getDocumentSettings'
-export function doHover(
+export async function doHover(
state: State,
document: TextDocument,
position: Position
-): Hover {
+): Promise<Hover> {
return (
- provideClassNameHover(state, document, position) ||
+ (await provideClassNameHover(state, document, position)) ||
provideCssHelperHover(state, document, position)
)
}
@@ -71,11 +72,11 @@ },
}
}
-function provideClassNameHover(
+async function provideClassNameHover(
state: State,
document: TextDocument,
position: Position
-): Hover {
+): Promise<Hover> {
let className = findClassNameAtPosition(state, document, position)
if (className === null) return null
@@ -89,9 +90,12 @@ return null
}
}
+ const { tabSize } = await getDocumentSettings(state, document)
+
const css = stringifyCss(
className.className,
- dlv(state.classNames.classNames, [...parts, '__info'])
+ dlv(state.classNames.classNames, [...parts, '__info']),
+ tabSize
)
if (!css) return null
|