Groovy-Emacs-Modes / groovy-emacs-modes

A groovy major mode, grails minor mode, and a groovy inferior mode.
84 stars 39 forks source link

request: improve detection of multi-line statements #23

Closed dbyron0 closed 7 years ago

dbyron0 commented 8 years ago

For code like this:

class Foo {
   public void bar() {
      int blah;
      int bar = blah
         .method1()
         .method2()
   }
}

when the cursor is on the lines with .method1() and .method2(), C-c C-o reveals that the current syntactic context is statement. I'd love for groovy mode to recognize these as statement-cont so they're indented properly. I can't tell if the issue is with c-guess-basic-syntax or groovy-vsemi-p.

I'd love a hand confirming my understanding of the issue, and even better, a fix.

Thanks much.

-DB

russel commented 8 years ago

I believe this situation has been covered by changes in the past. I wonder if there is a bug in the code sample above in that there is a dot after blah and before method1.

dbyron0 commented 8 years ago

You're right there was an extra . above. I've removed it. Still get the same behavior though.

russel commented 8 years ago

Hummm… maybe it was the d-mode we sorted this issue in, and I thought we had fixed it in the groovy-mode. I'll have to see what can be done.

Though, if you find someone who can solve this and provide a pull request, that would be excellent.

dbyron0 commented 8 years ago

Thanks. I'm pretty sure my lisp skills are not up for this. Or at least, even if it takes you awhile, I bet it still takes me a fair bit longer :(

russel commented 7 years ago

We have changed the Groovy mode from being a CC-Mode derived one to being a standalone one. We are therefore closing all issues relating to the old mode. If you try the new mode and see any problems please post a new issue.