From 9dc0dd7929ef1fd7f16a4bc3f8bf53df2084e139 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Wed, 25 Oct 2023 13:14:46 +0200 Subject: [PATCH] fix(lsp): prevent `nil` upvalue index on workspace folder change --- CHANGELOG.md | 11 ++++++++--- lua/rustaceanvim/lsp.lua | 3 +-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b95ddaa..da0d2801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,18 +5,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.0.3] - 2023-10-25 +### Fixed +- Potential attempt to index `nil` upvalue when sending `workspace/didChangeWorkspaceFolders` + to LSP server [[#22](https://github.com/mrcjkb/rustaceanvim/issues/22)]. + ## [3.0.2] - 2023-10-23 ### Fixed - Hover actions: Tree-sitter syntax highlighting - in Neovim 0.9 [#20](https://github.com/mrcjkb/rustaceanvim/issues/20). + in Neovim 0.9 [[#20](https://github.com/mrcjkb/rustaceanvim/issues/20)]. ## [3.0.1] - 2023-10-23 ### Fixed - Add support for `workspace/didChangeWorkspaceFolders` to prevent more than one - rust-analyzer server from spawning per Neovim instance [#7](https://github.com/mrcjkb/rustaceanvim/issues/7). -- Neovim 0.9 compatibility [#9](https://github.com/mrcjkb/rustaceanvim/issues/9). + rust-analyzer server from spawning per Neovim instance [[#7](https://github.com/mrcjkb/rustaceanvim/issues/7)]. +- Neovim 0.9 compatibility [[#9](https://github.com/mrcjkb/rustaceanvim/issues/9)]. ## [3.0.0] - 2023-10-22 diff --git a/lua/rustaceanvim/lsp.lua b/lua/rustaceanvim/lsp.lua index a45f8cb4..55bc2f0d 100644 --- a/lua/rustaceanvim/lsp.lua +++ b/lua/rustaceanvim/lsp.lua @@ -1,7 +1,6 @@ local M = {} ---@type RustaceanConfig local config = require('rustaceanvim.config.internal') -local methods = require('vim.lsp.protocol').Methods local compat = require('rustaceanvim.compat') local rust_analyzer = require('rustaceanvim.rust_analyzer') local joinpath = compat.joinpath @@ -107,7 +106,7 @@ M.start = function() removed = {}, }, } - client.rpc.notify(methods.workspace_didChangeWorkspaceFolders, params) + client.rpc.notify('workspace/didChangeWorkspaceFolders', params) if not client.workspace_folders then client.workspace_folders = {} end