swarm/editors
Brent Yorgey eb205e61a9
Add require directive (#533)
Add new special syntactic forms `require <string literal>` to require a device to be installed, and `require <int literal> <string literal>` to require a certain number of a given entity in the inventory.

- Replace `Set Capability` with a new `Requirements` type which records various types of requirement.
- Refactor requirements checking into a new function `checkRequirements` which also does device set minimization (#508).  
- `reprogram` will now install extra devices or transfer extra inventory as necessary.
- Add a bunch of tests.
- Add new `installed` command, similar to `has`, which checks whether a given device is installed.

Closes #201.
Closes #508.
2022-07-05 22:36:06 +00:00
..
emacs Add require directive (#533) 2022-07-05 22:36:06 +00:00
vscode Add require directive (#533) 2022-07-05 22:36:06 +00:00
README.md Add vscode editor integration (#255) 2021-11-11 16:15:17 +00:00

Text Editor Configuration

Validate a swarm-lang file using: swarm format ./file.sw

Swarm comes with a language server protocol (LSP) server. Make sure the swarm program is present in your PATH, then configure your editor.

EMACS

The current LSP implementation features the following extensions:

  • error diagnostic on load/save

Using lsp-mode:

Load the swarm-mode.el and start the M-x lsp service in a swarm-mode buffer.

VS Code and VS Codium

The swarm-lang extension provides highlighting and an LSP client. That is if you have swarm executable in PATH, then the executable will be used as LSP server to show errors as you type.

You can get it by:

  • installing from MS marketplace (link)
  • building from source in the vscode folder
  • TBD get the VSIX from GitHub releases
  • TBD installing from the VS codium free marketplace

Vim and Neovim

Currently there is neither highlighting nor LSP support for Vim, but we would be happy to accept a contribution.