Commit 5d441b3
authored
Fix edit range being incorrect when utilities contain variants (#1480)
Fixes #1479
This is the result of a parsing issue inside core which causes us to
make incorrect assumptions. See
tailwindlabs/tailwindcss#19172
The tl;dr of how this bug happened:
1. We see `hover:bg-[` and each "part" gets tested
2. To test each part we compile `{part}:[color:red]`
3. We test `hover` and it passes — awesome ✅
4. We test `bg-[` and it passes — bad ❌
5. This is because it got turned into `bg-[:[color:red]` and was
incorrectly parsed as a valid utility. This is fixed in Tailwind CSS
v4.1.16
This meant that the start position was *after* the end position for a
completion's edit range because it assumed there was a separator (`:`)
after the `bg-[` part when there is not.
We'll work around this for old versions. As mentioned new Tailwind CSS
versions will handle this appropriately.1 parent 861e636 commit 5d441b3
File tree
2 files changed
+28
-4
lines changed- packages
- tailwindcss-language-service/src/util
- vscode-tailwindcss
2 files changed
+28
-4
lines changedLines changed: 27 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
| |||
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
64 | 75 | | |
65 | 76 | | |
66 | 77 | | |
67 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
68 | 91 | | |
69 | 92 | | |
70 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
0 commit comments