vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.75k stars 387 forks source link

Vue-component-meta | Can't generate defineModel description and tags #4592

Open Fedezable opened 1 month ago

Fedezable commented 1 month ago

Vue - Official extension or vue-tsc version

2.0.22

VSCode version

1.90.2

Vue version

3.4.30

TypeScript version

5.5.2

System Info

  Binaries:
    Node: 20.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (126.0.2592.102)
    Internet Explorer: 11.0.22621.3527

Steps to reproduce

Create a basic script setup ts component with defineModel and generate meta.

<script setup lang="ts">
/**
 * Prop description
 *
 * @tag Tag
 */
defineModel<string>('data')
</script>

<template>
  <div>
    {{ data }}
  </div>
</template>

What is expected?

I'd expect the JSdoc comment associated to defineModel to be assigned to the prop, or alternatively to both the prop and the event.

What is actually happening?

Both prop and event are generated, but still the metadata from JSdoc can't be processed. Description and tags are both empty.

The prop generated:

{
    name: 'data',
    global: false,
    description: '',
    tags: [],
    required: false,
    type: 'string | undefined',
    rawType: undefined,
    declarations: [Getter],
    schema: [Getter]
}

The event generated:

{
    name: 'update:data',
    description: '',
    tags: [],
    type: '[data: string]',
    rawType: undefined,
    signature: '(event: "update:data", data: string): void',
    declarations: [Getter],
    schema: [Getter]
}

Link to minimal reproduction

No response

Any additional comments?

No response

davidmatter commented 1 month ago

What are you using to generate the JSDoc?