atom / language-clojure

Clojure package for Atom
Other
49 stars 48 forks source link

Incorrect Highlighting of List With String Element First in a Macro #63

Open mjbvz opened 7 years ago

mjbvz commented 7 years ago

From: https://github.com/Microsoft/vscode/issues/24603

Bug

For the Clojure macro:

({:xyz ("a b", "c d")})

The first string element of the list breaks syntax highlighting

screen shot 2017-04-12 at 1 14 04 pm

@vadim0x60 provided some more info about this bug here: https://github.com/Microsoft/vscode/issues/24603#issuecomment-293595976

Versions


Edit by @rsese to add examples from https://github.com/atom/language-clojure/issues/79

screen shot 2018-10-24 at 10 58 49 am

("foo" "bar" "baz")

The first element of the list is being highlighted as a function, when it should be highlighted as a string like the others.

For numbers, the highlighting is correct:

screen shot 2018-10-24 at 11 06 02 am

Reproduced on 1.34.0-nightly5 with macOS 10.12.6.

Here is a fuller example illustrating the behavior:

(case "bar")
  ("foo" "bar") 1
  "baz" 2
  ("how are you" "test") 3)

image

Notice that "foo" and "how" are blue, "bar" and "baz" are green, and "are you" and "test" are gray. Also, 1 and 2 are orange and 3 is green.

eskemojoe007 commented 5 years ago

This has been open a while, and I just ran across it as a major issue to some of my files with the case command as shown in the original post.

Carl-Elder-Porter-IV commented 3 years ago

This issue is significantly more impactful when case matching grouped strings with spaces in them. It will cascade throughout all code below it. For example:

(case my-string
    ("foo 1" "foo 2" "foo 3")
    "group 1"
    ("foo4" "foo5" "foo6"
    "group 2"
    "default")

All code below this will be highlighted as a string, except for strings. This also breaks proto-repl code block sending.