From 4d836e8ca03a2de86f3b63091bb15cce354a8630 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sat, 30 Dec 2023 15:07:27 +1100 Subject: [PATCH] ci: add lsp to diagnostics --- .github/workflows/ci.yml | 2 +- .luarc.json | 6 ++++++ lua/nvim-tree/diagnostics.lua | 3 --- scripts/luals-check.sh | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc2a4482..ca6dec54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,4 +59,4 @@ jobs: - name: lua-language-server --check run: | - PATH="luals/bin:${PATH}" scripts/luals-check.sh + VIMRUNTIME=/home/runner/nvim-v0.9.4 PATH="luals/bin:${PATH}" scripts/luals-check.sh diff --git a/.luarc.json b/.luarc.json index 6ae9cf62..2f25d795 100644 --- a/.luarc.json +++ b/.luarc.json @@ -1,7 +1,13 @@ { "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", "runtime.version" : "Lua 5.1", + "workspace": { + "library": [ + "$VIMRUNTIME/lua/vim/lsp" + ] + }, "diagnostics": { + "libraryFiles": "Disable", "globals": [ "vim" ], diff --git a/lua/nvim-tree/diagnostics.lua b/lua/nvim-tree/diagnostics.lua index 6ca13c9c..6d0e1354 100644 --- a/lua/nvim-tree/diagnostics.lua +++ b/lua/nvim-tree/diagnostics.lua @@ -4,9 +4,6 @@ local log = require "nvim-tree.log" local M = {} ----TODO add "$VIMRUNTIME" to "workspace.library" and use the @enum instead of this integer ----@alias lsp.DiagnosticSeverity integer - ---COC severity level strings to LSP severity levels ---@enum COC_SEVERITY_LEVELS local COC_SEVERITY_LEVELS = { diff --git a/scripts/luals-check.sh b/scripts/luals-check.sh index f841fedf..9d8ddc74 100755 --- a/scripts/luals-check.sh +++ b/scripts/luals-check.sh @@ -12,7 +12,7 @@ rm -rf "${DIR_OUT}" mkdir "${DIR_OUT}" # execute inside lua to prevent luals itself from being checked -OUT=$(lua-language-server --check "${DIR_SRC}" --configpath="${PWD}/.luarc.json" --checklevel=Information --logpath="${DIR_OUT}" --loglevel=error) +OUT=$(lua-language-server --check="${DIR_SRC}" --configpath="${PWD}/.luarc.json" --checklevel=Information --logpath="${DIR_OUT}" --loglevel=error) RC=$? echo "${OUT}" >&2