Skip to content

Conversation

@thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Mar 20, 2025

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)

@thecrypticace thecrypticace merged commit 20890ea into main Mar 20, 2025
@thecrypticace thecrypticace deleted the fix/class-functions-break-completions branch March 20, 2025 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants