idris-vscodeSupport for Idris, the dependently-typed, functional language.
InstallationThe plugin itself can be installed from within VSCode or VSCodium through the Extensions Panel. It should come up if you search for ‘Idris’. The extension id is You can also download the vsix file from the Releases page on Github, or from the VSCode Marketplace, or from the Open VSX Registry. You will need Idris or Idris 2 installed separately. If it’s not on your $PATH, you can specify the absolute path to the executable in the config. The extension will not download or install anything on the user’s behalf. If you want to test local changes to the extension, build it with Idris 2Currently the extension will default to v1. If you want it to use Idris 2, change the path in the configuration to your Idris 2 binary, and tick the Only the current version of Idris 2 is supported, which at the moment is 0.6.0. If you experience problems, please make sure you are using the most recent version. At the moment, some of the IDE commands haven’t been implemented in Idris 2. CommandsAdd ClauseGenerate the initial clause for the function definition under the cursor. Add MissingGenerate pattern matches for any missing clauses for the function definition or case statement under the cursor. AproposSearch the documentation for references to a string. Apropos At CursorSearch the documentation for references to the word under the cursor. Browse NamespaceShow all declarations and sub-modules for a given namespace. Case SplitSplit the variable under the cursor into all possible pattern matches. Documentation ForShow the documentation for a given function. Documentation At CursorShow the documentation for the function under the cursor. Generate DefinitionGenerate complete definition for the function definition under the cursor. Interpret SelectionInterpret the highlighted code and show the result in the editor. List MetavariablesShow a list of all the holes (metavariables) in the current namespace. Print DefinitionShow the definition for a given function. Print Definition At CursorShow the definition for the function under the cursor. Make CaseTurn the variable under the cursor into a case statement. Make LemmaCreate a new function declaration, and use it to solve the hole under the cursor. Make WithTurn the variable under the cursor into a with statement. Proof SearchSolve the hole under the cursor. VersionShow the current version of Idris. KeybindingsThe extension doesn’t set any key-bindings out of the box, but here are some suggested bindings based on the Atom plugin. Just copy them to your User/keybindings.json.
Literate IdrisThe extension should work equally well for literate Idris files. For Idris 1, this only applies to .lidr files. Idris 2 extends this this to embedded code blocks in Markdown, LaTeX and Org-Mode files. However, the extension will only activate automatically for LaTeX and Org-Mode are not yet implemented, but Markdown support is. Semantic HighlightingThe apropos, browse namespace, documentation and definition commands use VS’s semantic highlighting API to colourise their output. If you don’t see any highlighting, it’s likely that your theme doesn’t support it yet. Currently, Idris source files don’t use semantic highlighting. There are a few issues to work out to get it to sync with Idris in a non-terrible way. Also Idris 2 does not yet return the metadata required for semantic highlighting. To Do
AboutThe extension should be mostly stable for Idris 1, though there a few remaining unimplemented actions. Current work is focused on fixing bugs and maintaining support for Idris 2. If you run into any problems, please raise an issue, or raise a PR if you want to. There is not, nor will there ever be, telemetry in this extension (though that may not apply to VS itself). AcknowledgmentsThe syntax files are adapted from vscode-idris’s port of the Atom plugin’s grammars. License |