Skip to content

Editor Support

A language is much more enjoyable with great editor support. Although far from perfect, Hylo already has a language server, and support for various editors:

Search for the extension named “Hylo” in the marketplace (in VS or Open VSX): Hylo extension in VSCode

The language server is automatically downloaded when you open a Hylo file.

Neovim has Hylo support via LSP. You can set it up using Mason and nvim-lspconfig. Here is a full minimal init.lua example with Hylo LSP support. This will automatically download and enable the Hylo language server from the Mason registry.

-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Add file type detection for Hylo (for Neovim versions <= 0.11.5)
vim.filetype.add({
extension = {
hylo = "hylo",
},
})
-- Setup plugins
require("lazy").setup({
{
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
config = function()
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
"hylo_ls", -- Install Hylo language server using Mason
},
automatic_enable = true
})
end
}
})

See this article for more details on the development of the Neovim integration: Add Neovim Support for Your Language.

There is experimental support for JetBrains IDEs implemented in jetbrains-hylo. There are a lot of rough edges that we need to fix still, as the JetBrains LSP support is not perfect out of the box.

We have an Emacs mode for Hylo in this repository, which provides basic syntax highlighting. It is a fork of Swift’s Emacs mode, so there may still be some inconsistencies. LSP support is not yet integrated.