Skip to content

Repository files navigation

Mere for Visual Studio Code

Language support for Mere: diagnostics as you type, hover types, go to definition, completion, an outline, formatting, and highlighting the compiler is sure of.

Everything you see comes from the compiler's own check — the extension starts mere lsp and speaks the Language Server Protocol to it. Nothing here has a second opinion about what a program means, which is the point: an editor plugin that disagrees with the compiler on the days it matters teaches you to distrust the underline.

Requirements

The mere compiler on your PATH (installation). If it lives somewhere else, or you want to try a local build, set:

{ "mere.path": "/path/to/mere" }

What it does

Diagnostics Every syntax error in the buffer, not just the first, and every type error the check can recover from. Warnings (a non-exhaustive match, a name that collides with a C keyword) too. Republished on each keystroke
Hover The type inference gave whatever is under the cursor
Go to definition Where a name was bound — a let, a parameter, a top-level declaration
Completion Every name visible at the cursor, innermost first, with its type
Outline The file's declarations, in breadcrumbs and symbol search
Find references / rename Every occurrence of that binding — two xes in one file may be two different things, and rename knows it. Refuses names the file does not own
Formatting The same function mere fmt runs, so format-on-save and the command line agree. A file that does not parse is left alone
Highlighting Keywords and literals from a grammar; which names are parameters, functions and constructors from the compiler, which is the part a regular expression cannot know

An error inside an imported file is reported against that file, where its line numbers mean something, rather than against the line of the import.

Settings

Setting Default Meaning
mere.path mere The compiler to run. Point it at a build to try an unreleased one
mere.trace.server off Log the traffic between the editor and the server

Mere: Restart Language Server (command palette) reconnects — the thing you want after rebuilding the compiler you are pointing at.

Development

npm install
code .          # then F5: "Run Extension" opens a window with it loaded
npx vsce package    # builds the .vsix

The server side lives in the mere repository (mere lsp, documented in docs/lsp.md). This extension asks the server what it can do during initialize rather than assuming, so a newer extension keeps working against an older compiler.

License

MIT

About

VS Code extension for the Mere language: diagnostics, hover, go to definition and completion, from the compiler's own check

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages