I'm trying to get clang-format to work in sublime, following the instructions here:
This worked initially, but now when I hit my keybinding it deletes all the text in my editor buffer. I think the command is failing, so it produces no output, so Sublime puts an empty string in the buffer.
The Sublime error log shows:
b'Problem while looking for clang-format in Chromium source tree:\n Could not find checkout in any parent of the current path.\n'
I traced this into to depot_tools/gclient_utils.py GetPrimarySolutionPath(), which uses os.getcwd() to look for your checkout to find the buildtools directory. For me, os.getwd() prints /opt/sublime_text, which is obviously not in my checkout.
I tried setting "binary" to the full path to depot_tools/clang-format in my copy of clang-format-sublime.py, but that didn't work (clang_format.py tries to do the lookup anyway, I think).
Does anyone know how to work around this?
James