How to hide certain warnings from IDE (E.g.: pp_file_not_found)

Hi there,

Does anybody know how to hide specific clang warning messages for C/C++?

Examples of warnings that I do not want to propagate to the frontend, or block in the frontend because are too annoying:

pp_file_not_found
undeclared_var_use

I’ve already tried to hide these messages using all possible clangd flags in a compile_flags.txt but I couldn’t make it work yet.

The reason why I do not remove clangd support is that I still need to navigate to files and get help for existing classes and methods.

You may say:

If pp_file_not_found is raised, just include the “-I/path/to/customLibrary/include” in the compile_flags.txt file

The reason why this is not possible is that I have a single IDE Docker that is used by different students that are coding in another docker that has special libraries.

Each student has different special libraries that are not installed in the Theia IDE docker because otherwise, we would have tons of IDE docker images.

The user’s programs compile fine, but the IDE is always complaining for the reasons already explained, and that is why I would like to know how to intercept those pp_file_not_found, for example, directly in the frontend to manually avoid its propagation.

Does anybody know which file or plugin should I touch on to achieve this?

@rubenanapu thank you for the discussion, I haven’t touched clangd in a while but I believe you can try to suppress it in a configuration file with the suppression option.

If it does not suit your needs you may want to ask on clangd discussion forums (ex: their github or discord).

1 Like

Hi @vince-fugnitto,

I cannot express how happy I am after following the links you shared. I’ve been struggling with this issue for many weeks already, but the links you shared, finally gave me peace of mind in this matter.

Following your instructions, I created the file ~/.config/clangd/config.yaml with the content below, and clang marvelously stopped with those warnings:

Diagnostics:
  Suppress: [undeclared_var_use, pp_file_not_found]

Thank you veeeeery much.

May God give bless you so much that you become surprised. May God give you many years of life, full of Joy, Peace, Prosperity, Health, Wisdom, and everything that is good.

1 Like