From a1b6744e1f46caff4e532058135fed865dd7e955 Mon Sep 17 00:00:00 2001 From: Lukas Reineke Date: Fri, 17 May 2024 12:55:52 +0900 Subject: [PATCH] chore: update to nvim 0.10 --- .github/workflows/pr_check.yml | 6 +++--- Makefile | 5 ++++- lua/ibl/highlights.lua | 8 +------- lua/ibl/init.lua | 1 - lua/ibl/scope.lua | 2 +- lua/ibl/utils.lua | 7 ++----- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 464baa97..ed783140 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -12,14 +12,14 @@ jobs: uses: ./.github/workflows/tests.yml with: neovim_versions: | - [ "nightly", "v0.9.4" ] + [ "nightly", "v0.10.0" ] lua-language-server: uses: ./.github/workflows/lua_language_server.yml with: - lua_ls_version: 3.7.0 + lua_ls_version: 3.9.1 neovim_versions: | - [ "nightly", "v0.9.4" ] + [ "nightly", "v0.10.0" ] stylua: name: stylua diff --git a/Makefile b/Makefile index fd53a702..5acc6be8 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,10 @@ stylua: lua-language-server: dependencies rm -rf .ci/lua-language-server-log lua-language-server --configpath .luarc.$(version).json --logpath .ci/lua-language-server-log --check . - [ -f .ci/lua-language-server-log/check.json ] && { cat .ci/lua-language-server-log/check.json 2>/dev/null; exit 1; } || true + @if jq -e 'if . | length > 0 then true else false end' .ci/lua-language-server-log/check.json > /dev/null; then \ + cat .ci/lua-language-server-log/check.json; \ + exit 1; \ + fi dependencies: if [ ! -d .ci/vendor ]; then \ diff --git a/lua/ibl/highlights.lua b/lua/ibl/highlights.lua index 53e5a529..c3425148 100644 --- a/lua/ibl/highlights.lua +++ b/lua/ibl/highlights.lua @@ -17,13 +17,7 @@ local M = { ---@param name string local get = function(name) - -- TODO [Lukas]: remove this when AstroNvim drops support for 0.8 - if not vim.api.nvim_get_hl then - ---@diagnostic disable-next-line - return (vim.fn.hlexists(name) == 1 and vim.api.nvim_get_hl_by_name(name, true)) or vim.empty_dict() --[[@as table]] - end - - return vim.api.nvim_get_hl(0, { name = name }) + return vim.api.nvim_get_hl(0, { name = name }) --[[@as vim.api.keyset.highlight]] end ---@param hl table diff --git a/lua/ibl/init.lua b/lua/ibl/init.lua index d83d3125..52632b33 100644 --- a/lua/ibl/init.lua +++ b/lua/ibl/init.lua @@ -12,7 +12,6 @@ local namespace = vim.api.nvim_create_namespace "indent_blankline" local M = {} ----@package M.initialized = false ---@type table diff --git a/lua/ibl/scope.lua b/lua/ibl/scope.lua index 3380cdd7..379dcd59 100644 --- a/lua/ibl/scope.lua +++ b/lua/ibl/scope.lua @@ -12,7 +12,7 @@ end --- Takes a language tree and a range, and returns the child language tree for that range --- ----@param language_tree LanguageTree +---@param language_tree vim.treesitter.LanguageTree ---@param range table ---@param config ibl.config.full M.language_for_range = function(language_tree, range, config) diff --git a/lua/ibl/utils.lua b/lua/ibl/utils.lua index dc52a989..a76c775c 100644 --- a/lua/ibl/utils.lua +++ b/lua/ibl/utils.lua @@ -247,6 +247,7 @@ end ---@return ibl.listchars M.get_listchars = function(bufnr) local listchars + ---@diagnostic disable-next-line local list = vim.opt.list:get() if list then listchars = vim.opt.listchars:get() @@ -424,11 +425,7 @@ end ---@vararg T ---@return T M.tbl_join = function(...) - local result = {} - for i, v in ipairs(vim.tbl_flatten { ... }) do - result[i] = v - end - return result + return vim.iter({ ... }):flatten():totable() end ---@generic T