Current filter:
                                You should refresh the page.
                                  • Hello,

                                    I have this code :

                                    [C#]
                                    public int? GetId(string cnk, ArticleType articleType)
                                    [C#]
                                    { DomainObjects.Article article = this.articleDal .ReadByCnk(cnk) .SingleOrDefault(x => x.ArticleType == articleType.ToString()); if (article != null) return article.Id; return null; }

                                    When I format I get this mess :

                                    [C#]
                                    public int? GetId(string cnk, ArticleType articleType) { DomainObjects.Article article = this.articleDal .ReadByCnk(cnk) .SingleOrDefault(x => x.ArticleType == articleType.ToString()); if(article != null) return article.Id; return null; }
                                • Dmitry O (DevExpress) 09.24.2018

                                  Hi Christian,

                                  Thank you for providing the settings and code snippets.

                                  I have reproduced the problem, we will try to fix it shortly. As a workaround, you can temporary disable two formatting options to avoid unexpected code formatting:

                                  1. CodeRush->Options->Editor->C#->Formatting->Wrapping->Chained Method Calls: disable the item check box
                                  2. CodeRush->Options->Editor->C#->Formatting->Wrapping->Lambda Expression: disable the item check box

                                  Also, could you please provide us with formatted code snippets which you would like to have after applying CodeRush formatting?
                                  Probably, we can help you configure your CodeRush formatting options more precisely, for expected result code?

                                • Christian Ista 09.24.2018
                                  [C#]
                                  DomainObjects.Article article = this.articleDal .ReadByCnk(cnk) .SingleOrDefault(x => x.ArticleType == articleType.ToString());

                                  but the the expression body is set to have something like this :

                                  [C#]
                                  public string MyMethod() => "bla bla"
                                • Dmitry O (DevExpress) 09.25.2018

                                  Christian, you are right; CodeRush has different settings for expression bodies and lambda expressions.
                                  In my previous message I suggested disabling the "Chained Method Calls" and "Lambda Expression" options only as a temporary workaround.
                                  For now, we have fixed the problem and prepared a special build with the fix for you.
                                  Could you please enable "Chained Method Calls" and "Lambda Expression", install the build with a fix, try to reproduce the problem and notify as of your results?

                                  Note: Christian, I amn't sure what result you want to have after formatting. Could you take the settings from the screenshot into account? Maybe it's exactly what you want to have as a result.

                                1 Solution

                                Creation Date Importance Sort by

                                Fixed: