From d196ed266bf48f926050cfe5971ef5946a201c93 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Fri, 2 Jun 2023 18:03:31 +0100 Subject: [PATCH] refactor(vim): update the LSP config to better support nvim dev --- .luacheckrc | 13 +++---------- site-modules/core/files/vim/plugin/lsp.lua | 12 +++++++++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 768a8ec..fa01cab 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,12 +1,5 @@ --- Rerun tests only if their modification time changed. -cache = true - -std = luajit codes = true - -self = false - --- Global objects defined by the C code -read_globals = { - "vim", +globals = { + "vim", + "configz" } diff --git a/site-modules/core/files/vim/plugin/lsp.lua b/site-modules/core/files/vim/plugin/lsp.lua index 784f8d5..3207c21 100644 --- a/site-modules/core/files/vim/plugin/lsp.lua +++ b/site-modules/core/files/vim/plugin/lsp.lua @@ -1,5 +1,8 @@ local lspconfig = require "lspconfig" +local workspace_library = vim.api.nvim_get_runtime_file("lua", true) +table.insert(workspace_library, os.getenv("HOME") .. "/Code/src/github.com/AdeAttwood/Configz/definitions/configz.lua") + local servers = { -- Language servers for the day to day web development, could probably think -- about loosing the html and css one and living with typescript, rescript @@ -26,10 +29,13 @@ local servers = { lua_ls = { settings = { Lua = { - runtime = { version = "LuaJIT" }, - diagnostics = { globals = { "vim" } }, - workspace = { library = vim.api.nvim_get_runtime_file("", true) }, telemetry = { enable = false }, + runtime = { version = "LuaJIT" }, + diagnostics = { globals = { "vim", "configz" } }, + workspace = { + library = workspace_library, + checkThirdParty = false, + }, }, }, },