It is currently possible to tell clangd where to find the
compile_commands.json file through the initializationOptions or the
didChangeConfiguration message. However, it is not possible to tell
clangd to deselect any explicit compilation database path (i.e. go back
to the default).
This patch makes it possible by sending the value null:
params: { "settings": { "compilationDatabasePath": null } }
Not including the compilationDatabasePath field doesn't change the value
(which means it doesn't deselect it if one is already set). I chose to
do it this way because the other possible field,
compilationDatabaseChanges, just contains a delta. So I think it makes
sense if compilationDatabasePath works the same way.
Not a big fan or something like this, but maybe give special meaning to empty path instead of wrapping an optional into an optional?
Double optionals are a real pain to write and read.