CompileFlags:
# macos: non-system clangd doesn't seem to include /usr/local/include in the default path
Add: [
- "-I/usr/local/include"
+ "-I/usr/local/include",
+ "-D__clangd__"
]
# macos: flags that come from xcrun that brewd clangd doesn't understand
Remove: [
extern "C" {
#endif
-#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
-# include <sanitizer/lsan_interface.h>
-#endif
+/*
+ * clangd doesn't inherit all the implicit includes of clang
+ */
+#ifndef __clangd__
+# ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
+# include <sanitizer/lsan_interface.h>
+# endif
-#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
-# define LSAN_DISABLE(_x) __lsan_disable(); _x; __lsan_enable()
-#else
-# define LSAN_DISABLE(_x) _x
+# ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
+# define LSAN_DISABLE(_x) __lsan_disable(); _x; __lsan_enable()
+# else
+# define LSAN_DISABLE(_x) _x
+# endif
#endif
#ifdef __cplusplus