#suggestions - vscode
3 messages · Page 1 of 1 (latest)
Hi @shut remnant. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Astro provides built-in support for TypeScript, which can help with autocompletion, hints, and errors in your editor. However, the Astro dev server won't perform any type checking. You can use a separate script to check for type errors from the command line source (https://docs.astro.build/en/guides/typescript#_top).
If you're having issues with the VSCode extension not providing suggestions for newly created components, it could be due to a variety of reasons. Here are a few things you can try:
-
Check your TypeScript setup: Make sure you have a
.tsfile and import an Astro component into it. You should have no warning messages from your editor source (https://docs.astro.build/en/guides/typescript#setup). -
Use
defineConfig()in your configuration file: Astro recommends using thedefineConfig()helper in your configuration file. This provides automatic IntelliSense in your IDE. Editors like VSCode are able to read Astro’s TypeScript type definitions and provide automatic jsdoc type hints, even if your configuration file isn’t written in TypeScript source (https://docs.astro.build/en/guides/configuring-astro#config-intellisense). -
Check for errors in your components: If you're trying to import or render an invalid component, or one that is not working properly, you might encounter issues. Try looking for errors in any component you are importing and rendering, and make sure it’s working correctly source (https://docs.astro.build/en/guides/troubleshooting#expected-a-default-export).