Skip to content

Commit

Permalink
fix(lsp): prevent nil upvalue index on workspace folder change (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Oct 25, 2023
1 parent 6894f31 commit 6145ce2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions lua/rustaceanvim/lsp.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6145ce2

Please sign in to comment.