Nova

Extensions


Readme

Astro

Astro provides syntax highlighting and basic autocomplete for .astro files from the Astro web framework. More advanced autocomplete and linting is provided by the optional Astro Language Server (enabled by default). When enabled, the bundled language server keeps itself up-to-date automatically, so you always have the latest version.

Requirements

If you want to use the Language Server, you will need Node.js and NPM installed and on your PATH.

Usage

The Astro extension automatically runs when it detects a .astro file or an Astro config file in your workspace. If the language server is enabled, it will automatically check for updates once each day. You can disable automatic updates, or you can disable the bundled language server altogether by setting a custom path to a different one.

Configuration

  • Enable Language Server - Whether the Astro Language Server is enabled. Disabling the language server will still provide syntax highlighting in .astro files.
  • Check For Updates - Whether the extension should automatically check for updates once each day.
  • Custom Language Server Path - Path to a custom version of the language server. Setting this value will delete the bundled language server to save space.
  • Custom Fallback TypeScript Path - Custom path to the installation of TypeScript that will be used if one can't be found in your workspace. Setting this value will delete the bundled version of TypeScript to save space.
  • Always Use Custom TypeScript - Always use the custom TypeScript that you've set, even if TypeScript can be found in your workspace.

Commands

When the language server is enabled, the extension provides the following commands, accessible from the command palette and the Extensions menu in the menu bar: - Restart Language Server - This will stop the language server and start it again, which sometimes helps if it's not detecting imports or otherwise misbehaving. - Check for Updates - This command checks for updates immediately, regardless of when automatic updates were last fetched. It is most useful if you have disabled automatic updates but still want to keep the bundled Language Server and TypeScript up-to-date.

Acknowledgements

This extension would not have been possible without tree-sitter-astro by virchau13. Most of the tree-sitter queries for syntax highlighting, symbolication, folding, etc. are heavily inspired by Nova's in-built HTML extension.


Changelog

Version 1.0

Initial release