Skip to content

How to use a specific symbol index database that is not located in the build directory? #5

@yanminhui

Description

@yanminhui

Problem

mcp-cpp always looks for or generates the symbol index database in the build directory.

Expectation

Allow the use of a symbol index database from a custom directory.

Example

project
├── .cache
│   └── clangd
│       └── index            <--- symbol index
│── compile_commands.json    <--- copy from build directory
├── sources                  <--- clangd searches in all parent directories of the active file
└── xxx_build
    ├── CMakeLists.txt
    └── build

mcp-cpp test-project

mcp-cpp and vscode generate index in different directories.

test-project
├── .cache                    <--- built by vscode
│   └── clangd
│       └── index
├── .gitignore
├── CMakeLists.txt
├── build
│   ├── .cache                <--- built by mcpcpp
│   │   └── clangd
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   │   ├── 3.25.1
│   │   ├── CMakeDirectoryInformation.cmake
│   │   ├── CMakeError.log
│   │   ├── CMakeOutput.log
│   │   ├── CMakeScratch
│   │   ├── Makefile.cmake
│   │   ├── Makefile2
│   │   ├── TargetDirectories.txt
│   │   ├── TestLib.dir
│   │   ├── TestProject.dir
│   │   ├── cmake.check_cache
│   │   ├── pkgRedirects
│   │   └── progress.marks
│   ├── Makefile
│   ├── cmake_install.cmake
│   └── compile_commands.json
├── include
│   ├── Algorithms.hpp
│   ├── Container.hpp
│   ├── FileStorage.hpp
│   ├── IStorageBackend.hpp
│   ├── LogLevel.hpp
│   ├── Math.hpp
│   ├── MemoryStorage.hpp
│   ├── StorageBackend.hpp
│   ├── StorageType.hpp
│   └── StringUtils.hpp
└── src
    ├── Container.cpp
    ├── EnumOperators.cpp
    ├── FileStorage.cpp
    ├── Math.cpp
    ├── MemoryStorage.cpp
    ├── StringUtils.cpp
    └── main.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions