Skip to content

<style> completions and html custom data completions not provided in some cases #4092

Closed
@rchl

Description

@rchl

I have a project that provides completions for the class attribute using custom data format. Volar provides those completions (aaa) when class attribute value is empty or after a space but not when there is already a character inserted (even if it matches the completion).

Here is a screencast (it's supposed provide both aaa and aaa-local in both cases:

Screen.Recording.2024-03-13.at.14.51.31.mov

Note also the inconsistent behavior with providing component-local aaa-scoped completion. It's provided when the custom data completions are not provided and vice-versa.

Note2: In the 2.0.6 version the component-local classes are not suggested at all which seems like a separate bug. I've made the video using 1.x version.

Steps:

  1. Clone repo: https://github.com/rchl/vue-completions-bug
  2. install dependencies
  3. Open App.vue
  4. Trigger completions within the class attribute when value is
    a) empty
    b) "a"

The issue is most likely around https://github.com/volarjs/volar.js/blob/15cf7fd2940938fb47c33a1db98d0173168064ee/packages/language-service/lib/languageFeatures/complete.ts#L150-L154 where it exits early and doesn't ask services for completions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood reproduction ✨This issue provides a good reproduction, we will be able to investigate it first

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions