-
Notifications
You must be signed in to change notification settings - Fork 12
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
Formatting of launch configuration files not possible #13
Comments
Such a result usually comes if the Xtext default formatter is used, but in LcDsl, a custom formatter implementation is already bound in the AbstractLcDslRuntimeModule, so I think this issue has been solved in the meantime and can be closed. |
Yes, a formatter is bound and in place. However it does not fully work, and I haven't had time to look into the issue. It seems that indentation is only correctly applied for the first line of a block, but not for the others... |
Thanks for the info. You are right, I experienced the same behaviour. I will take a look at it and try to provide a pull request to improve the formatter. |
This would be really appreciated, thanks! |
Hi Markus, I analysed the problem and found out that in order to make the indentation properly work, the formatter should append a
However, it could result in some unwanted side-effects when applying this customization to all Thanks a lot for you feedback! |
Hey, Thanks for the analysis! I can certainly test this, yes :) It will just take me a little time to do so... Cheers, |
I tried this out quickly, and it seems that once I remove indentation on any line within a launch configuration, format will not bring it back :| It seems this kind of override is also never called, since the other dispatch methods in the file get precedence when they match - at least a Syserr in the method was never called. |
@mduft Could it be possible that your code base is different from that what is checked in in the master branch? https://github.com/mduft/lcdsl/blob/master/com.wamas.ide.launching/src/com/wamas/ide/launching/formatting2/LcDslFormatter.xtend |
Nope, I just freshly cloned, maybe something else went wrong... You just added that method as it is shown at the end of the file, right? Because that's what I tried :D |
Ah, I think I found it - will re-test :) There was a problem with my setup. |
OK, now it works. The only problem I observed when formatting our lc files is that blank lines disappear... We have a lot of blank lines separating blocks of arguments belonging together, blank lines before comments, etc. |
Nice, thanks :) Can you provide a pull request? I would otherwise try to squeeze the changes in somewhere in the next days... |
Yes, I will provide a PR soon. |
This is great news, thanks :) |
I created the PR |
Thanks a lot. Will release ASAP. |
New build is available at https://mduft.github.io/lcdsl-latest/ - you can verify (and hopefully enjoy) your changes there :) |
Using CTRL+SHIFT+F in eclipse results in "complete content of file is moved to first line of file".
So instead of
java configuration XXX : BaseJavaLog4jLaunch {
memory max = 1280M;
main-class com.test.something.Main;
project com.test.something;
argument "42";
vm-argument "-Dtarget.home=${target_home}" ;
}
I get
java configuration XXX : BaseJavaLog4jLaunch { memory max = 1280M; main-class om.test.something.Main; project com.test.something; argument "42"; vm-argument -Dtarget.home=${target_home}" ; }
The text was updated successfully, but these errors were encountered: