This is an experimental Cloud9 IDE plugin for Cryptol, a domain-specific language for cryptography.
This plugin should work with the legacy or AWS Cloud9 IDE.
Instructions for loading Cloud9 plugins are provided in this Cloud9 community
post.
However, this experimental plugin has not yet been published to a CDN, and the package
built via c9 build
cannot currently be loaded into the initialization script. On
legacy Cloud9, the package.json
can be loaded directly:
-
Upload all files into
~/.c9/plugins/c9.ide.language.cryptol/
. -
Add
package.json
to the arguments ofservices.pluginManager.loadPackage
in the initialization script:services.pluginManager.loadPackage([ "~/.c9/plugins/c9.ide.language.cryptol/package.json", // ... ]);
-
Save the initialization script and commit changes, e.g. by pressing
Ctrl-Enter
or reloading the page.
This plugin provides the following features:
c9.ide.language.cryptol
assigns different types to various Cryptol tokens
(e.g. keywords, numerics, operators, strings, Prelude symbols, user-defined
symbols), which the Cloud9 editor highlights with different colors according to
the current theme. Types are
somewhat consistent with
TextMate language grammars.
Syntax highlighting is automatically triggered when opening a Cryptol module
(.cry
) or batch file (.icry
). To apply Cryptol highlighting to a file with
another extension, invoke the View > Syntax > Cryptol
menu sequence.
c9.ide.language.cryptol
introduces run configurations for Cryptol modules
(.cry
) and batch files (.icry
), which can be launched automatically by
clicking the Run
button, or explicitly via the Run > Run With > Cryptol.run
(or Cryptol_interactive.run
) menu sequence. Nested modules require changing
the current working directory of the runner to the module's root folder, e.g.
via the CWD
tab in the launched terminal pane or a custom
run configuration.
c9.ide.language.cryptol
assigns Cryptol tokens to Cloud9 outline types:
- module -> package
- import -> package
- type (constraint) -> property
- symbol -> method
- property -> method2
The result is a flat view of a hierarchy of symbol definitions, including those
inside where
clauses of other definitions, which is arguably better (or worse)
than nothing. The Outline view can be toggled by clicking on the Outline
tab
in the navigation menu to the right.
c9.ide.language.cryptol
supports autocompletion of named code snippets, which
can be displayed via the configured key sequence for autocompletion (typically
Ctrl-Space
). For example, the user can type if<Ctrl-Space>
to insert an
if-then-else-with-multiway snippet. Snippets are filtered by prefix but not
by validity.
c9.ide.language.cryptol
includes very basic templates for new Cryptol modules
or interactive scripts, which can be created via the
File > New from template > Cryptol module
(or Cryptol script
) menu sequence.
c9.ide.language.cryptol
does not have any automated tests...yet. It has been
used with a variety of examples and test cases from the author as well as those
included in the Cryptol repository. In
most cases, it behaves helpfully, if not always correctly.
- Cloud9 SDK - Cloud9's plugin API
The author welcomes contributions (by way of pull requests or issues) from those interested in Cryptol and/or language tooling.
- Initial work - WeeknightMVP
See also the list of any contributors who have participated in this project.
This project is licensed under the 3-Clause BSD License - see the LICENSE.md file for details.