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

End of file breaking autocompletion #4583

Closed unpseudocomplique closed 4 weeks ago

unpseudocomplique commented 2 months ago

Vue - Official extension or vue-tsc version

2.0.26

VSCode version

1.91.0

Vue version

3.4.0

TypeScript version

idk how to get it

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
    Memory: 19.45 GB / 47.94 GB
  Binaries:
    Node: 20.2.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 9.6.6 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.4.0 - C:\Program Files\nodejs\pnpm.CMD
    bun: 1.1.17 - ~\.bun\bin\bun.EXE
  Browsers:
    Chrome: 126.0.6478.127
    Edge: Chromium (126.0.2592.87), ChromiumDev (127.0.2610.3)
    Internet Explorer: 11.0.22621.3527

Steps to reproduce

having an unexpected end of file break the autocompletion forever. Like having a component without end tag, the only solution is to do a reload window.

It's also annoying because sometimes i want volar to import my component but because of the end of file it break before importing.

image

What is expected?

Autocompletion should still work even if an issue is present on the component

What is actually happening?

Autocompletion is break and won't come back even when component is fixed !

Link to minimal reproduction

https://play.vuejs.org/#eNp9kE1Lw0AQhv/KuJcolIjoqaSCSkE9qKjgZS8hmaRb94v9qIGQ/+7shtYepLfd93ln5p0Z2Z215S4iW7LKN07YAB5DtCBr3a84C56zW66FssYFGMFhBxN0zigoqKzgmuvGaB9A+R5WiZ8XjyilgS/jZHtWXHBdXc6tqRF9Aior64D0A6g2V4kfaWxBQ6llJ/py642mZGNyctYYZYVE92qDoJGcLSGTxGqa+POcteAiLvZ6s8Hm+x9964ekcfbm0KPbIWcHFmrXY5jx+uMFB3ofoDJtlOQ+Ad/RGxlTxtl2H3VLsY98Oe1TvqnQ/adfDwG13y+VgibnlP2c0Z0fTqz+F/e6vMl1XE9s+gWabZzJ

Any additional comments?

No response

johnsoncodehk commented 2 months ago

Thanks for the report, but I can't reproduce the problem in the code you provided, auto-complete worked for me when the SFC structure was fixed.

Can you provide a video that fully demonstrates how the problem occurs?

unpseudocomplique commented 2 months ago

Sorry i tryed a lot and can't reproduce it again 😥

Will try to stay alert when this happen to create another repro!

Anyway is it possible to make the autocompletion keep working even when something is wrong ? This happen a lot allong the day that something is in dev and it's normal that for now it's broken. That might also implicitly fix my issue.

johnsoncodehk commented 2 months ago

Anyway is it possible to make the autocompletion keep working even when something is wrong ?

The "Vue: Restart Vue and TS servers" command could help.

image
unpseudocomplique commented 2 months ago

Yea, i'm doing reload window every time and this fix it ! But i belive this would be a much better dx to just work even with issue with the file?

RayGuo-ergou commented 2 months ago

I had the same issue time to time, but could not reproduce easily ( so I did not create an issue ). My general guessing is there's a race condition ( I could be very wrong ) like:

Request A send
Request B send

Response B
Response A
davidmatter commented 1 month ago

Can't reproduce in 2.0.28. Is this still an issue for you?

RayGuo-ergou commented 1 month ago

From memory yes, but it happens so rare that my memory about this issue is quite blur. E.g. I am not event sure was it before 2.0.28 or after. Either way I am not too concern of this error to be honestly. I guess you can close this for now, I will remember to post here if I reproduced again.

exzolink commented 1 month ago

@davidmatter Same issue, EOF error or something else (sometimes they dont work in top of template) breaks completions 2.0.29 (Windows) https://imgur.com/a/pzoXA40

exzolink commented 1 month ago

@zhiyuanzmj Could you take a look at this?

zhiyuanzmj commented 1 month ago

when the SFC structure was fixed.

auto-complete don't work when the SFC structure was fixed?

exzolink commented 1 month ago

when the SFC structure was fixed.

auto-complete don't work when the SFC structure was fixed?

Do you mean this? https://imgur.com/a/bp9hTHA With closed tag it works, yes, even if there is no end tag

zhiyuanzmj commented 1 month ago

This url is 403, I can't see it.

exzolink commented 1 month ago

This url is 403, I can't see it.

Try this https://i.imgur.com/4t7rFue.png

zhiyuanzmj commented 1 month ago

No also can't see it, why not copy to the comment input box.

exzolink commented 1 month ago

Weird, maybe cdn issue

4t7rFue

exzolink commented 1 month ago

Images in my first comment dzHrgGf 9dSf5A6

exzolink commented 4 weeks ago

Thanks!