This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Emacs multiple line methods (syntax highlighting error)

1 reply
mads379
Joined: 2010-06-07,
User offline. Last seen 2 years 19 weeks ago.
Hi, 
Is the scala mode for emacs still maintained? When a method spans multiple lines like this: 
def parseArguments(template: Template,                              arguments: List[String]): Validation[Error, Environment] = {
  .... }
The second line doesn't get highlighted. 
Thanks,Mads Hartmann Jensen 
Grey
Joined: 2009-01-03,
User offline. Last seen 42 years 45 weeks ago.
Re: Emacs multiple line methods (syntax highlighting error)
I once took a swag at that one awhile back.  While I was able to tweak some indentation issues, so for example the second line would properly indent, I never fully solved multiline highlight issue successfully.  Use of a 'val' or a 'var' before the "arguments" parameter does trigger correct highlighting.  Their absence results in the highlighting vanishing for the parameter.
So I guess I have a partial solution.  FWIW, I did not walk away feeling the problem itself is intractable for being pretty close most of the time using emacs textual approach to these things.   I guess these days with emacs having a conduit via ensime's communication with the incremental compiler giving type and src position data a perfect solution is now possible with some effort.
My old imperfect tweaks to the base scala mode.https://github.com/RayRacine/scamacs/tree/master/scala
On Tue, Mar 22, 2011 at 6:24 AM, Mads Hartmann Jensen <mads379@gmail.com> wrote:
Hi, 
Is the scala mode for emacs still maintained? When a method spans multiple lines like this: 
def parseArguments(template: Template,                              arguments: List[String]): Validation[Error, Environment] = {
  .... }
The second line doesn't get highlighted. 
Thanks,Mads Hartmann Jensen 



--
The object of life is not to be on the side of the majority, but to escape finding oneself in the ranks of the insane. - Marcus Aurelius

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland