<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63154>63154</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            CompilationDatabase relative to source file?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          durka
      </td>
    </tr>
</table>

<pre>
    My use case is I have a directory full of projects. I would like to create a common .clangd file in the directory, which will apply to all of the projects. According to https://clangd.llvm.org/config#files, this should work:

>     project configuration: a file named .clangd in the source tree. (clangd searches in all parent directories of the active file).

However, I'm having trouble setting the location of `compile_commands.json`. It is in the build directory of each project, let's say `~/projects/$ACTIVE_PROJECT/build/.`. But .clangd is in ~/projects, and CompilationDatabase is taken as a relative path from there, so I have no way to refer to the build directory.

> A single path to a directory (absolute, or relative to the fragment)

In my case I do actually have an environment variable $ACTIVE_PROJECT, so an alternative solution would be to interpolate environment variables into the path. But it doesn't look like that is currently supported either.

Have I missed something, or is this a feature request?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVMuu4jgTfhqzKXUUHK6LLGjOQT-_NJrRqDXbVsUpEjeOnfEFxGaefVQmHDijw4Jb7O9SX1VhCLqzRLVYfhfLtxmm2Dtft8mfcda49lb_doMUCBQGAh3gCD1eCBBa7UlF529wSsaAO8Ho3S9SMRRwhKtLpgWjzwTRgfKEkS8pNwzOQqEM2q6FkzYE2kLs6Ykn5B6uvVY9XLUxgONobgyCdxY--2TaKeV8q23HJ_oYxyCqnZAHIQ93jsKYy1A43_E_zp50J2TFvIF5Yq8DhD6LvTp_5svlmygf79U78GvigztA8hi1s6LaAd4tWByo_XA1GQoueUUQPVEBQm6mp4HQq54CH2NLI3qy8cO-pvBwiSrqC2UGIbfFq7D_uStdyLOFo5DrgUPJRfAuNYYgUIz5d09gnMp6GVasSuWGURv6yVG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