Index: clang/lib/Format/UnwrappedLineParser.cpp =================================================================== --- clang/lib/Format/UnwrappedLineParser.cpp +++ clang/lib/Format/UnwrappedLineParser.cpp @@ -14,6 +14,7 @@ #include "UnwrappedLineParser.h" #include "FormatToken.h" +#include "clang/Basic/TokenKinds.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -2216,7 +2217,7 @@ parseParens(); } else { while (FormatTok->isOneOf(tok::identifier, tok::coloncolon, tok::kw_inline, - tok::l_square)) { + tok::l_square, tok::period)) { if (FormatTok->is(tok::l_square)) parseSquare(); else Index: clang/unittests/Format/FormatTestCSharp.cpp =================================================================== --- clang/unittests/Format/FormatTestCSharp.cpp +++ clang/unittests/Format/FormatTestCSharp.cpp @@ -1314,5 +1314,26 @@ Style); } +TEST_F(FormatTestCSharp, NamespaceIndentation) { + FormatStyle Style = getMicrosoftStyle(FormatStyle::LK_CSharp); + Style.NamespaceIndentation = FormatStyle::NI_None; + + verifyFormat("namespace A\n" + "{\n" + "public interface Name1\n" + "{\n" + "}\n" + "}\n", + Style); + + verifyFormat("namespace A.B\n" + "{\n" + "public interface Name1\n" + "{\n" + "}\n" + "}\n", + Style); +} + } // namespace format } // end namespace clang