Sublime Forum

Coffeescript syntax highlighting failing in very basic way

#1

I am using coffeescript and suddenly it cannot properly handle this simple piece of code:

image

The close quote not being seen and everything after that is part of a string as evidenced by the red “else …”

Since this is so basic I worry it’s something I might have done in my environment.

0 Likes

#2

I just noticed it’s the ‘new’ that is doing it.

image

image

0 Likes

#3

That doesn’t look like a syntax highlighting issue, but an error reported by some plugin you’ve installed. You can see a red question mark in the gutter.

0 Likes

#4

Now this is even more confusing

The error in the gutter is due to mismatched parens. I disabled bracket highlighter but the issue is still there.

0 Likes

#5

I am probably being annoying now, but moving things around fixes everything …

0 Likes

#6

Might be worth raising an issue in the GitHub Repo for the CoffeeScript package (assuming that is the one that you’re using).

0 Likes

#7

I just scrolled the window a few hundred pixels … and the highlighting fixed itself …

I think something else might be going on here.

0 Likes

#8

Parentheses after new Error are treated as function parameters.

Fixed by https://github.com/SublimeText/CoffeeScript/releases/tag/4143-2.4.4

3 Likes

#9

Much appreciated! I can verify it’s fixed for me.

0 Likes

#10

Hi - there are other issues with this syntax and I am wondering how you would like me to communicate them to you?

0 Likes

#11

Ideally through issues in repo to ensure they don’t get burried.

0 Likes