Skip to content

CSS Class reference/go to definition found in Vue Single File Components does not include . in the class name #5719

@lethefrost

Description

@lethefrost

Vue - Official extension or vue-tsc version

3.1.1

VSCode version

1.105.1

Vue version

vue@3.5.22

TypeScript version

typescript@5.9.2

System Info

System:
    OS: macOS 26.0.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 26.96 GB / 96.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.10.0 - /opt/homebrew/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 11.6.2 - /opt/homebrew/bin/npm
    pnpm: 10.13.1 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 141.0.7390.108
    Safari: 26.0.1

package.json dependencies

N/A

Steps to reproduce

This Vue Official vsc extension provides feature to find references and go to definition, and list all found references/definitions in the peek view, for css classes in a vue SFC. VSC merges reference entries with exactly the same string name automatically, so when you use multiple language service providers, it won't have many reference duplicates. Usually, other extensions providing such peek features (for example, CSS Peak, CSS Navigation, and more) include the character . at the beginning of a class name. However, this Vue Official extension does not include the . part when creating reference entries (for example, .test-class -> test-class), so the auto merge fails, and we will have duplicate css class entries in the peek view of .vue files when using along with other extensions.

For example, in this screenshot, class is defined in style/css but not used in template/html section,

Image

the first two entries with blue marker 1️⃣ of .test are generated by other extension, including the ., and the third entry with yellow marker 2️⃣ of test is generated by Vue Official extension, without the leading .. Similarly, if there are references in the template/html part, there are even more duplicates:

Image

What is expected?

Include the leading . in css class selectors like other extensions do so they can be merged and don't cause duplicate entries in the peek view.

What is actually happening?

. is not included.

Link to minimal reproduction

No response

Any additional comments?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions