Page MenuHomePhabricator

krasimir (Krasimir Georgiev)
User

Projects

User does not belong to any projects.

User Details

User Since
Oct 11 2016, 5:32 AM (182 w, 11 h)

Recent Activity

Yesterday

krasimir accepted D77548: clang-format: [JS] handle pseudo-keywords..

Looks good! The linter suggests a few formatting fixes.

Mon, Apr 6, 8:05 AM · Restricted Project
krasimir added a comment to D75364: [clang-format] Handle macros in function params and return value.

A sample of snippets that this misformats:

Mon, Apr 6, 5:22 AM · Restricted Project, Restricted Project
krasimir added a comment to D75364: [clang-format] Handle macros in function params and return value.

I think situations where we infer M(x) to expand to a "type" without const/volatile close-by are too ambiguous an we will have the opposite problem: formatting certain binary expressions as type pointer/references. Some sort of a list of macros that clang-format assumes expand to a "type" could eliminate ambiguities, but has its own problems.
I think the case where there's a const/volatile/typename/typedef etc. around M(x) is very interesting; not sure if there are many practical ambiguities there.
There was an idea of giving a bunch of #define-s to clang-format (maybe with a small subset of what's possible) and use these rules to decide how to format matching forms, but that's hard (requires some sort of "virtual expanded token sequences" that the formatter should undestrand how to handle) to do and I don't know what's the status of that.

Mon, Apr 6, 3:45 AM · Restricted Project, Restricted Project
krasimir added a reviewer for D75364: [clang-format] Handle macros in function params and return value: klimek.
Mon, Apr 6, 3:13 AM · Restricted Project, Restricted Project

Fri, Apr 3

krasimir added inline comments to D77311: clang-format: [JS] detect C++ keywords..
Fri, Apr 3, 4:48 AM · Restricted Project, Restricted Project
krasimir accepted D77311: clang-format: [JS] detect C++ keywords..

Thank you!

Fri, Apr 3, 4:15 AM · Restricted Project, Restricted Project
krasimir requested changes to D77311: clang-format: [JS] detect C++ keywords..
Fri, Apr 3, 3:11 AM · Restricted Project, Restricted Project

Thu, Apr 2

krasimir added a comment to D77311: clang-format: [JS] detect C++ keywords..
In D77311#1957367, @jfb wrote:

Some of these are technically "future reserved keywords": https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords

Wouldn't it be better to list all of JS's keywords at this point?

Thu, Apr 2, 10:17 AM · Restricted Project, Restricted Project

Tue, Mar 31

krasimir accepted D77064: [clang-format] Correct line breaks in C# generic type constraints.

Awesome!

Tue, Mar 31, 10:52 AM · Restricted Project, Restricted Project

Mon, Mar 30

krasimir committed rG0574030c0161: [clang-format] only parse C# generic type constraints in C# (authored by krasimir).
[clang-format] only parse C# generic type constraints in C#
Mon, Mar 30, 4:50 AM

Thu, Mar 26

krasimir accepted D76850: clang-format: Fix pointer alignment for overloaded operators (PR45107).

I think this is an improvement. Accepting with a nit. Thank you!

Thu, Mar 26, 8:38 AM · Restricted Project
krasimir added a comment to D76850: clang-format: Fix pointer alignment for overloaded operators (PR45107).

@MyDeveloperDay : sorry, I must have not refreshed this page and didn't realize you already gave an LGTM until I posted the comment.

Thu, Mar 26, 8:38 AM · Restricted Project

Mon, Mar 23

krasimir accepted D76621: [clang-format] No space inserted between commas in C#.
Mon, Mar 23, 9:14 AM · Restricted Project, Restricted Project
krasimir accepted D75760: [clang-format] Do not indent C# array initialisers as continuations.

This is OK with the comment in the code. Thank you!

Mon, Mar 23, 7:36 AM · Restricted Project, Restricted Project
krasimir accepted D76597: [clang-format] Reflow long C# generic type constraints correctly.

Awesome! Thank you!

Mon, Mar 23, 5:58 AM · Restricted Project, Restricted Project

Thu, Mar 19

krasimir accepted D76367: [clang-format] Handle C# generic type constraints.

Thank you!

Thu, Mar 19, 5:54 AM · Restricted Project, Restricted Project
krasimir requested changes to D76367: [clang-format] Handle C# generic type constraints.
Thu, Mar 19, 3:11 AM · Restricted Project, Restricted Project

Wed, Mar 11

krasimir accepted D75983: [clang-format] Improved identification of C# nullables.

Thank you!

Wed, Mar 11, 6:18 AM · Restricted Project, Restricted Project
krasimir accepted D75984: [clang-format] No space in `new()` and `this[Type x]` in C#.

Thank you!

Wed, Mar 11, 6:17 AM · Restricted Project, Restricted Project
krasimir added inline comments to D75983: [clang-format] Improved identification of C# nullables.
Wed, Mar 11, 5:44 AM · Restricted Project, Restricted Project

Mon, Mar 9

krasimir accepted D75747: [clang-format] Correct indentation for `[key] = value,` entries in C++ object initialisers.

Thank you!

Mon, Mar 9, 11:19 AM · Restricted Project, Restricted Project
krasimir accepted D75856: [clang-format] cleanup from D75517.
Mon, Mar 9, 10:46 AM · Restricted Project, Restricted Project
krasimir requested changes to D75760: [clang-format] Do not indent C# array initialisers as continuations.
Mon, Mar 9, 10:46 AM · Restricted Project, Restricted Project
krasimir accepted D75731: [clang-format] C# does not indent braced initializers as continuations.

Thank you

Mon, Mar 9, 10:46 AM · Restricted Project, Restricted Project
krasimir accepted D75856: [clang-format] cleanup from D75517.

Thank you!

Mon, Mar 9, 10:13 AM · Restricted Project, Restricted Project
krasimir requested changes to D75856: [clang-format] cleanup from D75517.

The new pre-merge checks are cool! Please clang-format the updated lines accordingly.

Mon, Mar 9, 10:13 AM · Restricted Project, Restricted Project
krasimir requested changes to D75747: [clang-format] Correct indentation for `[key] = value,` entries in C++ object initialisers.

Looks good! I'll stamp this after https://reviews.llvm.org/D75731 gets merged and this rebased on top of it.

Mon, Mar 9, 10:13 AM · Restricted Project, Restricted Project
krasimir added inline comments to D75731: [clang-format] C# does not indent braced initializers as continuations.
Mon, Mar 9, 10:13 AM · Restricted Project, Restricted Project
krasimir requested changes to D75731: [clang-format] C# does not indent braced initializers as continuations.
Mon, Mar 9, 10:13 AM · Restricted Project, Restricted Project

Mar 6 2020

krasimir added a comment to D75517: [clang-format] Do not format C# array subscript operators as attributes.

sorry could you please take another look at the comments I left

Mar 6 2020, 2:22 PM · Restricted Project, Restricted Project

Mar 5 2020

krasimir committed rG29693fc12559: Revert "[BFI] Use CallbackVH to notify BFI about deletion of basic blocks" (authored by krasimir).
Revert "[BFI] Use CallbackVH to notify BFI about deletion of basic blocks"
Mar 5 2020, 6:02 AM
krasimir added a reverting change for rG8975aa6ea817: [BFI] Use CallbackVH to notify BFI about deletion of basic blocks: rG29693fc12559: Revert "[BFI] Use CallbackVH to notify BFI about deletion of basic blocks".
Mar 5 2020, 6:02 AM
krasimir committed rG36c2ab8d04cd: [clang-format] do not insert spaces around inline asm symbolic names (authored by krasimir).
[clang-format] do not insert spaces around inline asm symbolic names
Mar 5 2020, 5:30 AM
krasimir closed D75675: [clang-format] do not insert spaces around inline asm symbolic names.
Mar 5 2020, 5:30 AM · Restricted Project, Restricted Project
krasimir updated the diff for D75675: [clang-format] do not insert spaces around inline asm symbolic names.

Merging commits into 1 patch

Mar 5 2020, 5:29 AM · Restricted Project, Restricted Project
krasimir updated the diff for D75675: [clang-format] do not insert spaces around inline asm symbolic names.

Remove redundant check.

Mar 5 2020, 5:29 AM · Restricted Project, Restricted Project
krasimir added inline comments to D75675: [clang-format] do not insert spaces around inline asm symbolic names.
Mar 5 2020, 5:29 AM · Restricted Project, Restricted Project
krasimir updated the summary of D75675: [clang-format] do not insert spaces around inline asm symbolic names.
Mar 5 2020, 4:56 AM · Restricted Project, Restricted Project
krasimir created D75675: [clang-format] do not insert spaces around inline asm symbolic names.
Mar 5 2020, 4:56 AM · Restricted Project, Restricted Project

Mar 4 2020

krasimir accepted D75606: [clang-format] Improve identification of C# nullables.

Looks good with 1 suggestion.

Mar 4 2020, 7:52 AM · Restricted Project, Restricted Project
krasimir accepted D75473: [clang-format] parse C# object initialisers.

Thank you!

Mar 4 2020, 4:33 AM · Restricted Project, Restricted Project

Mar 3 2020

krasimir accepted D75517: [clang-format] Do not format C# array subscript operators as attributes.
Mar 3 2020, 1:13 PM · Restricted Project, Restricted Project
krasimir added a comment to D75194: [clang-format] Do not merge very long C# automatic properties.

Here's some empirical ideas about the approach: In clang-format, braces can be handled in two quite distinct ways, controlled by BraceBlockKind: BK_Block and BK_BracedInit.
BK_Block is for braces that open blocks that usually are at one level deeper and consist of a sequence of statements and other constructs.
BK_BracedInit is for initializer lists, dictionaries and other similar syntactics that are somewhat more appropriate to put together into a line.
The level of granularity of detailed formatting in clang-format is an unwrapped line, which is conceptually a sequence of tokens that "make sense together as a single line" (without going much into style details and ignoring column limits). Separate statements are for example put on separate unwrapped lines. The formatting information flowing between unwrapped lines includes just higher-level data such as the current nesting depth.
The brace detection is handled primarily in UnwrappedLineParser::calculateBraceTypes, which happens quite early during the parsing of the input sequence.

Mar 3 2020, 12:37 PM · Restricted Project, Restricted Project
krasimir added inline comments to D75473: [clang-format] parse C# object initialisers.
Mar 3 2020, 11:57 AM · Restricted Project, Restricted Project
krasimir accepted D75465: [clang-format] Do not merge target-name and : for C# attributes.

Thank you for the explanations! Looking good!

Mar 3 2020, 11:57 AM · Restricted Project, Restricted Project
krasimir accepted D75455: [clang-format] Allow nested [] in C# attributes.

That's a bit of a hack (we probably need to hook up full-fledged argument list parsing for complete handling), but this seems like a good trade-off between heuristics and results right now.

Mar 3 2020, 5:02 AM · Restricted Project, Restricted Project

Mar 2 2020

krasimir added inline comments to D75465: [clang-format] Do not merge target-name and : for C# attributes.
Mar 2 2020, 4:38 PM · Restricted Project, Restricted Project
krasimir added inline comments to D75465: [clang-format] Do not merge target-name and : for C# attributes.
Mar 2 2020, 4:38 PM · Restricted Project, Restricted Project
krasimir accepted D75456: [clang-format] Rename CSharpNullConditionalSq and add missing test.

Thank you!

Mar 2 2020, 7:24 AM · Restricted Project, Restricted Project
krasimir added a comment to D75368: [clang-format] Handle NullCoalescing and NullConditional operators in C#.

Sorry, did the last round of comments not make sense?

Mar 2 2020, 6:42 AM · Restricted Project, Restricted Project
krasimir accepted D75368: [clang-format] Handle NullCoalescing and NullConditional operators in C#.
Mar 2 2020, 5:29 AM · Restricted Project, Restricted Project
krasimir added inline comments to D75368: [clang-format] Handle NullCoalescing and NullConditional operators in C#.
Mar 2 2020, 3:53 AM · Restricted Project, Restricted Project

Feb 28 2020

krasimir accepted D75336: [clang-format] Improve C# handling of spaces in square brackets.
Feb 28 2020, 4:59 AM · Restricted Project, Restricted Project
krasimir added inline comments to D75194: [clang-format] Do not merge very long C# automatic properties.
Feb 28 2020, 4:59 AM · Restricted Project, Restricted Project

Feb 27 2020

krasimir accepted D75261: [clang-format] Recognize C# nullable types.
Feb 27 2020, 11:35 AM · Restricted Project, Restricted Project
krasimir accepted D75244: [clang-format] Recognize C# named argument colons as a token type.

This is very nice! Brings the C# handling of the colon closer to other languages.

Feb 27 2020, 5:29 AM · Restricted Project, Restricted Project

Feb 26 2020

krasimir accepted D75182: [clang-format] Handle commas in [] in C#.
Feb 26 2020, 8:44 AM · Restricted Project, Restricted Project
krasimir accepted D75129: [clang-format] Special handling of spaces for C# code.
Feb 26 2020, 6:45 AM · Restricted Project, Restricted Project
krasimir added inline comments to D75129: [clang-format] Special handling of spaces for C# code.
Feb 26 2020, 5:06 AM · Restricted Project, Restricted Project

Feb 25 2020

krasimir added a comment to D75129: [clang-format] Special handling of spaces for C# code.

As a general comment, we should consider which of these special cases can already be simulated by a combination of existing style options:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
There are several Spaces* options there that can be used to independently control various spacing around parenthesis.

Feb 25 2020, 10:38 AM · Restricted Project, Restricted Project
krasimir added a comment to D74952: [clang-format] Align chained method invocations for C# code.

This works nice for many examples, however I want to point out some limitations of using WhitespaceManager for this.
The alignment code in WhitespaceManager is conceptually at the end of the formatting pipeline, where all of the formatting decisions (where to break a line and what indentation to use for the following line) have already been fixed.
The code here attempts to do a post-processing pass that re-arranges some tokens, without being able to "deeply" affect / fix formatting.
As such is usually used either for non-compound constructs (aligning trailing comments) or in cases where the alignment is best-effort.
The tricky part of this is that, if not careful, aligning using the WhitespaceManager could introduce instances of lines that start going over the column limit as a result of alignment.
If you attempt to re-format the resulting code then, clang-format might take different formatting decisions for such lines, resulting in unstable formatting.

Feb 25 2020, 8:01 AM · Restricted Project
krasimir accepted D75006: [clang-format] Wrap lines for C# property accessors.

This is pretty cool!

Feb 25 2020, 5:18 AM · Restricted Project, Restricted Project

Feb 20 2020

krasimir accepted D74894: [clang-format] Merge name and colon into a single token for C# named arguments.

Thank you!

Feb 20 2020, 10:29 AM · Restricted Project, Restricted Project
krasimir added inline comments to D74894: [clang-format] Merge name and colon into a single token for C# named arguments.
Feb 20 2020, 5:28 AM · Restricted Project, Restricted Project

Feb 11 2020

krasimir accepted D74265: [clang-format] Improve handling of C# attributes.
Feb 11 2020, 3:34 AM · Restricted Project, Restricted Project

Feb 5 2020

krasimir accepted D74043: [clang-format] Do not treat C# attribute targets as labels.
Feb 5 2020, 8:03 AM · Restricted Project, Restricted Project
krasimir accepted D74050: [clang-format] Do not merge short C# class definitions into one line.

Thanks! Looks like this is OK also for Java, I'm not sure about ObjC. If it happens to affect other languages negatively, we can restrict by adding language-specific checks.

Feb 5 2020, 7:53 AM · Restricted Project, Restricted Project
krasimir added a comment to D74043: [clang-format] Do not treat C# attribute targets as labels.

This seems OK, but it feels a bit messy that the text [target: becomes the opening square bracket. I think this might be just good enough for these attributes, so I'm ok with this for now. But a more principled solution (for later, if we hit any dead ends with this) would be to introduce a new AnnotateToken type, like TT_CSharpAttributeTarget and make sure these are annotated properly.

Feb 5 2020, 5:59 AM · Restricted Project, Restricted Project

Jan 31 2020

krasimir accepted D72401: Fixes for spaces around C# object initializers.

Thank you!

Jan 31 2020, 5:51 AM · Restricted Project, Restricted Project

Jan 30 2020

krasimir accepted D73622: [clang-format] Improve support for multiline C# strings.
Jan 30 2020, 4:49 AM · Restricted Project, Restricted Project

Jan 29 2020

krasimir accepted D73622: [clang-format] Improve support for multiline C# strings.
Jan 29 2020, 7:40 AM · Restricted Project, Restricted Project
krasimir added a comment to D73622: [clang-format] Improve support for multiline C# strings.

This is pretty cool! Just a couple of nits.

Jan 29 2020, 7:12 AM · Restricted Project, Restricted Project

Jan 28 2020

krasimir accepted D73492: [clang-format] Handle quotes and escaped braces in C# interpolated strings.
Jan 28 2020, 6:22 AM · Restricted Project, Restricted Project
krasimir added inline comments to D73492: [clang-format] Handle quotes and escaped braces in C# interpolated strings.
Jan 28 2020, 3:00 AM · Restricted Project, Restricted Project

Jan 27 2020

krasimir added inline comments to D73354: clang-format: insert trailing commas into containers..
Jan 27 2020, 8:25 AM · Restricted Project, Restricted Project
krasimir committed rG36a8f7f6d8f5: [clang-format] Handle escaped " in C# string-literals (authored by krasimir).
[clang-format] Handle escaped " in C# string-literals
Jan 27 2020, 3:58 AM
krasimir closed D73353: [clang-format] Handle escaped " in C# string-literals.
Jan 27 2020, 3:58 AM · Restricted Project, Restricted Project
krasimir added a comment to D73354: clang-format: insert trailing commas into containers..

An alternative approach (I'm not endorsing this) that would *in theory* circumvent non-idempotency issue (but would be more fiddly~fiddly to implement and spill across different layers of the formatter):
This is just a rough idea and can have multiple issues in itself. In general the trick is that if we can teach the token penalty computer and the format outputter about this, we should be able to use it together with other formatting decisions.

  • add a new synthetic (annotated) token type, something like TT_PossiblyMissingTrailingComma, that would capture the length-0 text range where this could be inserted;
  • use the algorithm here to splay it into the annotated token stream;
  • mark it so that no newline can be inserted before such a token
  • modify the penalty calculation algorithm to penalize for inserting a newline after this token: if we're inserting a newline after this token and if this token was inserted at a position at or past the maximal number of columns, add a PenaltyExcessCharacter for it.
  • during outputting, if this token is followed by a newline, output it as ,; otherwise output it as an empty string or do not output it.
Jan 27 2020, 3:58 AM · Restricted Project, Restricted Project

Jan 24 2020

krasimir accepted D73353: [clang-format] Handle escaped " in C# string-literals.

Thank you!
Should I commit this for you?

Jan 24 2020, 8:13 AM · Restricted Project, Restricted Project
krasimir accepted D73335: clang-format: [JS] options for arrow functions..
Jan 24 2020, 8:06 AM · Restricted Project, Restricted Project
krasimir added a comment to D73354: clang-format: insert trailing commas into containers..

General comment:

Jan 24 2020, 7:55 AM · Restricted Project, Restricted Project
krasimir added a reviewer for D73354: clang-format: insert trailing commas into containers.: sammccall.
Jan 24 2020, 7:46 AM · Restricted Project, Restricted Project
krasimir requested changes to D73335: clang-format: [JS] options for arrow functions..
Jan 24 2020, 7:44 AM · Restricted Project, Restricted Project
krasimir added inline comments to D73353: [clang-format] Handle escaped " in C# string-literals.
Jan 24 2020, 7:27 AM · Restricted Project, Restricted Project
krasimir added inline comments to D73353: [clang-format] Handle escaped " in C# string-literals.
Jan 24 2020, 7:26 AM · Restricted Project, Restricted Project
krasimir added a comment to D73335: clang-format: [JS] options for arrow functions..

FYI I've started a conversation on whether SLS_All should be the default Google style. But the option I think is useful in either case.

Jan 24 2020, 5:37 AM · Restricted Project, Restricted Project

Jan 23 2020

MyDeveloperDay awarded rG1e0174a93cfd: Treat C# `using` as a control statement a Like token.
Jan 23 2020, 4:59 AM
krasimir committed rG1e0174a93cfd: Treat C# `using` as a control statement (authored by krasimir).
Treat C# `using` as a control statement
Jan 23 2020, 4:23 AM
krasimir closed D72144: Treat C# `using` as a control statement.
Jan 23 2020, 4:23 AM · Restricted Project, Restricted Project
krasimir accepted D72144: Treat C# `using` as a control statement.

I'll submit this for you.

Jan 23 2020, 3:26 AM · Restricted Project, Restricted Project
krasimir requested changes to D72144: Treat C# `using` as a control statement.

I looked up the C# reference and all the examples are top-level, so having top-level test cases here would be useful, as people would expect copy-pasting an example snippet to just work.
Sorry about asking you to go back-and-forth.

Jan 23 2020, 3:20 AM · Restricted Project, Restricted Project

Jan 22 2020

krasimir accepted D72144: Treat C# `using` as a control statement.
Jan 22 2020, 8:31 AM · Restricted Project, Restricted Project

Jan 20 2020

krasimir accepted D73026: clang-format: [JS] fix `??` opreator wrapping..
Jan 20 2020, 7:53 AM · Restricted Project, Restricted Project

Jan 17 2020

krasimir accepted D72907: clang-format: [JS] pragmas for tslint, tsc..
Jan 17 2020, 4:37 AM · Restricted Project
krasimir committed rG33463cfba2be: clang-format: fix spacing in `operator const char*()` (authored by krasimir).
clang-format: fix spacing in `operator const char*()`
Jan 17 2020, 4:35 AM
krasimir closed D72911: clang-format: fix spacing in `operator const char*()`.
Jan 17 2020, 4:35 AM · Restricted Project
krasimir updated the diff for D72911: clang-format: fix spacing in `operator const char*()`.
  • Fix typo
Jan 17 2020, 4:26 AM · Restricted Project
krasimir added inline comments to D72911: clang-format: fix spacing in `operator const char*()`.
Jan 17 2020, 4:25 AM · Restricted Project
krasimir updated the diff for D72911: clang-format: fix spacing in `operator const char*()`.
  • Fix typo
Jan 17 2020, 4:25 AM · Restricted Project
krasimir updated the diff for D72911: clang-format: fix spacing in `operator const char*()`.
  • Address review comments
Jan 17 2020, 4:25 AM · Restricted Project