Просмотр исходного кода

fix(plugins): handle deprecated options (#3014)

kylo252 2 лет назад
Родитель
Сommit
7535f4eff9
4 измененных файлов с 54 добавлено и 46 удалено
  1. 12 4
      lua/lvim/core/bufferline.lua
  2. 17 17
      lua/lvim/lsp/providers/sumneko_lua.lua
  3. 23 23
      snapshots/default.json
  4. 2 2
      utils/ci/verify_plugins.lua

+ 12 - 4
lua/lvim/core/bufferline.lua

@@ -52,15 +52,16 @@ M.config = function()
       },
       },
     },
     },
     options = {
     options = {
+      mode = "buffers", -- set to "tabs" to only show tabpages instead
       numbers = "none", -- can be "none" | "ordinal" | "buffer_id" | "both" | function
       numbers = "none", -- can be "none" | "ordinal" | "buffer_id" | "both" | function
       close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
       close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
       right_mouse_command = "vert sbuffer %d", -- can be a string | function, see "Mouse actions"
       right_mouse_command = "vert sbuffer %d", -- can be a string | function, see "Mouse actions"
       left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
       left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
       middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
       middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
-      -- NOTE: this plugin is designed with this icon in mind,
-      -- and so changing this is NOT recommended, this is intended
-      -- as an escape hatch for people who cannot bear it for whatever reason
-      indicator_icon = "▎",
+      indicator = {
+        icon = "▎", -- this should be omitted if indicator style is not 'icon'
+        style = "icon", -- can also be 'underline'|'none',
+      },
       buffer_close_icon = "",
       buffer_close_icon = "",
       modified_icon = "●",
       modified_icon = "●",
       close_icon = "",
       close_icon = "",
@@ -78,6 +79,7 @@ M.config = function()
       end,
       end,
       max_name_length = 18,
       max_name_length = 18,
       max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
       max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
+      truncate_names = true, -- whether or not tab names should be truncated
       tab_size = 18,
       tab_size = 18,
       diagnostics = "nvim_lsp",
       diagnostics = "nvim_lsp",
       diagnostics_update_in_insert = false,
       diagnostics_update_in_insert = false,
@@ -115,6 +117,7 @@ M.config = function()
           padding = 1,
           padding = 1,
         },
         },
       },
       },
+      color_icons = true, -- whether or not to add the filetype icon highlights
       show_buffer_icons = lvim.use_icons, -- disable filetype icons for buffers
       show_buffer_icons = lvim.use_icons, -- disable filetype icons for buffers
       show_buffer_close_icons = lvim.use_icons,
       show_buffer_close_icons = lvim.use_icons,
       show_close_icon = false,
       show_close_icon = false,
@@ -125,6 +128,11 @@ M.config = function()
       separator_style = "thin",
       separator_style = "thin",
       enforce_regular_tabs = false,
       enforce_regular_tabs = false,
       always_show_bufferline = false,
       always_show_bufferline = false,
+      hover = {
+        enabled = false, -- requires nvim 0.8+
+        delay = 200,
+        reveal = { "close" },
+      },
       sort_by = "id",
       sort_by = "id",
     },
     },
   }
   }

+ 17 - 17
lua/lvim/lsp/providers/sumneko_lua.lua

@@ -1,3 +1,19 @@
+local dev_opts = {
+  library = {
+    vimruntime = true, -- runtime path
+    types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others
+    -- plugins = true, -- installed opt or start plugins in packpath
+    -- you can also specify the list of plugins to make available as a workspace library
+    plugins = { "plenary.nvim" },
+  },
+  override = nil, -- function(root_dir, options) end,
+}
+
+local lua_dev_loaded, lua_dev = pcall(require, "lua-dev")
+if lua_dev_loaded then
+  lua_dev.setup(dev_opts)
+end
+
 local opts = {
 local opts = {
   settings = {
   settings = {
     Lua = {
     Lua = {
@@ -15,20 +31,4 @@ local opts = {
   },
   },
 }
 }
 
 
-local lua_dev_loaded, lua_dev = pcall(require, "lua-dev")
-if not lua_dev_loaded then
-  return opts
-end
-
-local dev_opts = {
-  library = {
-    vimruntime = true, -- runtime path
-    types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others
-    -- plugins = true, -- installed opt or start plugins in packpath
-    -- you can also specify the list of plugins to make available as a workspace library
-    plugins = { "plenary.nvim" },
-  },
-  lspconfig = opts,
-}
-
-return lua_dev.setup(dev_opts)
+return opts

+ 23 - 23
snapshots/default.json

@@ -6,13 +6,13 @@
     "commit": "5aa5ff1"
     "commit": "5aa5ff1"
   },
   },
   "LuaSnip": {
   "LuaSnip": {
-    "commit": "a45cd5f"
+    "commit": "6e506ce"
   },
   },
   "alpha-nvim": {
   "alpha-nvim": {
-    "commit": "09e5374"
+    "commit": "0bb6fc0"
   },
   },
   "bufferline.nvim": {
   "bufferline.nvim": {
-    "commit": "0b4b863"
+    "commit": "ffa1d00"
   },
   },
   "cmp-buffer": {
   "cmp-buffer": {
     "commit": "3022dbc"
     "commit": "3022dbc"
@@ -30,49 +30,49 @@
     "commit": "3679132"
     "commit": "3679132"
   },
   },
   "friendly-snippets": {
   "friendly-snippets": {
-    "commit": "e5a16f9"
+    "commit": "22a9975"
   },
   },
   "gitsigns.nvim": {
   "gitsigns.nvim": {
     "commit": "d7e0bcb"
     "commit": "d7e0bcb"
   },
   },
   "lua-dev.nvim": {
   "lua-dev.nvim": {
-    "commit": "9381ad0"
+    "commit": "fd7a18e"
   },
   },
   "lualine.nvim": {
   "lualine.nvim": {
-    "commit": "3cf4540"
+    "commit": "a52f078"
   },
   },
   "mason-lspconfig.nvim": {
   "mason-lspconfig.nvim": {
-    "commit": "328eb72"
+    "commit": "1534b61"
   },
   },
   "mason.nvim": {
   "mason.nvim": {
-    "commit": "f1cb597"
+    "commit": "b56ea0b"
   },
   },
   "nlsp-settings.nvim": {
   "nlsp-settings.nvim": {
-    "commit": "633feef"
+    "commit": "e1fcc6e"
   },
   },
   "null-ls.nvim": {
   "null-ls.nvim": {
-    "commit": "7cd491b"
+    "commit": "bf02782"
   },
   },
   "nvim-autopairs": {
   "nvim-autopairs": {
-    "commit": "0a18e10"
+    "commit": "5fe2441"
   },
   },
   "nvim-cmp": {
   "nvim-cmp": {
-    "commit": "33fbb2c"
+    "commit": "913eb85"
   },
   },
   "nvim-dap": {
   "nvim-dap": {
-    "commit": "ea25d6d"
+    "commit": "d9b315a"
   },
   },
   "nvim-lspconfig": {
   "nvim-lspconfig": {
-    "commit": "0fafc3e"
+    "commit": "f8b3c24"
   },
   },
   "nvim-notify": {
   "nvim-notify": {
-    "commit": "6b779c9"
+    "commit": "7076ce8"
   },
   },
   "nvim-tree.lua": {
   "nvim-tree.lua": {
-    "commit": "951e10a"
+    "commit": "fb8735e"
   },
   },
   "nvim-treesitter": {
   "nvim-treesitter": {
-    "commit": "1506334"
+    "commit": "2eaf188"
   },
   },
   "nvim-ts-context-commentstring": {
   "nvim-ts-context-commentstring": {
     "commit": "4d3a68c"
     "commit": "4d3a68c"
@@ -84,7 +84,7 @@
     "commit": "b00dd21"
     "commit": "b00dd21"
   },
   },
   "packer.nvim": {
   "packer.nvim": {
-    "commit": "537669b"
+    "commit": "6afb674"
   },
   },
   "plenary.nvim": {
   "plenary.nvim": {
     "commit": "4b66054"
     "commit": "4b66054"
@@ -96,21 +96,21 @@
     "commit": "090bb11"
     "commit": "090bb11"
   },
   },
   "schemastore.nvim": {
   "schemastore.nvim": {
-    "commit": "e729173"
+    "commit": "92efc7c"
   },
   },
   "structlog.nvim": {
   "structlog.nvim": {
     "commit": "232a8e2"
     "commit": "232a8e2"
   },
   },
   "telescope-fzf-native.nvim": {
   "telescope-fzf-native.nvim": {
-    "commit": "6791f74"
+    "commit": "65c0ee3"
   },
   },
   "telescope.nvim": {
   "telescope.nvim": {
-    "commit": "8dce937"
+    "commit": "0b1c41a"
   },
   },
   "toggleterm.nvim": {
   "toggleterm.nvim": {
-    "commit": "7abb25e"
+    "commit": "5e393e5"
   },
   },
   "which-key.nvim": {
   "which-key.nvim": {
-    "commit": "439637d"
+    "commit": "d5f0c63"
   }
   }
 }
 }

+ 2 - 2
utils/ci/verify_plugins.lua

@@ -112,7 +112,7 @@ local function verify_core_plugins(verbose)
           io.write(fmt("verified [%s]\n", entry.name))
           io.write(fmt("verified [%s]\n", entry.name))
         end
         end
       end
       end
-      local current_commit = result:gsub("\n", ""):gsub([[']], [[]])
+      local current_commit = result:gsub("\n", ""):gsub([[']], [[]]):sub(1, 7)
       -- just in case there are some extra qutoes or it's a longer commit hash
       -- just in case there are some extra qutoes or it's a longer commit hash
       if current_commit ~= entry.commit then
       if current_commit ~= entry.commit then
         io.write(fmt("mismatch at [%s]: expected [%s], got [%s]\n", entry.name, entry.commit, current_commit))
         io.write(fmt("mismatch at [%s]: expected [%s], got [%s]\n", entry.name, entry.commit, current_commit))
@@ -120,7 +120,7 @@ local function verify_core_plugins(verbose)
       end
       end
     end
     end
 
 
-    local handle = call_proc("git", { args = { "log", "--pretty='%h'", "-1" }, cwd = entry.path }, on_done)
+    local handle = call_proc("git", { args = { "rev-parse", "--short", "HEAD" }, cwd = entry.path }, on_done)
     assert(handle)
     assert(handle)
     table.insert(active_jobs, handle)
     table.insert(active_jobs, handle)
   end
   end