Skip to content

Commit

Permalink
Add roc
Browse files Browse the repository at this point in the history
  • Loading branch information
hbibel committed Aug 22, 2024
1 parent d607f99 commit b1a3ae8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ local rust = require('custom.rust')
local python = require('custom.python')
local keymaps = require('custom.keymaps')
local helm = require("custom.helm")
local roc = require("custom.roc")
keymaps.basic()

require('custom.commands').basic()
Expand All @@ -29,6 +30,7 @@ scala.init(lsp.on_attach)
rust.init()
python.init(lsp.on_attach)
helm.init()
roc.init()

local group = vim.api.nvim_create_augroup('OverrideMelange', {})
vim.api.nvim_create_autocmd('ColorScheme', {
Expand Down
1 change: 1 addition & 0 deletions lua/custom/plugins/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local setup = function()
"astro",
"markdown",
"terraform",
"roc",
},

auto_install = false,
Expand Down
22 changes: 22 additions & 0 deletions lua/custom/roc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local M = {}

M.init = function()
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.roc" },
command = "set filetype=roc",
})

-- add roc tree-sitter
local parsers = require("nvim-treesitter.parsers").get_parser_configs()

parsers.roc = {
install_info = {
url = "https://github.com/faldor20/tree-sitter-roc",
files = { "src/parser.c", "src/scanner.c" },
},
}

require("lspconfig").roc_ls.setup({})
end

return M

0 comments on commit b1a3ae8

Please sign in to comment.