icsharpcode / AvalonEdit

The WPF-based text editor component used in SharpDevelop
http://avalonedit.net/
MIT License
1.85k stars 471 forks source link

incorrect JavaScript syntax highlighting for quotes in arrays #336

Closed cbries closed 1 year ago

cbries commented 2 years ago

Commit: up to the latest master variant (395ef8166870e2c6e1f63a7d97ac22e5e646e790)

Steps to reproduce: (1) load the AvalonEdit solution (2) Build & Run the Sample project ICSharpCode.AvalonEdit.Sample (3) switch to "JavaScript" mode (4) paste the following JavaScript:

const texts = [
  `Hello world`,
  `My 'Comma`,
  `My end of Comma'`, 
  `My "Comma`,
  `My incorrect highlighting " Dingens`,
  `Inside "it seems to work" without issue.`
]

(5) result image

As you can see the quote highlighting is going over two or more lines. The JavaScript code is absolutly valid as I see: image

siegfriedpammer commented 2 years ago

This is likely because AvalonEdit only has syntax highlighting for variants of JS from the stone age. We will gladly accept a PR that fixes this!

cbries commented 1 year ago

Seems to be solved by AvalonEdit v6.3.0.0 and higher:

image