Stop special-casing `when` #111

Merged
merged 1 commit into from Oct 4, 2016

Projects

None yet

3 participants

@princemaple
Contributor
princemaple commented Oct 4, 2016 edited

The syntax highlighting for when has being ambiguous and confusing.
This PR fixes the highlighting by removing the special highlighting for when in def and defp

Before:
sp161005_091841

After:
sp161005_091728

Also, whens following defmacro and defmacrop are not special-cased, they look like "After".

@talklittle
Contributor

The root problem is that defs spanning multiple lines are not recognized as part of the same expression.

E.g. wrong variable highlighting of var2 in:

def myfunc(var1,
           var2)

So the inconsistent when highlighting is a symptom of the bigger underlying bug

@princemaple
Contributor

@talklittle I would consider that as a separate issue, because when in any places other than def and defp is highlighted as in "After", at least this one can be consistent. But you are right, not being able to go multi line is a bigger issue.

@josevalim josevalim merged commit cd92903 into elixir-lang:master Oct 4, 2016
@princemaple princemaple deleted the princemaple:patch-2 branch Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment