We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83640ae commit 81a3b5fCopy full SHA for 81a3b5f
packages/tailwindcss-language-service/src/scopes/classes/scan.ts
@@ -0,0 +1,22 @@
1
+import { ScopeClassList } from '../scope'
2
+
3
+export function scanClassList(input: string, scope: ScopeClassList) {
4
+ let classList = input.slice(scope.source.scope[0], scope.source.scope[1])
5
+ let parts = classList.split(/(\s+)/)
6
7
+ let index = scope.source.scope[0]
8
9
+ for (let i = 0; i < parts.length; i++) {
10
+ let length = parts[i].length
11
12
+ if (i % 2 === 0) {
13
+ scope.children.push({
14
+ kind: 'class.name',
15
+ source: { scope: [index, index + length] },
16
+ children: [],
17
+ })
18
+ }
19
20
+ index += length
21
22
+}
0 commit comments