Commit 20890ea
authored
Discard function matches that appear after the current cursor in completions (#1278)
Look, it's not a fancy shiny new feature without a bug 😅
When we discover function matches via `tailwindCSS.classFunctions` we
were implicitly breaking some assumptions used by the completions code:
- No matches for class attributes or functions that appear _after_ the
cursor position are found (we weren't discarding these function matches
but we need to)
- The *last* match is always the one that corresponds to the current
cursor position (we collect function matches separately so the order was
wrong)
This PR fixes this by doing two things:
- Discarding function matches that appear after the current cursor
position
- Sorting the list of attribute and function matches so the last one in
the list is always the latest one in the document (up to the cursor)1 parent 43f9000 commit 20890ea
File tree
3 files changed
+68
-5
lines changed- packages
- tailwindcss-language-server/tests/completions
- tailwindcss-language-service/src
- vscode-tailwindcss
3 files changed
+68
-5
lines changedLines changed: 58 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
| 706 | + | |
706 | 707 | | |
707 | | - | |
| 708 | + | |
708 | 709 | | |
709 | 710 | | |
710 | 711 | | |
| |||
734 | 735 | | |
735 | 736 | | |
736 | 737 | | |
737 | | - | |
| 738 | + | |
738 | 739 | | |
739 | | - | |
| 740 | + | |
740 | 741 | | |
741 | | - | |
| 742 | + | |
| 743 | + | |
742 | 744 | | |
743 | 745 | | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
744 | 749 | | |
745 | 750 | | |
746 | 751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments