Skip to content

Manually annotating prop with JSDoc doesn't produce right type #6854

@rchl

Description

@rchl

Vue version

3.2.0

Link to minimal reproduction

https://sfc.vuejs.org/#eNpNUMtuwjAQ/JWVL4Eo2Gp7i9yoHHvrHXMIZGmDsGPZDgVZ/veuE5Tii/cxOzO7kW2t5dcRWc1kQG0vbcBGGQDZ9dcmRuip6iElKXJBGSmeYJT6o+ttoBhvdnABOjy14yVAzCSm1VhD8Wk6vBVVrlg3WF/PXQBRlvAR7hYh9jqPrwryUqz5F8GkGfUB3W5fwe6lgtcK3vZNglLMs5OxhQkg09Swda69T0r5PczUsFrDe/NPM/dT/hKBKZBiWYRVbDaz0a3lZz8YOs4kox4Nr9girBg5zrliPyHQbkL40zGf9Oz54L4FRdyNJvQaOXq9Objh16MjYsUmA6TP0h/G+3+V

Steps to reproduce

  1. Download the code from the reproduction playground
  2. Install Volar in the editor
  3. Hover over the items in the template

What is expected?

The type of items should be number[]

What is actually happening?

The type of items is any.

Screenshot 2022-10-11 at 23 25 08

System Info

No response

Any additional comments?

I've also created example projects using both Vue 3 and Vue 2.7 at:

(note that those repros are on their own branches)

This is to show that this works in Vue 2.7 when annotating using the PropOptions type (Vue 2 variant of Vue 3's Prop type).

Also see corresponding Volar issue: vuejs/language-tools#1984 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions