We simply provide a flag with a free-form output which acts as
the module to lookup in the 'env' folder. The strategy is to replace
the environment module name on-the-fly when a user tries to import
'env'.
If the environment isn't found, an 'UnknownModule' error is raised
(which I will slightly adjust in a following commits to something more
related to environment)
There are few important consequences to this design which may not seem
immediately obvious:
1. We parse and type-check every env modules, even if they aren't
used. This ensures that code doesn't break with a compilation error
simply because people forgot to type-check a given env.
Note that compilation could still fail because the env module
itself could provide an invalid API. So it only prevents each
modules to be independently wrong when taken in isolation.
2. Technically, this also means that one can import env modules in
other env modules by their names. I don't know if it's a good or
bad idea at this point but it doesn't really do any wrong;
dependencies and cycles are handlded all-the-same.
|
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
README.md
Aiken Language Server Protocol (LSP)
The aiken command-line comes built-in with a Language Server implementing
(part of) the Language Server Protocol.
Getting Started
General
Regardless of your IDE, you'll likely need the following information to configure your language client:
-
command:
aiken lspNote The command is hidden from the command-line help usage
-
root pattern:
aiken.toml -
filetype:
aiken(.ak)
VsCode
Simply install the VSCode Aiken extension from the official marketplace.
NeoVim
If you're using NeoVim and using nvim-lspconfig then there's almost
nothing to do as Aiken is directly supported. Simply follow the official
instructions
Supported Capabilities
- Document syncing and on-the-fly compilation
- Document formatting (akin to
aiken fmt) - Go-to definition
- Type annotation on hover
- Code actions providing quickfixes for a variety of errors:
aiken::check::unknown::variableaiken::check::unknown::typeaiken::check::unknown::type_constructoraiken::check::unknown::module