MINK
Tools

The MINK language server

mink lsp starts a language server that talks the Language Server Protocol over standard input and output. An editor starts it for you. You do not run it by hand.

What it does

FeatureWhat you get
Errors and warningsThe compiler checks your unsaved text and reports problems as you type. A duplicate definition also points at the first one.
CompletionLocals, functions, runtime functions and keywords. After module:: it lists that module's names. After Enum:: it lists the variants. After . it lists field names.
HoverThe signature, the doc comment above a declaration, and what a keyword does.
Go to definitionWorks across files and through module::name paths.
Find referencesEvery use of a name. Field names and member accesses with the same spelling are left out.
RenameChanges a name everywhere it is used. It refuses invalid names, reserved words, names starting with rt_, names already taken, runtime functions and standard-library names.
OutlineFunctions, structs, enums and constants, with fields and variants underneath.
Signature helpShows the parameter you are typing.
FormatUses mink fmt, so it never changes what a program says.

How it works

  • Errors come from the same compiler that builds your program, so editor and build always agree.
  • Names, hover and rename use a token-level index of each file. It keeps working while a file has errors, which is when you need completion most.
  • Positions are UTF-16 columns, as the protocol requires. Accented letters and emoji do not shift anything.
  • A file that does not parse stops the compiler before it loads its modules. The server still finds those modules, so completion after module:: works in half-typed code.

Limits in this release

  • It checks the whole program from the open file each time. Large programs may feel slower.
  • Rename covers files the compiler loaded from the open file's modules.
  • No semantic highlighting, code actions or workspace-wide symbol search yet.

Try it

mink lsp --help

A VS Code extension that starts it for you is the next step of the 1.0.5 sprint.

This page is generated from the file in the repository, which is the source of truth. Found a mistake? Open an issue.