Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Add instructions to install dev version (#28)
Browse files Browse the repository at this point in the history
* Markdownlint +
added instructions to permanently install
the dev version of the extension.

* Update README.md

It's not the root directory for the repo! That's the lsp.
It is the `addons/vscode` directory!!

Co-authored-by: Andi Péter <andipeti2000@gmail.com>

* Update README.md

Co-authored-by: Nathan Varner <17197562+nvarner@users.noreply.github.com>

* Suggestions

* markdownlint

---------

Co-authored-by: Andi Péter <andipeti2000@gmail.com>
Co-authored-by: Nathan Varner <17197562+nvarner@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 29, 2023
1 parent 9ca3f28 commit 8af578d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,56 @@
A brand-new language server for [Typst](https://typst.app/).

## Features

- Syntax highlighting, error reporting, code completion, and function signature
help
- Compiles to PDF on save (configurable to as-you-type, or can be disabled)

This repo consists of:

- an LSP server, written in Rust
- [a corresponding VS Code(ium) extension](https://github.com/nvarner/typst-lsp/tree/master/addons/vscode).
The extension is available on the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=nvarner.typst-lsp)
and [OpenVSX](https://open-vsx.org/extension/nvarner/typst-lsp).

## Near future goals

- Improved preview (e.g. built-in PDF viewer, render to image for speed)
- Support for more editors

## Development guide

### Prerequisites

Install:

- [Rust](https://www.rust-lang.org/) for the LSP itself
- [Rust Analyzer](https://rust-analyzer.github.io/) an extension for Rust LSP for VS Code
- [node](https://nodejs.org/en) for the VS Code extension; it may be easiest to
install via [fnm](https://github.com/Schniz/fnm)

### First time setup

1. Clone this repository locally
2. Open it in VS Code; it's needed to run the extension
3. In the `addons/vscode` subdirectory:
1. Run `npm install` to install extension dependencies
2. Run `npm run compile` to build the extension
4. Run through the development cycle once to initialize and test everything
5. (Optional: install the dev version of the extension): Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>,
and choose `Developer: Install Extension from Location...` and choose
the directory for the extension, `addons/vscode/`. There will not be any messages, but
the extension can be found in the Extensions `@installed` list.

### Development cycle

1. Make any changes
2. Run `cargo install --path .`; at present, the VS Code extension just invokes
the `typst-lsp` command to start the LSP, and this command will compile and
replace that binary with the latest version
- If modifying the extension, keep `npm run watch` running, or `npm run compile`
after changes
3. Press `ctrl+F5` to launch the "Extension Development Host"; if it's already
3. Press <kbd>Ctrl</kbd>+<kbd>F5</kbd> to launch the "Extension Development Host"; if it's already
running, invoke "Developer: Reload Window" from the command palette in the
Extension Development Host
4. Within the Extension Development Host, the extension will be active and ready
Expand Down

0 comments on commit 8af578d

Please sign in to comment.