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: Widespread Intellisense Issues in Astro Projects in VS Code 1.91.0 #892

Closed
pjosxyz opened this issue Jul 7, 2024 · 8 comments
Closed
Assignees
Labels
- P5: urgent Fix breaking bugs affecting most users, should be released ASAP (priority) ecosystem: upstream Issue is caused by a bug / missing feature upstream

Comments

@pjosxyz
Copy link

pjosxyz commented Jul 7, 2024

What version of @astrojs/language-server are you using?

2.10.0

What package manager are you using

Bun - Repo: astro-min-bun
Npm - Repo: astro-min-npm
Bun: 1.1.13 / NPM: 10.7.0 / Node 20.15.0 (all WSL)

What operating system are you using

Windows10 + WSL2 (2.2.4.0) (Ubuntu 20.04.6 LTS)
(Same issues in Windows10 with Bun and NPM)

VSCode Version

1.91.0

Describe the bug

Intellisense in Astro projects is inconsistent and often doesn't work in various scenarios. The behavior seems to vary between different package managers and even within the same project.

Issues observed

Interpolating values in HTML
Intellisense not working

astro-var-intellisense-interpolate-not-working.mp4

Auto imports
Not auto-completing/importing

astro-auto-import-component.mp4

Auto finish imports in frontmatter
Inconsistent behaviour

astro-import.mp4

Seems to be quite variable in what wants to work and what doesn't, for instance:

Inconsistent behavior between Bun and NPM

astro-npm-is.mp4

You can see in the video above that "prop1" doesn't get intellisense for string methods. It does in the Bun repo, but fwiw last night in a project I had started with Bun I wasn't getting intellisense so the issue seems to happen ... randomly, or feels like it does at least!

Intellisense for props
Untyped: No intellisense

astro-props.mp4

Typed: Inconsistent intellisense

astro-props-typed.mp4

Steps to Reproduce

  1. Create a new Astro project: npm create astro@latest or bun create astro@latest using the 'Empty' template
  2. Create some components and try to use variables
  3. Attempt to import components
  4. Observe inconsistent or non-functional intellisense

Additional Notes

The issue seems to occur randomly, making it difficult to pinpoint the exact conditions

For comparison, intellisense works correctly in Next.js projects with the same VSCode/Node/Bun/WSL setup

next-var-intellisense-interpolate-working.mp4
next-auto-import.mp4

Long time lurker, first time Issue creator... If there's details I've missed or rules I've broken let me know 😃. Thanks!

@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jul 7, 2024
@pjosxyz pjosxyz changed the title 🐛 BUG: 🐛 BUG: Widespread Intellisense Issues in Astro Projects Jul 7, 2024
@Princesseuh
Copy link
Member

Princesseuh commented Jul 7, 2024

There's seems to be a VS Code regression affecting many users in the latest version of VS Code, not too sure what's going on.

Some upstream issues:
microsoft/vscode#219990
microsoft/vscode#220082

@Princesseuh Princesseuh added ecosystem: upstream Issue is caused by a bug / missing feature upstream and removed needs triage Issue needs to be triaged labels Jul 7, 2024
@Princesseuh Princesseuh changed the title 🐛 BUG: Widespread Intellisense Issues in Astro Projects 🐛 BUG: Widespread Intellisense Issues in Astro Projects in VS Code 1.91.0 Jul 7, 2024
@pjosxyz
Copy link
Author

pjosxyz commented Jul 7, 2024

Downgrading VSCode to 1.90.2 and intellisense is working.

@pjosxyz pjosxyz closed this as completed Jul 7, 2024
@Princesseuh
Copy link
Member

Let's keep it open for other people to see

@Princesseuh Princesseuh reopened this Jul 7, 2024
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jul 7, 2024
@Princesseuh Princesseuh added - P5: urgent Fix breaking bugs affecting most users, should be released ASAP (priority) and removed needs triage Issue needs to be triaged labels Jul 7, 2024
@hkbertoson
Copy link

Version: 1.90.2
Commit: 5437499feb04f7a586f677b155b039bc2b3669eb
Date: 2024-06-18T22:54:35.075Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0

This is my VSCode Version and it doesnt seem to be working for me.

CleanShot 2024-07-07 at 17 08 23

@gavagavas
Copy link

gavagavas commented Jul 8, 2024

@pjosxyz
Nice to meet you.
Don't you need to downgrade to 1.89 for it to work properly?
Sorry if I'm mistaken.

@Princesseuh
Copy link
Member

Version: 1.90.2 Commit: 5437499feb04f7a586f677b155b039bc2b3669eb Date: 2024-06-18T22:54:35.075Z Electron: 29.4.0 ElectronBuildId: 9728852 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin arm64 23.5.0

This is my VSCode Version and it doesnt seem to be working for me.

CleanShot 2024-07-07 at 17 08 23

Does this happen for every component? For Image it's unfortunately normal, because a global Image exists, so TypeScript doesn't consider that you might be missing an import.

@Princesseuh
Copy link
Member

#879 seems to fix the issue for me locally.

@Princesseuh Princesseuh self-assigned this Jul 8, 2024
@Princesseuh
Copy link
Member

I confirm that this is now fixed in the latest version of the extension. Apologies for the inconvenience.

I will note that this issue was purely dedicated to the regression in VS Code's latest version - I'm sure there's still issues with auto import that exists. Most of which are related to withastro/compiler#862, or #800 or other existing issues.

I will be closing this issue as this precise issue is fixed - but understand that other issues related to auto-imports are also being looked at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P5: urgent Fix breaking bugs affecting most users, should be released ASAP (priority) ecosystem: upstream Issue is caused by a bug / missing feature upstream
Projects
None yet
Development

No branches or pull requests

4 participants