-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indentation inside lambda is wrong #105
Comments
Thanks for the report! Do you have this issue without the I quite recently made some changes with regard to how indentation works in order to solve another bug. It would be interesting to know if this error is a result of that or not. Is this something you know used to work? If not, would you be willing to test on an earlier commit than that? If you install from MELPA STABLE, the version there (0.9.0) should not contain this latest fix and may be a good candidate to test against. |
It was about the same. Used the file here when testing also. https://stable.melpa.org/packages/csharp-mode-0.9.0.el [Test(Description = "BLAH")]
public void TestFunction()
{
AsyncTest.Run(async () =>
/*|*/
{ // inexpr-class , brace-list-open
/*|*/RandomObject abc = // brace-list-intro
/*|*/new RandomObject(); // brace-list-entry
// ^ Not lined up
});
}
// WORKS
[Test(Description = "BLAH")]
public void TestFunction2()
{ // defun-open
RandomObject obj = // defun-block-intro
new RandomObject(); // statement-cont[3]
}
public void TestFunction3()
{
AsyncTest.Run(() =>
{ // inexpr-class, brace-list-open
RandomObject b = // brace-list-intro
new RandomObject(); // brace-list-entry
});
}
public void TestFunction3()
{
Test.Run(() =>
{ // inexpr-class, brace-list-open
RandomObject b = // brace-list-intro
new RandomObject(); // brace-list-entry
});
} |
This is now fixed in the rework branch as well |
When testing this in the rework branch, I get the following indentation: [Test(Description = "BLAH")]
public void TestFunction()
{
AsyncTest.Run(async () =>
/*|*/
{ // inexpr-class , brace-list-open
/*|*/RandomObject abc = // brace-list-intro
/*|*/new RandomObject(); // brace-list-entry
// ^ Not lined up
});
}
// WORKS
[Test(Description = "BLAH")]
public void TestFunction2()
{ // defun-open
RandomObject obj = // defun-block-intro
new RandomObject(); // statement-cont[3]
}
public void TestFunction3()
{
AsyncTest.Run(() =>
{ // inexpr-class, brace-list-open
RandomObject b = // brace-list-intro
new RandomObject(); // brace-list-entry
});
}
public void TestFunction3()
{
Test.Run(() =>
{ // inexpr-class, brace-list-open
RandomObject b = // brace-list-intro
new RandomObject(); // brace-list-entry
});
} For me, that is mostly exactly like I'd want it to be, with one (1) exception 😀 The first case with [Test(Description = "BLAH")]
public void TestFunction()
{
AsyncTest.Run(async () =>
/*|*/
{ // inexpr-class , brace-list-open
/*|*/RandomObject abc = // brace-list-intro
/*|*/new RandomObject(); // brace-list-entry
// ^ Not lined up
});
// /\
// L____ Indentation based on AsyncTest.Run-call.
} If it's possible to make |
If you remove the comment AsyncTest.Run(async () =>
/*|*/ // <------------------- this one
{ // inexpr-class , brace-list-open
/*|*/RandomObject abc = // brace-list-intro
/*|*/new RandomObject(); // brace-list-entry
// ^ Not lined up
}); It works! |
I'm speechless. That's amazing! At what point do we replace (Can you tell I'm excited about all this?) |
Yay! I think it is getting ready! It is missing the imenu stuff - should we put that back in? Is that something that could be fsf compliant?
That's great to hear :) |
I guess we could... But I'm not really using
Yes. I've scanned the current code for commits and contributors. 99.99% of the code there is written by me, and I have assigned copyright with FSF. There's 3-4 external contributors, fixing mostly documentation (and one instance of configuration). Nothing we can't do from scratch if we need to. And most importantly: Nothing of Dino's original code remains, so his copyright does not need to be considered. This should be very simple to get past the FSF legal-gate if we want to. |
Using c-show-syntactic-information.
The syntactic information does not seem to be consistent so it's hard to write the indentation settings for it.
My settings, although I've also tested with the default c style from csharp mode.
The text was updated successfully, but these errors were encountered: