microsoft / vscode-css

CSS Textmate grammar for syntax highlighting
Other
17 stars 15 forks source link

CSS multiline string incorrect syntax highlighting #28

Open niwazukihon opened 6 months ago

niwazukihon commented 6 months ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Create a css file. Write, for example
    @import url('a-really-long\
    -url');
  2. The syntax highlighting is wrong. It seems to not interpret the string as a whole.

This was mentioned in issue microsoft/vscode#125739, which was closed and locked with a reference to another repo, but that repo was archived. Is there a plan to fix this bug?

RedCMD commented 6 months ago

should move report to https://github.com/microsoft/vscode-css

caused by \\s*. it matches the ending newline. resulting in the begin anchor \\G being placed at the beginning of the next line (VSCode TextMate bug?) causing ^(?<!\\G) to always fail image

I don't know why \\s* was placed there as it does nothing other than cause issues

RedCMD commented 1 month ago

caused by https://github.com/atom/language-css/issues/123 https://github.com/microsoft/vscode-css/commit/2bc6abb2ee58b063f80999fa805d90d2f542da22 the anchor moving bug also happens in TextMate2.0 https://github.com/microsoft/vscode-textmate/issues/237

I still don't know why capturing the newline is needed and why (?<!\\G) is needed as removing either or both fixes it

https://github.com/microsoft/vscode-css/blob/c216f777497265700ff336f739328e5197e012cd/grammars/css.cson#L720-L721