Closed cvincent closed 4 years ago
First, As far as I looked this, solargraph does not handle @
, Language server client just send whole content and cursor location.
In your log file, I can't find init_result. init_result include options completionProvider that have marker character. ex: @
, .
, ::
Second, you seems not set iskeyword option for ruby filetype. please try to add @-@
to iskeyword.
set iskeyword+=@-@
Unfortunately LSP does not define startcol and word_pattern. Plugins need to add workaround for this.
This issue is fixed in ncm2 https://github.com/ncm2/ncm2/commit/48058b7c5ff1dd47e1683c288e5b410be9ac4503
This should be fixed in https://github.com/prabirshrestha/vim-lsp/pull/253
LSP have prepareRename. vim-lsp added it in #253. And latset version of solargraph added prepareRename. (I implemented in https://github.com/castwide/solargraph/pull/158). So no need to do workaround, I think.
Thanks for the info! @mattn
However, I don't enjoy chaining a prepareRename in the middle of completion request. (EDIT: As described by its name, it is not designed for completion.)
For about completion, afaik, vim-lsp stoped to calculate findstart...
This issue is fixed in ncm2 ncm2/ncm2@48058b7
@roxma this seems to work great for @foo
and $foo
, but auto-completing :foo
still results in ::foo
. I also tried set iskeyword+=:
but that didn't help.
@toupeira
but auto-completing :foo still results in ::foo
Fixed in https://github.com/ncm2/ncm2/commit/5549ae88f5496bb6a6108ede83a20d35e1201975
@roxma thanks a lot, works perfectly now! :+1:
I'm seeing two different issues using
vim-lsp
with Solargraph which are possibly related.First, when autocompleting an instance variable following
@
, the resulting completion includes the@
resulting in@@
. Here is the RPC log resulting from triggering a completion by typing@
:Second, when using
:LspRename
on any variable with a sigil, such as@instance_var
or$global_var
, it appears to work when the cursor is on the character following the sigil (so on thei
in@instance_var
, but when the cursor is on the sigil itself (@
), it does the replacement but removes the sigil (so@instance_var
becomesinstance_var_renamed
everywhere). I can get around this by manually adding the missing sigil to the rename prompt, but it should already be present. Here is the RPC log output when I issue:LspRename
on a variable's sigil:This could very well be an issue with
ncm2
,ncm2-vim-lsp
, or Solargraph, but I have no idea where to begin.Here's my minimal NeoVim config reproducing this issue:
And my
nvim --version
output:Thank you for any help, and let me know if I can provide further information to assist.