Search code examples
rstudiorcpp

How to turn off CLANG diagnostics in Rstudio with Rcpp?


Some time ago I enabled Clang diagnostics in Rstudio for Rcpp.

I don't remember exactly how, but it was some line to start it for either here or on another site.

Now every time I edit Rcpp code I get constant Clang updates in the console such as:

clang version 5.0.2 (tags/RELEASE_502/final)
Target: x86_64-pc-windows-msvc
TOTAL MEMORY: 41 mb (cpp1exception.cpp)
PERFORMANCE 285 ms (cpp1exception.cpp)

The real problem is that this diagnostic seems to slow down input. I type something, anything, and the the GUI, Rstudio seems to pause, until the Clang output finishes.

So I simply want to turn of the Diagnostics or make it how it was before.

Update: The code to turn it on was found here: Rstudio no autocomplete with Rcpp Armadillo? Specifically the line .rs.setClangDiagnostics(2).


Solution

  • Once I found that I used .rs.setClangDiagnostics(2) after some searching I found that I need to simply use:

    .rs.setClangDiagnostics(0)

    To turn it off, and it did.