vuejs / language-tools

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

fix(language-core): make `expose` of non-generic template ref required #4795

Closed zhiyuanzmj closed 2 months ago

zhiyuanzmj commented 2 months ago

Should be required when is not a generic component.

image
pkg-pr-new[bot] commented 2 months ago

Open in Stackblitz

vue-component-meta

``` pnpm add https://pkg.pr.new/vuejs/language-tools/vue-component-meta@4795 ```

vue-component-type-helpers

``` pnpm add https://pkg.pr.new/vuejs/language-tools/vue-component-type-helpers@4795 ```

@vue/language-plugin-pug

``` pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-plugin-pug@4795 ```

@vue/language-core

``` pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-core@4795 ```

@vue/language-server

``` pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-server@4795 ```

@vue/language-service

``` pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-service@4795 ```

vue-tsc

``` pnpm add https://pkg.pr.new/vuejs/language-tools/vue-tsc@4795 ```

@vue/typescript-plugin

``` pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/typescript-plugin@4795 ```

commit: a6eaf97

johnsoncodehk commented 2 months ago

Can you add a test case?

zhiyuanzmj commented 2 months ago

Can you add a test case?

It can correct infer type, Only affecting twoslash. Such as this:

image
johnsoncodehk commented 2 months ago

I see, thanks!