From aa5fa139898c37ec67feb7c5530f2c939a54f2c6 Mon Sep 17 00:00:00 2001 From: Tyler White Date: Tue, 7 Mar 2023 10:35:43 -0800 Subject: [PATCH] Added odin tree-sitter and ols support, removed lua LSP because they changed the name and it's still a sketchy pos. --- init.lua | 30 ++++++++++++++++++------------ lua/buildcmd.lua | 2 +- lua/keybindings.lua | 28 +++------------------------- 3 files changed, 22 insertions(+), 38 deletions(-) diff --git a/init.lua b/init.lua index 4a81fe9..8e4274e 100644 --- a/init.lua +++ b/init.lua @@ -69,15 +69,21 @@ local parser_config = require "nvim-treesitter.parsers".get_parser_configs() -- }, -- filetype = "zu", --} ---vim.filetype.add({ --- extension = { --- odin = "odin" --- } ---}) ---parser_config.odin = { --- install_info = { --- url = "D:\\Code\\odin\\tree-sitter-odin", --- files = {"src/parser.c"} --- }, --- filetype = "odin", ---} +vim.filetype.add({ + extension = { + odin = "odin" + } +}) + +if (vim.loop.os_uname().sysname == "Windows_NT") then + url = "D:\\Code\\odin\\tree-sitter-odin" +else + url = "~/code/odin/tree-sitter-odin" +end +parser_config.odin = { + install_info = { + url = url, + files = {"src/parser.c"} + }, + filetype = "odin", +} diff --git a/lua/buildcmd.lua b/lua/buildcmd.lua index 54e0cf0..c8349b9 100644 --- a/lua/buildcmd.lua +++ b/lua/buildcmd.lua @@ -21,7 +21,7 @@ local function get_build_cmd() return "build.bat" else -- TODO(twig): this is untested! - return "build.sh" + return "./build.sh" end end end diff --git a/lua/keybindings.lua b/lua/keybindings.lua index ca8a20b..b9781a4 100644 --- a/lua/keybindings.lua +++ b/lua/keybindings.lua @@ -60,31 +60,9 @@ lspconfig.clangd.setup{ end } } --- honestly don't need this, telemetry is a big yikes. -lspconfig.sumneko_lua.setup{ - on_attach = on_attach, - flags = lsp_flags, - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = {'vim'}, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, -} lspconfig.rust_analyzer.setup{ on_attach = on_attach, } +lspconfig.ols.setup{ + on_attach = on_attach, +}