Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>AstroNew to Visual Studio Code? Get it now.
Astro

Astro

Astro

astro.build
|
200,348 installs
| (13) | Free
Language support for Astro
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Astro support for Visual Studio Code

🧑‍🚀 Not sure what Astro is? See our website at astro.build!

Provides language support for .astro files. This extension is powered by the Astro language server.

Features

  • Syntax & semantic highlighting
  • Diagnostic messages
  • IntelliSense completions (w/ auto-imports)
  • Emmet completions in HTML & CSS
  • Props completions for JSX/TSX, Vue (Composition API only) and Svelte components
  • Code actions (quick fixes, sort imports etc)
  • Formatting (powered by Prettier and prettier-plugin-astro)
  • Symbols (outline view, breadcrumb navigation etc)
  • Hover information
  • Go to Definition
  • Inlay hints
  • Code folding
  • and more!

A TypeScript plugin adding support for importing Astro components inside JavaScript and TypeScript files is also included.

Configuration

You can disable most features in the extension by going to your workspace settings page. Under Extension find Astro configuration and uncheck the feature(s) you do not want. For example to disable error messages unselect TypeScript > Diagnostics: Enable (or in JSON, set astro.typescript.diagnostics.enabled to false).

Formatting can be configured through Prettier's different configuration methods. TypeScript settings can be configured using VS Code's TypeScript settings (typescript.xxx).

Troubleshooting

Unable to update to latest version

Starting from 0.19.0, the minimum VS Code version supported by this extension is 1.67.0 (April 2022). If using an older version of VS Code, 0.18.1 will be installed instead.

Before submitting an issue, please make sure you're using the latest version of both VS Code and the extension!

Inlay Hints don't work

Currently, only inlay hints provided by TypeScript are supported. TypeScript inlay hints are disabled by default and needs to be enabled using the settings under the typescript.inlayHints namespace, for example, to enable inlay hints for parameter names, you would do the following:

{
  "typescript.inlayHints.parameterNames.enabled": "all"
}

Alternatively, in the GUI this would be in TypeScript > Inlay Hints > Parameter Names. Make sure to update the TypeScript settings and not the JavaScript ones, as Astro is TypeScript-only

See this page for more information on the different settings available for inlay hints

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft