Re-use token type TT_AttributeColon for C# attribute target colons.
Details
Diff Detail
Event Timeline
clang/unittests/Format/FormatTestCSharp.cpp | ||
---|---|---|
281 ↗ | (On Diff #247665) | isn't the space after the : a regression? How is an example where such an attribute is not the last thing in the file? I'm not entirely clear on which edit caused this. |
clang/unittests/Format/FormatTestCSharp.cpp | ||
---|---|---|
281 ↗ | (On Diff #247665) | The space maybe is coming from |
Do not allow spaces around C# attribute colons.
clang/lib/Format/TokenAnnotator.cpp | ||
---|---|---|
391 | This is needed to avoid [assembly:InternalsVisibleTo("SomeAssembly, PublicKey=SomePublicKeyThatExceedsTheColumnLimit")] being classified as a ObjCMethodExpr (as seen when running clang-format with -debug). The formatting results are currently the same for ObjCMethodExpr and CSharpAttributes. | |
clang/unittests/Format/FormatTestCSharp.cpp | ||
281 ↗ | (On Diff #247665) | There seems to be some inconsistency between the docs you linked (which has no space) and code that forms part of projects like Roslyn (which has the space). I'll defer making this change (if we want it until later). |
This feels better than merging
I think visual studio tends to create files via the new project wizard that do not have a space before but do have a space after the :
[assembly: ComVisible(false)]
This is needed to avoid
being classified as a ObjCMethodExpr (as seen when running clang-format with -debug).
The formatting results are currently the same for ObjCMethodExpr and CSharpAttributes.