Created
September 28, 2021 23:53
-
-
Save d-miketa/1a44ca54c0c6abf5685b746b763eac03 to your computer and use it in GitHub Desktop.
Efm breaks vim.lsp.buf.rename()?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
a_string = 'rename me!' | |
return a_string | |
if __name__ == "__main__": | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- install packer | |
local fn = vim.fn | |
local cmd = vim.cmd | |
local install_path = '/tmp/nvim/site/pack/packer/start/packer.nvim' | |
cmd('set packpath=/tmp/nvim/site') | |
local function load_plugins() | |
local packer = require('packer') | |
local use = packer.use | |
packer.reset() | |
packer.init {package_root = '/tmp/nvim/site/pack', git = {clone_timeout = -1}} | |
use 'wbthomason/packer.nvim' | |
use 'neovim/nvim-lspconfig' | |
use 'kabouzeid/nvim-lspinstall' | |
packer.sync() | |
end | |
_G.load_config = function() | |
cmd('set termguicolors') | |
-- Replace this part of the config with whatever configuration you're using | |
require'lspinstall'.setup() | |
require'lspinstall'.install_server('efm') | |
require'lspinstall'.install_server('python') | |
require'lspconfig'.python.setup {} | |
require'lspconfig'.efm.setup {filetypes = {'python'}} | |
vim.api.nvim_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', {noremap = true, silent = true}) | |
end | |
if fn.isdirectory(install_path) == 0 then | |
fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path}) | |
end | |
load_plugins() | |
cmd('autocmd User PackerComplete ++once lua load_config()') | |
load_config() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with
nvim --noplugin -u minimal_init.lua main.py
. Once both pyright and efm are downloaded, attempt to renamea_string
using<space>rn
. The dialogue will repeat itself. Afterwards, two changes are recorded.It appears both language servers (pyright and efm) are being asked to rename the string, or that pyright is being asked twice? Removing efm fixes the issue.