GithubHelp home page GithubHelp logo

filiptronicek / astro-language-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from withastro/language-tools

1.0 1.0 0.0 1.48 MB

Language tools for Astro

JavaScript 3.79% TypeScript 96.21%

astro-language-tools's Introduction

Astro Language Tools

This repository contains tooling for the Astro language, powering the VSCode extension. The packages included are:

  • The Astro VSCode Extension
  • The Astro Language Server

This enables all of the editing features you depend on in VSCode. Any time you open a .astro file these tools power editing functionality such as:

  • Go to Definition
  • Code hover hints
  • Code completion
  • Function signatures
  • Syntax highlighting
  • Code folding
  • Emmet

Soon we hope to port these to other editors compatible with the Language Server Protocol.

Development

See the overview video on how the extension works.

Changes to the Astro Language Tools are subject to Astro Governance.

Setup

All Astro projects use Yarn and Lerna to enable development in a monorepo. Once you've cloned the project install dependencies and do an initial build:

yarn
yarn build

Debugging

During the normal course of development on the VSCode extension you'll want to run the debugger. First run the build in watch mode with:

yarn dev

Turn Off Extension

If you have the Extension installed you'll need to turn it off, or your development extension will not be used and you'll be confused why your changes are not working.

  1. Click on Extensions.
  2. Search for astro.
  3. Click the extension and then click Disable.

Show the steps of disabling the extension

Start Debugger

Then in VSCode:

  1. Switch to Run and Debug.
  2. Click Launch Extension.

Showing the steps to launching the debugger

This will launch a new window for your editor. Here you can navigate to a test Astro project that you will use to develop your changes.

Open Debug Console

The Debug console in the main editor is where you will get logging information. When developing in the language server, logging is helpful to figure out what is going on.

  1. Ctrl+Shift+P (CMD+Shift+P on OSX) opens the command palette.
  2. Select Debug Console.
  3. At the bottom, switch to Attach to Server. This is most of the information you'll want to see.

Steps to open the command palette

Make changes and set breakpoints

Now you can start developing your changes. You can set breakpoints or add debugger; statements. To see your changes reflect you'll need to take these steps:

  1. In the extension editor window, go to Run and Debug if you are not already there.
  2. Click on the Restart button under Launch Client.

This will restart the extension and reload your test window.

Shows how to restart the extension

astro-language-tools's People

Contributors

filiptronicek avatar fredkschott avatar github-actions[bot] avatar jasikpark avatar jonathantneal avatar matthewp avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.