language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

πŸ› BUG: Changes in Typings are refreshed only if the file is located in same workspace scope

Open JulianCataldo opened this issue 2 years ago β€’ 2 comments

Describe the Bug

When changing typings, wether in Astro components Props or TS / JS + d.ts libraries, typically in a pnpm workspace with linked packages, you will not get Typescript LSP updates, you'll have to do the "Reload Window" command so the Astro extension can pick changes. Also, not sure at 100% as it seems a bit random, but I've experienced hiccups in TS types updates for files located in the same workspace, too. My comparison point is when working with TSX / TS, where it does not shows similar updates issues (it's instant).

Steps to Reproduce

  1. npm init astro using template <NAME>
  2. ...
  3. ...
  4. ...
  5. Error! Describe what went wrong (and what was expected instead)...

JulianCataldo avatar Oct 15 '22 16:10 JulianCataldo

Hello! Just a few questions to help narrow this down as cache issues are kinda hard:

  • What do you mean by workspace scope? A npm/yarn/pnpm workspace or a VS Code one?
  • Where are updates not being properly seen, inside Astro files or other files?
  • Does this happen reliably? I'm having trouble replicating this.

Princesseuh avatar Oct 17 '22 16:10 Princesseuh

I'm gonna make more "scientific" tests to isolate those and will share my results.

By workspace scope, I mean "real files" inside the VS Code workspace (not pnpm/yarn…).

It looks like symbolic links are breaking the "live wire" on which TypeScript Language Server is feeding on.

JulianCataldo avatar Oct 18 '22 18:10 JulianCataldo

I face this same issue as well...I lose all lining,type hints, undeclared variables errors till I reload the window. I have to reload every 5mins

sometimes even reloading does not help. I upgraded everything to the latest version including ts..but yet the issue is still there.

ahmad-ali14 avatar Nov 27 '22 01:11 ahmad-ali14

I face this same issue as well...I lose all lining,type hints, undeclared variables errors till I reload the window. I have to reload every 5mins

sometimes even reloading does not help. I upgraded everything to the latest version including ts..but yet the issue is still there.

I don't think your issue and this issue are related, could you open another issue with as much details as possible? Thank you!

Princesseuh avatar Nov 27 '22 02:11 Princesseuh

https://github.com/withastro/language-tools/pull/534 should fix this, let me know if it works on your end

Princesseuh avatar Jun 02 '23 21:06 Princesseuh