Youcompleteme: Disable diagnostics in YCM

Created on 22 Sep 2014  Â·  15Comments  Â·  Source: ycm-core/YouCompleteMe

I'm an embedded developer, meaning neither gcc nor clang are my compilers. The reason I installed YCM is to have a completion engine. Quite often the C language I'm using a has a lot of keywords and identifiers which clang/gcc can't interpret, meaning YCM generates a lot of errors for me. Is it possible to disable diagnostics in YCM. If not then this can be considered a feature request.

Most helpful comment

Yes. To achieve a desired effect I did the following:

let g:ycm_enable_diagnostic_signs = 0
let g:ycm_enable_diagnostic_highlighting = 0

All 15 comments

I solve that by using an ifder _lint for my projects that provide clang
friendly replacements. I use this for all tools that don't understand the
dialect provided.

On the other hand if clang is not able to parse your file you won't profit
from semantic completion.

On Mon, Sep 22, 2014 at 4:14 PM, cyboflash [email protected] wrote:

I'm an embedded developer, meaning neither gcc nor clang are my compilers.
The reason I installed YCM is to have a completion engine. Quite often the
C language I'm using a has a lot of keywords and identifiers which
clang/gcc can't interpret, meaning YCM generates a lot of errors for me. Is
it possible to disable diagnostics in YCM. If not then this can be
considered a feature request.

—
Reply to this email directly or view it on GitHub
https://github.com/Valloric/YouCompleteMe/issues/1192.

See the docs for info on how to disable the various parts of the diagnostic UI.

I couldn't really find a good way to disable various parts of the diagnostic UI. The only way I can think of is to change values for 'YcmErrorSign', 'YcmWarningSign', 'YcmErrorLine', 'YcmWarningLine'. Is there a better way to do it, say by using a variable, say something like enable_diags? If not it would be nice to have a feature like this.

I've tried the following in my .vimrc

highlight YcmErrorSign None
highlight YcmWarningSign None
highlight YcmErrorLine None
highlight YcmWarningLine None

but it didn't work. I'm still getting seeing all of the errors and the error signs as well as the gutter itself. Is there a way to disable all of it?

Yes and as said before look the docs g:ycm_show_diagnostics_ui

I did look through the documentation, I guess I just missed this option.

Setting

let g:ycm_show_diagnostics_ui = 0

disabled semantic completion as well. This could be a bug.

No it doesn't. I just tried.

It doesn't work for me. If I type a name of a struct and then try to access its field no menu comes up for me. For example

struct {
  uint8 field1;
  uint16 field2;
  uint32 field3,
} myStruct;

if I type myStruct. no autocompletion window comes up. However when I start typing my then I'm getting a list of possible completions.

But if you remove the g:ycm_show_diagnostics_ui option works as expected?

Yes. To achieve a desired effect I did the following:

let g:ycm_enable_diagnostic_signs = 0
let g:ycm_enable_diagnostic_highlighting = 0

Sorry I guess I didn't explained myself correctly. I mean, if you remove those option from your config, the semantic completion work as expected?

Do you mean if I remove let g:ycm_show_diagnostics_ui = 0, but use let g:ycm_enable_diagnostic_signs = 0 let g:ycm_enable_diagnostic_highlighting = 0

If this is what you are asking then yes, semantic completion works fine.

It also works If I don't use any of these options.

Currently my vimrc has the following

let g:ycm_show_diagnostics_ui = 1
let g:ycm_enable_diagnostic_signs = 0 
let g:ycm_enable_diagnostic_highlighting = 0

Yes and as said before look the docs g:ycm_show_diagnostics_ui

Where can we find the docs?

@milaniez Have you tried :h youcompleteme or more acurately :h g:ycm_show_diagnostic_ui? All of that is also in the README.

Was this page helpful?
0 / 5 - 0 ratings