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 407 forks source link

Hover info in VScode gets crashed by pug plugin #4787

Closed sschneider-ihre-pvs closed 2 months ago

sschneider-ihre-pvs commented 2 months 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 2 months 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 2 months ago

Is an issue since v2.1.0

richardsimko commented 2 months 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 2 months ago

update @vue/language-plugin-pug

richardsimko commented 2 months ago

Thanks, that solved it!

hinogi commented 2 months 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