8000 Completion for global directives · Issue #4988 · vuejs/language-tools · GitHub
[go: up one dir, main page]

Skip to content
Completion for global directives #4988
Closed
@benedictleejh

Description

@benedictleejh

What problem does this feature solve?

vuejs/core#3399 has landed in Vue 3.5, and the GlobalDirectives interface exists, but Volar does not seem to populate directive completions from the the GlobalDirectives interface.

On a fresh project created with pnpm create vue@latest, with VSCode, adding the module declaration

declare module 'vue' {
  interface GlobalDirectives{
    vHelloWorld: any;
  }
}

(in App.vue) enables type hints and jump to definition (at least to the module declaration) on the directive in Vue SFCs, but the completion popup when attempting to use the directive does not include v-hello-world.

I only managed to make the directive completion work when doing

declare module 'vue' {
  interface ComponentCustomProperties {
    vHelloWorld: any;
  }
}

What does the proposed solution look like?

Volar should provide completion for global directives declared in the GlobalDirectives interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0