The company-elmbackend does not perform checks to see if the current buffer is in elm-mode.
This means that, if users follow the wiki-recommended technique of having all of their backends in the list at all times, they get an error on every keypress:
Completion only works inside Elm projects. Create one with M-x elm-create-package RET
Other backends, like company-ghc, check the buffer mode and only returns a non-nil value if the buffer is in an appropriate mode:
(defun company-ghc (command &optional arg &rest ignored)
"`company-mode' completion back-end for `haskell-mode' via ghc-mod.
Provide completion info according to COMMAND and ARG. IGNORED, not used."
(interactive (list 'interactive))
(cl-case command
(init (when (and (derived-mode-p 'haskell-mode) company-ghc-autoscan)
(company-ghc-scan-modules)
(add-hook 'after-save-hook #'company-ghc-scan-modules nil t)))
(interactive (company-begin-backend 'company-ghc))
(prefix (and (derived-mode-p 'haskell-mode)
(company-ghc-prefix)))
(candidates (company-ghc-candidates arg))
(meta (company-ghc-meta arg))
(doc-buffer (company-ghc-doc-buffer arg))
(location (company-ghc-location arg))
(annotation (company-ghc-annotation arg))
(sorted t)))
The
company-elm
backend does not perform checks to see if the current buffer is inelm-mode
.This means that, if users follow the wiki-recommended technique of having all of their backends in the list at all times, they get an error on every keypress:
Other backends, like
company-ghc
, check the buffer mode and only returns a non-nil value if the buffer is in an appropriate mode: