History log of /llvm-project/clang/unittests/Format/FormatTestCSharp.cpp (Results 76 – 86 of 86)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 0bb60e29 31-Jan-2020 Jonathan Coe <jbcoe@google.com>

[clang-format] Fixes for spaces around C# object initializers

Summary: Fix spaces around typename and [] in C# object initializers.

Reviewers: MyDeveloperDay, klimek, krasimir

Reviewed By: MyDevel

[clang-format] Fixes for spaces around C# object initializers

Summary: Fix spaces around typename and [] in C# object initializers.

Reviewers: MyDeveloperDay, klimek, krasimir

Reviewed By: MyDeveloperDay, krasimir

Subscribers: cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D72401

show more ...


Revision tags: llvmorg-10.0.0-rc1
# f9f0919d 30-Jan-2020 Jonathan Coe <jbcoe@google.com>

[clang-format] Improve support for multiline C# strings

Reviewers: krasimir

Reviewed By: krasimir

Tags: #clang-format

Differential Revision: https://reviews.llvm.org/D73622


# 9d212e83 28-Jan-2020 Jonathan Coe <jbcoe@google.com>

[clang-format] Handle quotes and escaped braces in C# interpolated strings

Summary:
This addresses issues raised in https://bugs.llvm.org/show_bug.cgi?id=44454.

There are outstanding issues with mu

[clang-format] Handle quotes and escaped braces in C# interpolated strings

Summary:
This addresses issues raised in https://bugs.llvm.org/show_bug.cgi?id=44454.

There are outstanding issues with multi-line verbatim strings in C# that will be addressed in a follow-up PR.

Reviewers: krasimir, MyDeveloperDay

Reviewed By: krasimir, MyDeveloperDay

Subscribers: MyDeveloperDay

Tags: #clang-format

Differential Revision: https://reviews.llvm.org/D73492

show more ...


# 36a8f7f6 27-Jan-2020 Krasimir Georgiev <krasimir@google.com>

[clang-format] Handle escaped " in C# string-literals

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: klimek, MyDeveloperDay

Tags: #clang-format

Differential Revision: https://reviews.llv

[clang-format] Handle escaped " in C# string-literals

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: klimek, MyDeveloperDay

Tags: #clang-format

Differential Revision: https://reviews.llvm.org/D73353

show more ...


# 1e0174a9 23-Jan-2020 Krasimir Georgiev <krasimir@google.com>

Treat C# `using` as a control statement

Contributed by jbcoe!

Summary: Unless SpaceBeforeParensOptions is set to SBPO_Never, a space will be put between `using` and `(` in C# code.

Reviewers: klim

Treat C# `using` as a control statement

Contributed by jbcoe!

Summary: Unless SpaceBeforeParensOptions is set to SBPO_Never, a space will be put between `using` and `(` in C# code.

Reviewers: klimek, MyDeveloperDay, krasimir

Reviewed By: krasimir

Subscribers: MyDeveloperDay, cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D72144

show more ...


# d82adf32 19-Jan-2020 mydeveloperday <mydeveloperday@gmail.com>

Allow space after C-style cast in C# code

Reviewed By: MyDeveloperDay, krasimir

Patch By: jbcoe

Differential Revision: https://reviews.llvm.org/D72150


Revision tags: llvmorg-11-init
# 2f209ccf 20-Dec-2019 mydeveloperday <mydeveloperday@gmail.com>

[clang-format] C# formatting a class with inheritance followed by an attribute specifier assume its a braces initializer

Summary:
https://bugs.llvm.org/show_bug.cgi?id=44340

The rule that prevents

[clang-format] C# formatting a class with inheritance followed by an attribute specifier assume its a braces initializer

Summary:
https://bugs.llvm.org/show_bug.cgi?id=44340

The rule that prevents `... {} [[....]]` being treated as a braced initializer for C++ causes problems for C# with attributes, causing it to be incorrectly classified and then messing up the subsequent formatting. (see bug for details of formatting)

Reviewers: mitchell-stellar, klimek, sammccall

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D71769

show more ...


Revision tags: llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1
# 4c056583 04-Oct-2019 Paul Hoad <mydeveloperday@gmail.com>

[clang-format] [PR43338] C# clang format has space issues betweern C# only keywords

Summary:
When formatting C# there can be issues with a lack of spaces between `using (` , `foreach (` and generic

[clang-format] [PR43338] C# clang format has space issues betweern C# only keywords

Summary:
When formatting C# there can be issues with a lack of spaces between `using (` , `foreach (` and generic types

The C# code

```
public class Foo
{
Dictionary<string,string> foo;
}

```
will be formatted as

```
public class Foo
{
Dictionary<string, string>foo;
^^^^^ missing a space
}
```

This revision also reverts some of {D66662} in order to make this cleaner and resolve an issues seen by @owenpan that the formatting didn't add a space when not in a code block

This also transforms C# foreach commands to be seen as tok::kw_for commands (to ensure foreach gets the same Brace Wrapping behavior as for without littering the code with `if(Style.isCSharp())`

Reviewers: owenpan, klimek, russellmcc, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D67660

llvm-svn: 373709

show more ...


# a2f963bb 04-Oct-2019 Paul Hoad <mydeveloperday@gmail.com>

[clang-format] [PR43333] Fix C# breaking before function name when using Attributes

Summary:
This is a fix for https://bugs.llvm.org/show_bug.cgi?id=43333

This comes with 3 main parts

- C# attr

[clang-format] [PR43333] Fix C# breaking before function name when using Attributes

Summary:
This is a fix for https://bugs.llvm.org/show_bug.cgi?id=43333

This comes with 3 main parts

- C# attributes cause function names on a new line even when AlwaysBreakAfterReturnType is set to None
- Add AlwaysBreakAfterReturnType to None by default in the Microsoft style,
- C# unit tests are not using Microsoft style (which we created to define the default C# style to match a vanilla C# project).

Reviewers: owenpan, klimek, russellmcc, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-tools-extra, #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D67629

llvm-svn: 373707

show more ...


Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5
# 719087bb 12-Sep-2019 Paul Hoad <mydeveloperday@gmail.com>

[clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren

Summary:
Addresses https://bugs.llvm.org/show_bug.cgi?id=43100

Formatting using statement in C# with

[clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren

Summary:
Addresses https://bugs.llvm.org/show_bug.cgi?id=43100

Formatting using statement in C# with clang-format removes the space between using and paren even when SpaceBeforeParens is !

```
using(FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize : 1))
```

this change simply overcomes this for when using C# settings in the .clang-format file

```
using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize : 1))
```

All FormatTests pass..

```
[==========] 688 tests from 21 test cases ran. (88508 ms total)
[ PASSED ] 688 tests.
```

Reviewers: djasper, klimek, owenpan

Reviewed By: owenpan

Subscribers: llvm-commits, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66662

llvm-svn: 371720

show more ...


Revision tags: llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1
# cbb726d0 21-Mar-2019 Paul Hoad <mydeveloperday@gmail.com>

[clang-format] Add basic support for formatting C# files

Summary:

This revision adds basic support for formatting C# files with clang-format, I know the barrier to entry is high here so I'm sendin

[clang-format] Add basic support for formatting C# files

Summary:

This revision adds basic support for formatting C# files with clang-format, I know the barrier to entry is high here so I'm sending this revision in to test the water as to whether this might be something we'd consider landing.

Tracking in Bugzilla as:
https://bugs.llvm.org/show_bug.cgi?id=40850

Justification:
C# code just looks ugly in comparison to the C++ code in our source tree which is clang-formatted.

I've struggled with Visual Studio reformatting to get a clean and consistent style, I want to format our C# code on saving like I do now for C++ and i want it to have the same style as defined in our .clang-format file, so it consistent as it can be with C++. (Braces/Breaking/Spaces/Indent etc..)

Using clang format without this patch leaves the code in a bad state, sometimes when the BreakStringLiterals is set, it fails to compile.

Mostly the C# is similar to Java, except instead of JavaAnnotations I try to reuse the TT_AttributeSquare.

Almost the most valuable portion is to have a new Language in order to partition the configuration for C# within a common .clang-format file, with the auto detection on the .cs extension. But there are other C# specific styles that could be added later if this is accepted. in particular how `{ set;get }` is formatted.

Reviewers: djasper, klimek, krasimir, benhamilton, JonasToth

Reviewed By: klimek

Subscribers: llvm-commits, mgorny, jdoerfert, cfe-commits

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D58404

llvm-svn: 356662

show more ...


1234