Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word selection is slow #12

Open
Praful opened this issue May 3, 2020 · 17 comments
Open

Word selection is slow #12

Praful opened this issue May 3, 2020 · 17 comments

Comments

@Praful
Copy link

Praful commented May 3, 2020

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
Copy link
Owner

iamcco commented May 4, 2020

Can not reproduce

@Praful
Copy link
Author

Praful commented May 4, 2020

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

@Praful
Copy link
Author

Praful commented May 6, 2020

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
Copy link
Owner

iamcco commented May 6, 2020

Disable others extensions and test only with this extension.

@Praful
Copy link
Author

Praful commented May 6, 2020

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
Copy link
Owner

iamcco commented May 6, 2020

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

@Praful
Copy link
Author

Praful commented May 6, 2020

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
Copy link
Owner

iamcco commented May 6, 2020

@Praful
Copy link
Author

Praful commented May 6, 2020

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
Copy link
Owner

iamcco commented May 7, 2020

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

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

@Praful
Copy link
Author

Praful commented May 7, 2020

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
Copy link
Owner

iamcco commented May 7, 2020

: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
Copy link
Author

Praful commented May 7, 2020

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
Copy link
Owner

iamcco commented May 8, 2020

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

@dr-costas
Copy link

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

@pauldthomson
Copy link

I'm seeing the same issue

@havrak
Copy link

havrak commented Aug 27, 2020

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=cocActionsOpenFromSelectedg@

"nmap ac (coc-codeaction)
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants