atom-community / atom-community/language-scala

Comments within type parameters break highlighting

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

Description

I'm not sure how exactly to fix this, but having an inline block comment that happens to be in a type parameter seems to break the syntax highlighting.

I'm converting some code, whereby I'm removing a type parameter. I've simply commented out the specific type parameter, but the comment is not highlighted correctly.

Normal one line block comments are fine:

```
def foo(x: Int) = { /* this works */ 5 }
```

But the following breaks:

```
def foo[S,/*F[_]:Foldable,*/ A](x: Int) = 5
```

I've narrowed it down to the `[` which changes the pattern, causing the highlight to not work.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two Scala snippets in Atom's language-highlighting grammar and compare the behavior of a block comment inside and outside type parameters. Trace the pattern affected by `[` and verify that the commented type parameter no longer disrupts highlighting while ordinary block comments still work.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.