emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CC Mode lambda function help


From: Theodor Thornhill
Subject: CC Mode lambda function help
Date: Fri, 25 Sep 2020 23:05:42 +0200

Hello!

I am reworking the csharp mode found at
https://github.com/josteink/csharp-mode, and I have some problems I am
really struggling to fix, or find information about in the manual (if
it is there):

1. Lambda functions

Consider this code:

```
AsyncTest.Run(async () =>
{
    Something xyz =
        new SomethingMore();
});
```

Right now this indents as:
```
AsyncTest.Run(async () =>
              {
                  Something xyz =
                  new SomethingMore();
              });
```
I cannot find what c-lang-defconst to configure, or what c-style-alist
combination to pick to get this.  Any pointer to what is wrong would be
super helpful.

2. Attributes

Consider this code:

```
[DllImport("something.dll")]
public extern int GetSomething();

```

Gets indented as:
```
[DllImport("something.dll")]
    public extern int GetSomething();
```

This I attribute (pun intended) to vsemi, since when one is added:
```
[DllImport("something.dll")];  // <-- notice this
public extern int GetSomething();
```

It behaves correctly. In addition, that semi fixes fontification for the
method name. I would like not to use the 'statement-cont', since that
only looks like a symptom, rather than a fix.

I'd love some pointers to how I would best handle this. 

To reproduce this, you have to (unfortunately...) clone the
abovementioned repo, checkout the 'rework' branch, then byte compile
that file.  I am sorry there is no quicker way to get to that code.

These snippets should be enough to illustrate my issues.

Have a lovely day,
Theodor Thornhill




reply via email to

[Prev in Thread] Current Thread [Next in Thread]