This project was originally part of SimplicityHL, the high-level language for writing Simplicity smart contracts.
Language Server for SimplicityHL language.
- Basic diagnostic for SimplicityHL code
- Completions of built-ins, jets and functions
- Hover for built-ins, jets and functions, with support of documentation
- Go to definition for functions
Editors send settings under the simplicityhl section. Every field is optional; the
defaults below are what the server uses when a client sends nothing.
{
"simplicityhl": {
"experimentalFeatures": {
"imports": false
},
"project": {
"simplex": {
"enabled": true,
"manifestPath": ""
},
"sourceDirectory": "",
"dependencies": {}
}
}
}experimentalFeatures.importsenables the compiler's unstableuse/mod/pubsyntax. It is off by default because the feature is unstable in the compiler itself.project.simplex.enabledlooks for the nearestSimplex.toml(orsimplex.toml) in the file's ancestors and honours itsbuild.src_dirand[dependencies], resolving path dependencies recursively and locating installed git dependencies underdeps/.project.simplex.manifestPathpins an explicit manifest instead of searching. Relative values resolve from the containing workspace folder. A path that does not exist is reported as a diagnostic rather than silently ignored.project.sourceDirectoryoverrides the package root when there is no manifest, or when the manifest'ssrc_diris not what the editor should use.project.dependenciesadds import roots by hand. They supplement the manifest and win on a colliding alias:
{
"std": "../simplicityhl-std/simf",
"math": { "path": "../math/simf", "context": "simf/contracts" }
}The shorthand form maps an alias for the whole package. The detailed form restricts the
mapping to files under context, matching how the compiler scopes dependencies per
package.
Configuration changes take effect immediately: the server re-analyses open documents on
workspace/didChangeConfiguration, on workspace-folder changes, and when a watched
.simf file or Simplex manifest changes on disk.
Install Language Server using cargo:
cargo install simplicityhl-lsp-
Install
simplicityhl-lspto yourPATH. -
Include this Lua snippet to your Neovim config:
vim.filetype.add({
extension = {
simf = "simf",
},
})
vim.lsp.config["simplicityhl-lsp"] = {
cmd = { "simplicityhl-lsp" },
filetypes = { "simf" },
settings = {
simplicityhl = {
experimentalFeatures = { imports = true },
project = { simplex = { enabled = true, manifestPath = "" } },
},
},
}
vim.lsp.enable("simplicityhl-lsp")- Open
.simffile and check that LSP is active ("attached"):
:checkhealth vim.lspCurrently, the Language Server does not provide any syntax highlighting on its own, but you can install tree-sitter for SimplicityHL:
-
Set up the
nvim-treesitterplugin. -
Include this Lua snippet in your Neovim config to register parser:
vim.api.nvim_create_autocmd("User", {
pattern = "TSUpdate",
callback = function()
require("nvim-treesitter.parsers").simplicityhl = {
install_info = {
url = "https://github.com/distributed-lab/tree-sitter-simplicityhl",
queries = "queries",
},
filetype = "simf",
tier = 0,
}
end,
})
vim.treesitter.language.register("simplicityhl", { "simf" })
vim.api.nvim_create_autocmd("FileType", {
pattern = { "simf" },
callback = function()
vim.treesitter.start()
end,
})- Restart Neovim and run:
:TSInstall simplicityhlIf everything is working correctly, you should see syntax highlighting in .simf files.
Note: This method is compatible only with nvim-treesitter v0.10 or newer.



