atom-community / atom-community/language-scala

Syntax highlight bug: '\r'|'\n'

Open
#64 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
51
Forks
25
PR merge metrics
No merged PRs in 30d

Description

This (slimmed down) function:
```scala
def consume (c : Char) {
state =
(state,c) match {
case (HeaderLine(ln),'\r'|'\n') => { processHeaderLine(ln) ; NextLine(""+c) }
}
}
```
renders as this:

![image](https://user-images.githubusercontent.com/11626018/96821790-60ef7600-1474-11eb-8c9f-9d927c331377.png)

Adding spaces like `'\r' | '\n'` fixes the issue.

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported rendering with the Scala snippet, then inspect the syntax-highlighting grammar or rules used for character literals and the `|` operator. Verify the fix against both `'\r'|'\n'` and `'\r' | '\n'`, and confirm the rendered highlighting is correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.