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

Add instructions to install dev version #28

Merged
merged 8 commits into from
Mar 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ for regular use.
Currently, it has an LSP component and a corresponding VS Code(ium) extension.

## Current features

- Syntax highlighting
- Compiles Typst into a PDF as you type
- Compile errors appear in the Output pane

## Near future goals

- Improved preview
- Completion
- Improved development experience
Expand All @@ -20,27 +22,36 @@ Currently, it has an LSP component and a corresponding VS Code(ium) extension.
## Development guide

### Prerequisites

Install:

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

### 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. If you want to install the dev version of the extension: After finishing the
last step in Development Cycle, then press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>,
and choose `Developer: Install Extension from Location...` and choose the
the root directory for the extension. 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