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
|
diff --git a/packages/tailwindcss-language-service/src/hoverProvider.ts b/packages/tailwindcss-language-service/src/hoverProvider.ts
index b6c45d446a6d529fe79f766955594ba7194a09c6..d62c148138fefe5b048d469d62069a971ad73abf 100644
--- a/packages/tailwindcss-language-service/src/hoverProvider.ts
+++ b/packages/tailwindcss-language-service/src/hoverProvider.ts
@@ -7,6 +7,7 @@ import { findClassNameAtPosition } from './util/find'
import { validateApply } from './util/validateApply'
import { getClassNameParts } from './util/getClassNameAtPosition'
import * as jit from './util/jit'
+import { validateConfigPath } from './diagnostics/getInvalidConfigPathDiagnostics'
export async function doHover(
state: State,
@@ -50,12 +51,14 @@ if (match.groups.helper === 'theme') {
key = ['theme', ...key]
}
- const value = stringifyConfigValue(dlv(state.config, key))
+ const value = validateConfigPath(state, key).isValid
+ ? stringifyConfigValue(dlv(state.config, key))
+ : null
if (value === null) return null
return {
- contents: { kind: 'plaintext', value },
+ contents: { kind: 'markdown', value: ['```plaintext', value, '```'].join('\n') },
range: {
start: { line: position.line, character: startChar },
end: {
|