# The wasm translation unit is compiled by wasm/build_wasm.sh with include/,
# src/utils and wasm on the path (and the amalgamated bovnar.h ahead of them in
# the real build). Without them the editor's clang cannot find bovnar.h at all,
# so every symbol in the file reads as undeclared. build/generated carries the
# .gen.inc tables the build writes (bvn_unit_impl.h includes them), and without
# it that translation unit cannot be parsed at all. One flag per entry: a
# "-I include" with a space is a single argument whose path starts with a space.
#
# -x c is here because clang picks a .h file's language from its own table, and
# for a header it does not recognise it falls back to Objective-C++, which then
# rejects -std=c11 outright. There is no C++ translation unit in the repo, so
# pinning the language for every file clangd parses costs nothing, and it is the
# difference between parsing the headers and refusing to start. The language and
# its value are two separate argv entries: "-x c" as one entry is read as the
# language " c" (leading space), which clang rejects.
#
# -fanalyzer is a GCC-only flag the build puts in compile_commands.json. clangd
# parses with its own bundled clang, which rejects it and fails the whole file,
# so strip it from the compile database (the real GCC build still gets it).
CompileFlags:
  Remove:
    - -fanalyzer
  Add:
    - -x
    - c
    - -Iinclude
    - -Isrc/utils
    - -Iwasm
    - -Ibuild/generated
    - -std=c11
