vuejs / language-tools

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

vue-component-meta, exposed contains all slots, props and events as well #5005

Open fbecker-fds opened 1 week ago

fbecker-fds commented 1 week ago

Vue - Official extension or vue-tsc version

latest

VSCode version

Not used here

Vue version

latest

TypeScript version

3.5.12

System Info

No response

package.json dependencies

No response

Steps to reproduce

Run the tests of this repository after adding the following in line 702:

expect(meta.exposed.length).toBe(1);

What is expected?

It should pass

What is actually happening?

It fails because exposed contains way more than just the exposed symbol.

Link to minimal reproduction

https://github.com/vuejs/language-tools/blob/master/packages/component-meta/tests/index.spec.ts#L691-L704

Any additional comments?

No response

KazariEX commented 1 week ago

It passed on my end.

image

fbecker-fds commented 1 week ago

Apologies! I forgot to mention that the following change is required as well (otherwise there is nothing besides the one expose that could end up in the exposed array :-)):

test-workspace/component-meta/reference-type-exposed/component.vue

Add defineProps(["testProp"]);

Result:

image