Closed GopherJ closed 3 weeks ago
the error message that I got is:
[coc.nvim] Organize import action not found
Can't reproduce, the editor.action.organizeImport
command works as expected.
Enable the verbose
trace logs, search organizeImports
request and response to check the logs from the server.
@fannheyward I turned on verbose and when I trigger
command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')
there doesn't seem to be any trace related to organizeimports
here the whole log
Your logs didn't contain the organizeImports
codeAction request, make sure you've triggered it correctly.
@fannheyward as I said I triggered it but somehow nothing sent to the server and nothing happened
After you trigger editor.action.organizeImport
command, coc.nvim will request codeActions from language server, with source.organizeImports
kind to find organizedImport codeAction.
The rust-analyzer didn't provide source.organizeImports
support, you can search codeActionProvider
in the trace logs and rust-analyzer didn't provide source.organizeImports
kind , coc.nvim couldn't find any codeAction, didn't send request and notify you with Organize import action not found
.
You can also test gopls
and you will find gopls provided source.organizeImports
kind codeAction.
thanks that makes it more clear, gopls didn't work on my side, do you use coc-go or gopls directly?
Lol I just didn't a different test and gopls worked! so maybe it just didn't work in simple main.go case
ok it will work if I add:
package main
so I think it's rust-analyzer which caused confusion, I had memories its organize import works before, I'll double check
ok rust-analyzer still didn't implement it
Result from CocInfo
Describe the bug
I haven't used this features for months because it seems broken for months OR I misconfigured something, this feature stopped working for:
Reproduce the bug
https://github.com/GopherJ/dotfiles/blob/cb8ac4fc333890a779bbb7223a9f2b4e85c3357f/coc/.vimrc#L602
main.go
with:Create file
main.go
with:Start (neo)vim with command:
vim -u mini.vim
Operate vim.
Screenshots (optional)
If applicable, add screenshots to help explain your problem.