vuejs / language-tools

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

Hover info in VScode gets crashed by pug plugin #4787

Closed sschneider-ihre-pvs closed 1 month ago

sschneider-ihre-pvs commented 1 month ago

Vue - Official extension or vue-tsc version

Official

VSCode version

1.92.2

Vue version

3.4.37

TypeScript version

5.4.5

System Info

No response

package.json dependencies

No response

Steps to reproduce

  1. Vue Sfc File with pug and ts script setup
  2. hover over function causes error in language server destroying autocomplete and hover

What is expected?

Hover should work in vue sfc files with pug

What is actually happening?

No hover or type info in script body of vue sfc file with pug

Link to minimal reproduction

No response

Any additional comments?

No response

sschneider-ihre-pvs commented 1 month ago
TypeError 'a' is not a function ...

and 'a' being getClassOffset https://github.com/vuejs/language-tools/blob/1a734cf9d9859da9ae72e1b8612e2f3613956ff9/packages/language-core/lib/codegen/template/element.ts#L586

sschneider-ihre-pvs commented 1 month ago

Is an issue since v2.1.0

richardsimko commented 1 month ago

Seeing the same issue with pug. Rolling back to v2.0.28 solves it for now.

It also seems to break autocomplete using types within the SFC

KazariEX commented 1 month ago

update @vue/language-plugin-pug

richardsimko commented 1 month ago

Thanks, that solved it!

hinogi commented 1 month ago
const getClassOffset = (offset: number) => Reflect.get(offset, 'getClassOffset') as (offset: number) => number;

Deriving from the ts signature and usage maybe? Oh already solved ok