<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/106194>106194</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang-format formats string content in c#
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TobiasFunk
</td>
</tr>
</table>
<pre>
`using System;
namespace ConsoleApp3 {
public class Program {
public static void Main(string[] args) {
const string expectedDataStruct = @"
#include <b.h>
#include <a.h>
#include <A.h>
";
Console.WriteLine(expectedDataStruct);
}
}`
hey when i run clang-format with this setting in c#
Language: CSharp
BasedOnStyle: Microsoft
Standard: c++20
SortIncludes: CaseSensitive
also does it on SortIncludes: CaseInsensitive
it only does not modify the string when using Never
i get this result:
`using System;
namespace ConsoleApp3 {
public class Program {
public static void Main(string[] args) {
const string expectedDataStruct = @"
#include <A.h>
#include <a.h>
#include <b.h>
";
Console.WriteLine(expectedDataStruct);
}
}
}`
this means clang-format is somehow modifying my string. My expectation is that no string at all should ever be modified by clang-format as this is not read code (we use it here for a code generator this is why we found the issue)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzklcGP6jYQxv8a5zJ6KNiBwCGHZSnSk962lajU88QZEreOjTwTaP77KgS6rPpWaqXeyiGWmPnGH59_Jsjs2kBUqdVOrfYZDtLFVP0Sa4d8GMLvWR2bsVLrfGAXWjiOLNQrs1P5XuUv8zNgT3xGS_AaA0dPL-ezAVXem85D7Z0F65EZfk6xTdi_VwHudRYUZ-ESXQNv6ILSG5bkQjtbA0wtK719VgLYGFhg7gP640xWqNmj4FHSYAWU2YMqcqX1u-b5o7RxwfqhIVDmtV50yvzwTzrxufNj6eWTIZOHR26PoBa_Jif0zQVSevN3-0pv3yWgyv099XKv1vnzCXQ0wrWjAA7SEKaoQ_vlFFOPAlcnHUjnGJhEppzABbBKm1n7DUM7YEvKvMDrscN0nr_fIVPzUzjK6G-1N2dT5HiSuXwUDA2mZipZpXdK7_Td0zEm-ToHwrepyHSkwE7cheDZ9_xEzxGaSAxOIAb4nv5r4O9OuCn8OMtDFOhj404jSEcPLG7BzPj-SBdKH-TQkszpJOLBizIPa_8P5D-j9V8h_9m9-W-R_4T92-H1hIE_cj8BH3vq4vXOxJRXP96TW8DbeE8PxcUwtUuHAiE-skUB9B64i4NvYCIHappnOWqgHj_uhzxz5GYOE2EDNk4B6c2VYGCa8O4oEZxiApyLLQVKKDH9Jb52I1ynniE0N4wd80BKb7OmMs3WbDGjalnqoizMxqyyrtKrsl6Xtsw3WG9ssS3s2mhcLsvCkinzZeYqnesi3-gyL01uVot6WW7qhgzSWtd4KlSRU4_OL7y_9IuY2uy2abXM18ttkXmsyfPtHaH184-eDni1z1I16b7UQ8uqyL1j4fdJ4sRT9foc1bzwI2gbg1CQx99SNiRfdSLn6fIrfVD60DrphnphY6_0YZp8X76cU_yNJmoON8Os9OHu-VLpPwMAAP__ougYhg">