neoclide / coc-solargraph

Solargraph extension for coc.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Format provider not found

nomasprime opened this issue · comments

Getting this error message in log:

2020-10-12T01:39:11.216 WARN (pid:1743) [Handler] - format provider not found!

Settings:

"solargraph.diagnostics": true,
"solargraph.formatting": true,
"solargraph.autoformat": true

Upgrade your solargraph

I'm on 0.39.17 [latest].

You have to enable format by "solargraph.formatting": true,

@chemzqm my mistake, I was accidentally overwriting settings. Apologies for wasting time.

Quick related question, what's this line for in coc.nvim readme and why just typescript and json?

autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')

It's just example since coc-json and coc-tsserver have support for range format.

@chemzqm assume you mean textDocument/foldingRange, thanks.

commented

@nomasprime I have the same situation as you,
[coc.nvim]: Error on notification "formatSelected": formatRange provider not found for current buffer, your language server doesn't support it. support it.
If you have had any success formatting in ruby files, could you please tell me how to set the formatRange provider?

Good question…I disabled Solargraph formatting and switched to coc-diagnostic for all formatting and linting, essentially the LSP equivalent of NeoMake. Actually did this across all language specific LSPs because it's a better solution for consistently configuring these tools.

commented

@nomasprime Thank you for your reply. I switched to coc-diagnostic.

You're welcome @ikneg 🙂

@nomasprime cold you share your coc-diagnostic config? I've been trying to getCocAction('Format') binding to work with ruby.rspec filetype. I'm using rspec.vim for syntax highlighting and it sets *_spec.rb* filtype to ruby.rspec` which does not get mapped to solargraph format provider.