clang-format.exe removes trailing new lines at end of file.
However, if no NL is found at EOF one should be added.
Patch by Teodor MICU!
Differential Revision: https://reviews.llvm.org/D37732
llvm-svn: 314033
\r
string filePath = Vsix.GetDocumentPath(view);\r
var path = Path.GetDirectoryName(filePath);\r
+\r
string text = view.TextBuffer.CurrentSnapshot.GetText();\r
+ if (!text.EndsWith(Environment.NewLine))\r
+ {\r
+ view.TextBuffer.Insert(view.TextBuffer.CurrentSnapshot.Length, Environment.NewLine);\r
+ text += Environment.NewLine;\r
+ }\r
\r
RunClangFormatAndApplyReplacements(text, 0, text.Length, path, filePath, options, view);\r
}\r