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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts
index 4f84b46e6d654166b310f1ae8871167a5f2ce835..4f41f134af16a977729c7fb1e0df084a667b8a16 100644
--- a/packages/tailwindcss-language-service/src/completionProvider.ts
+++ b/packages/tailwindcss-language-service/src/completionProvider.ts
@@ -43,8 +43,8 @@ export function completionsFromClassList(
state: State,
classList: string,
classListRange: Range,
+ document: TextDocument,
filter?: (item: CompletionItem) => boolean,
- document?: TextDocument,
context?: CompletionContext
): CompletionList {
let classNamesAndWhitespace = classList.split(/(\s+)/)
@@ -489,8 +489,8 @@ startOffset + attributeOffset + (attributeText.length - classList.length)
),
end: position,
},
- undefined,
document,
+ undefined,
context
)
}
@@ -553,13 +553,18 @@ } else {
classList = containerMatch[1].substr(0, cursor - matchStart)
}
- return completionsFromClassList(state, classList, {
- start: {
- line: position.line,
- character: position.character - classList.length,
+ return completionsFromClassList(
+ state,
+ classList,
+ {
+ start: {
+ line: position.line,
+ character: position.character - classList.length,
+ },
+ end: position,
},
- end: position,
- })
+ document
+ )
}
}
} catch (_) {}
@@ -599,6 +604,7 @@ character: position.character - classList.length,
},
end: position,
},
+ document,
(item) => {
if (item.kind === 9) {
return (
@@ -1332,13 +1338,18 @@
const parts = emmetItems.items[0].label.split('.')
if (parts.length < 2) return null
- return completionsFromClassList(state, parts[parts.length - 1], {
- start: {
- line: position.line,
- character: position.character - parts[parts.length - 1].length,
+ return completionsFromClassList(
+ state,
+ parts[parts.length - 1],
+ {
+ start: {
+ line: position.line,
+ character: position.character - parts[parts.length - 1].length,
+ },
+ end: position,
},
- end: position,
- })
+ document
+ )
}
export async function doComplete(
|