volarjs / volar.js

πŸ’™πŸŒŠ
https://volarjs.dev/
MIT License
963 stars 47 forks source link

fix(typescript): use Proxy instead of modifying LanguageService instance #216

Closed johnsoncodehk closed 2 months ago

johnsoncodehk commented 2 months ago

Referring to https://github.com/microsoft/typescript-template-language-service-decorator/pull/31, we found that some TS plugins use Proxy but do not implement the set method, which causes the method of decorateLanguageService to override LanguageService functions to be invalid.

This PR attempts to change decorateLanguageService to use Proxy to solve this problem without requiring modification of other TS plugins to improve Volar TS plugin compatibility.

cc @volarjs/core-team, @piotrtomiak (Please let me know if you think this is potentially breaking in WebStorm.)

johnsoncodehk commented 2 months ago

This makes the following TS plugins now compatible. πŸŽ‰ (From https://github.com/vuejs/language-tools/pull/4206)

θž’εΉ•ζˆͺεœ– 2024-06-29 上午9 30 23