# clangd configuration for the Python (pybind11) bindings.
#
# These translation units are built by scikit-build-core with build isolation,
# so they never appear in any compile_commands.json that clangd can find. Without
# a compile command, clangd falls back to bare flags and cannot locate pybind11,
# Python, Eigen, or the TRexSelector C++ headers — surfacing as
# "'pybind11/pybind11.h' file not found" and related red squiggles.
#
# Supplying the include paths and the C++20 standard here fixes IntelliSense for
# every file under Python/trexselector/ (this .clangd applies to this directory
# and its subdirectories). Paths are absolute so they resolve without a compile
# command working directory.
#
# After editing, run the "clangd: Restart language server" command in VS Code.
CompileFlags:
  # Authoritative flags: the compile_commands.json generated by
  #   cmake -S Python/trexselector -B Python/trexselector/build \
  #     -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DTREX_PORTABLE_BUILD=ON \
  #     -Dpybind11_DIR=$(python -m pybind11 --cmakedir)
  # (path is relative to this .clangd file). If build/ is absent, clangd falls
  # back to the explicit Add flags below.
  CompilationDatabase: build
  Remove:
    # Homebrew-LLVM OpenMP spelling that clangd's bundled clang rejects
    # ("unsupported argument 'libomp' to option '-fopenmp='"). Mirrors cpp/.clangd.
    # OpenMP headers still resolve via the -I flags below; only the driver flag is dropped.
    - -fopenmp=libomp
  Add:
    - -xc++
    - -std=c++20
    # TRexSelector C++ library headers (<trex_selector_methods/...>, <tsolvers/...>, <utils/...>)
    - -I/Users/fabianscheidt/Documents/C++/TRexSelector/cpp/src
    # Sibling binding headers (#include "trex_core_bindings.hpp", ...)
    - -I/Users/fabianscheidt/Documents/C++/TRexSelector/Python/trexselector/src/trexselector
    # Homebrew: Eigen, Boost, Cereal, and LLVM headers
    - -I/opt/homebrew/include
    - -I/opt/homebrew/include/eigen3
    - -I/opt/homebrew/opt/llvm/include
    # conda env "trex-dev": Python and pybind11 headers
    - -I/opt/homebrew/Caskroom/miniconda/base/envs/trex-dev/include/python3.12
    - -I/opt/homebrew/Caskroom/miniconda/base/envs/trex-dev/lib/python3.12/site-packages/pybind11/include
