iamcco / coc-spell-checker

A basic spell checker that works well with camelCase code for (Neo)vim
MIT License
263 stars 14 forks source link

Word selection is slow #12

Open Praful opened 4 years ago

Praful commented 4 years ago

I've just installed coc-spell-checker. It all looks promising. I live the pop that allows you to scroll through suggestions using vim keys and even lets you add to dictionaries.

I'm finding the popup of suggestions can take 5-10 seconds to appear, which makes it unusable. Can I do anything to speed this up?

Also can I change to British English dictionary?

I'm using gvim 8.x on Windows 10.

Thanks

iamcco commented 4 years ago

Can not reproduce

Praful commented 4 years ago

How can I help diagnose this issue? Any tracing or something else?

Praful commented 4 years ago

It has become slower (I'm using <leader>aw to look up word.)

There is a message in gvim status bar: "Error on request (CocAction): request CocAction timeout after 30s"

Does that help?

If you give me tips or pointer on debugging, I can look into issue.

iamcco commented 4 years ago

Disable others extensions and test only with this extension.

Praful commented 4 years ago

I removed all extensions except coc.nvim and reduced vimrc to a few lines of initialisation and am still getting the problem!

Is there a way for me to run the plugin via a debugger so that I can see where the problem is?

iamcco commented 4 years ago

set "cSpell.trace.server": "verbose" and checkout output channel of cSpell.

Praful commented 4 years ago

I've made the change in <vimhome>\.coc-settings.json.

How do I view the output channel of cSpell? Is it a log file and if so which folder?

Thanks

iamcco commented 4 years ago

No, change your coc-settings.json and https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

Praful commented 4 years ago

I have made the change but nothing is reported by :CocCommand workspace.showOutput. I also added Python and explorer tracing and nothing is being reported for them either. My coc-settings.json file is:

{
  "python.trace.server": "verbose",
  "explorer.trace.server": "verbose",
  "cSpell.trace.server": "verbose",
  "cSpell.language": "en-GB",
  "cSpell.userWords": [
    "numpy",
    "tartine"
  ]
}

What am I doing wrong?!

Thanks

iamcco commented 4 years ago

I have made the change but nothing is reported by :CocCommand workspace.showOutput

Don't know what happen with your coc.nvim.

Praful commented 4 years ago

I upgraded Node to v14 but that didn't make a difference. However, I ran :CocInfo and the trace was shown. When I uploaded that to the MS LSP inspector, no task was taking more than a few milliseconds.

I tried installing coc-actions but that is supported on nvim only.

Finally, I ran :CocFix instead of <leader>aw to correct a spelling. Immediately, :CocFix showed what is shown by <leader>aw except it was shown in a separate small window above the status bar.

This is fine - I prefer the popup but since it takes a long time to appear, a window at the bottom with spelling corrections (and other coc-spell-checker options) is more than good enough.

Perhaps knowing that :CocFix is fast and and <leader>aw is slow might help you?

Thanks for your help.

iamcco commented 4 years ago

:CocFix is fast means this extension response is fast, and the actions window is not show by this extension, it only offer code actions for coc.nvim. So it's not the problem of this extension. You should checkout your key mapping or others.

Praful commented 4 years ago

Thanks. I've tried other mappings with the same result. And as mentioned above, I removed all vimrc mappings and extensions with the same result.

The keyboard mapping I used comes from the readme:

vmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)

I've tried other letters.

Is there a way of creating individual mappings for lookup word, paragraph, etc instead of using the <Plug> method?

iamcco commented 4 years ago

The mapping is coc's thing. Other way you can use :call CocActionAsync('codeAction')

dr-costas commented 4 years ago

I have exactly the same problem. The pop up window takes lot of time, and I get the timeout after 60s error message.

pauldthomson commented 4 years ago

I'm seeing the same issue

havrak commented 4 years ago

Adding another enter when using coc-actions solved the issue for me. Also for maximal speed it is necessary to remove all other key mappings that use the a combo. Menu isn't super fast but the time to open is nowhere near reported 60s, it is maybe 2-3 s.

`nnoremap a :set operatorfunc=SID>cocActionsOpenFromSelected<CR>g@<CR

"nmap ac (coc-codeaction) `