#Fixing Astro IntelliSense in VS Code

28 messages ยท Page 1 of 1 (latest)

queen grove
#

Hi, I don't know what exactly I did that broke it but I followed the guide to create a content collection this morning. Since then IntelliSense/Autocomplete is broken in all my Astro projects.

when I type import H... in a component frontmatter I don't get the autocomplete options anymore (Hero, Header etc.)

What I did so far:

  • Restart the dev server + vs code
  • Deactivate and Activate the Astro VS Code extension

What exactly is needed for this feature to work?

tsconfig.json:

{
  "extends": "astro/tsconfigs/base",
  "compilerOptions": {
    "strictNullChecks": true,
    "allowJs": true
  }
}

src/env.d.ts

/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
/// <reference types="@astrojs/image/client" />
slow wind
#

Hello! Any luck with that? For now I'm back to 0.28.2 because all the 1.0+ versions don't work after the first crash

past copper
#

There's currently a regression in 1.0 with imports completions

#

Everything else should be working though, do you have more information you can share @slow wind?

#

We haven't had any crash report since 1.0.1, so if you're still encountering something, any details would be helpful!

slow wind
#

Sure!

The autocomplete didn't work for me in the pre-release versions, but started working again with 1.0.0.
I think it crashed when I tried to use a fragment, and after that the autocompletes never worked again (tried 1.0.4 too)

I'm using Windows 11

#

I get this error in Astro output tab (1.0.4)

past copper
#

Hmm, that error is harmless normally

#

Where are you trying to get autocompletions?

#

In the frontmatter, a script tag, the template etc

slow wind
#

Frontmatter! I tried in a new project too

past copper
#

And is it any kind of completions, or are we just talking imports?

slow wind
#

I think only imports, tried some JS and worked normally

past copper
#

Oh okay, alright. In which case I can reproduce that one

#

Not sure of the cause yet however ๐Ÿ˜”

#

If everything else is working, I'm fine with that at least ๐Ÿ˜… I'll investigate the import issue

slow wind
#

No probs! I have some time rn, will try to reinstall vscode and things like that

past copper
#

I don't think it'll fix the issue unfortunately

#

Seems to be 100% on our end of things

slow wind
#

Oh! But if you need some kind of testing or info just say so and I will try to do it ๐Ÿš€

#

Just to make sure, that's 0.28.2 vs 1.0.4 on my end

slow wind
past copper
#

Nah, by "any kind of completions" I meant like, "Does typing console.log gets you completions"

#

We understood each other

#

It's only completions of the import name that doesn't work, everything else is fine

slow wind
#

Hi Erika! Just installed the pre-release version of the extension and autocompletes are working again, big thanks! I will keep using it and if I notice any bugs I will post them in the feedback thread

past copper
#

Awesome!