Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: losing intellisense on typescript imports inside .astro files until editor reload #958

Open
lee-arnold opened this issue Sep 30, 2024 · 5 comments
Labels
needs investigation The cause of the issue is unknown and a deeper investigation is needed to fix it

Comments

@lee-arnold
Copy link

lee-arnold commented Sep 30, 2024

Describe the Bug

MacOS
VS Code extension: 2.14.2
Npm: 10.8.3
Node: 22.9.0
VS Code: 1.93.1

Intelisense in frontmatter imports doesn't seem to be working as expected when dealing with new typescript files. Sometimes I can get it to work for the first instance of a file, but then it fails to import any other files. Either way, reloading the editor after creating any new files fixes the issue.

Steps to Reproduce

  1. npm create astro@latest (4.15.9 as of today)
  2. open the project in vscode
  3. create anything.ts with the contents export const anything = "anything";
  4. create another.ts with the contents export const another = "another";
  5. open index.astro and try to import the exported const.
  6. while typing import anyt... I would expect the import to be listed at the top of the autocomplete list, however it does not appear there.
  7. reload the vscode window and the imports now appear on the autocomplete list

Link to Minimal Reproducible Example

https://github.com/lee-arnold/astro-issue-example

@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 30, 2024
@Princesseuh
Copy link
Member

Princesseuh commented Oct 2, 2024

Everything works as expected for me when following your instructions:

Screen.Recording.2024-10-02.at.11.51.44.mov

I'm not sure how to debug this further.

@Princesseuh Princesseuh added needs investigation The cause of the issue is unknown and a deeper investigation is needed to fix it and removed needs triage Issue needs to be triaged labels Oct 2, 2024
@lee-arnold
Copy link
Author

Hey, thanks for the response. Can I ask what OS and versions you're using? I haven't had a chance to test any others yet.

@Princesseuh
Copy link
Member

This is on macOS, 2.14.2 of the Astro extension, VS Code 1.93.1.

@Arttii
Copy link

Arttii commented Oct 3, 2024

I am having this same problem, but on Ubuntu 22.04 with VS Code 1.92.1

@lee-arnold
Copy link
Author

I've noticed with further use that it also fails to recognise new exported functions in files that already existed, again resolved by restarting the language server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation The cause of the issue is unknown and a deeper investigation is needed to fix it
Projects
None yet
Development

No branches or pull requests

3 participants