company-mode: no completions found

Emacs Asked by Steven L. on October 29, 2020

I am new to emacs (long-time vim user). Specifically, I am using doom-emacs.

Doom is supposedly set up to use company-mode for auto completion, but I have not gotten it to work. I have the following source code:

class CompleteUserBankruptcyJob < ApplicationJob
  queue_as :default

  def perform(user)

If I type in def perfo, I would expect company to suggest perform. However, it does not suggest anything at all. If I manually trigger suggestions via C-SPC, it says "No completion found". Finally, if I run company-diag in the buffer, I get the following information:

Emacs 27.1 (x86_64-apple-darwin18.7.0) of 2020-08-12 on
Company 0.9.13

company-backends: (company-capf company-yasnippet)

Used backend: company-yasnippet
Major mode: ruby-mode
Prefix: nil
Completions: none

I have no idea how to debug further. If it is any help, I have my personal configuration files in this repo, but I have not modified any company-mode related settings, so it should all be using the default from doom-emacs, which for company I believe are located here. Finally, I believe that the list of backends is not being set correctly in ruby major mode (and may be failing in other modes as well), given the references to company in this file.

One Answer

I'm not sure which completion backend Doom uses by default these days for Ruby (whether it's LSP or Robe), but the Troubleshooting section of company/ says this:

For instance, go-mode requires guru to be installed on your system, and ruby-mode requires that you have a Robe server running (M-x robe-start).

Meaning, you need to have robe (the package) installed (perhaps it already is) and to type M-x robe-start to launch the background process. And to possibly deal with any errors you see if it fails to launch (e.g. run bundle install).

Yes, I'm also not sure why company-robe is not in the list of backend, but perhaps it will be added automatically as soon as the robe package is (auto)-loaded.

Answered by Dmitry on October 29, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP