From 8eee847654ecaae0e57d23939f9cad6faefb82ee Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Mon, 12 May 2014 22:53:44 +0200 Subject: [PATCH] Beautifier: Add -assume-filename to clang-format Otherwise -style=file will be unusable, since clang-format needs to know original file path in order to resolve .clang-format file location. Change-Id: I0581cbcdf5770eed98179fe37d5517f648d7b826 Reviewed-by: Lorenz Haas Reviewed-by: Przemyslaw Gorszkowski Reviewed-by: David Schulz --- src/plugins/beautifier/clangformat/clangformat.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index 8a1cabc1480..dc980559f59 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -145,6 +145,7 @@ Command ClangFormat::command(int offset, int length) const command.addOption(QLatin1String("-offset=") + QString::number(offset)); command.addOption(QLatin1String("-length=") + QString::number(length)); } + command.addOption(QLatin1String("-assume-filename=%file")); return command; }