racer-rust / emacs-racer

Racer support for Emacs
398 stars 48 forks source link

Only use racer for completions in rust-mode. #18

Closed Wilfred closed 8 years ago

Wilfred commented 8 years ago

The default value for completion-at-point-functions is '(tags-completion-at-point-function). As a result, if the user has any tags tables in tagsl-table-list then company-capf tries to use those tags tables for completions.

Instead, we ensure that completion-at-point-functions is initialised to nil, so rust-mode buffers don't end up using these unwanted other completion sources.

@fbergroth does this look reasonable to you? I'm still learning about CAPF.

fbergroth commented 8 years ago

That's a bit odd though, from the docs of completion-at-point-functions;

The first function in completion-at-point-functions to return a non-nil value is used by completion-at-point. The remaining functions are not called.

I would have expected racer to take precedence. Anyway, I don't know that much about CAPF myself, and can't test it, but setting it to nil or explicitly using remove-hook should do it. :)

Wilfred commented 8 years ago

Setting it to nil is exactly what we're doing here. I take it that's a :+1: from you?

fbergroth commented 8 years ago

Sure!

Wilfred commented 8 years ago

Groovy :)