Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive for comment creation with /* #1

Open
stampyzfanz opened this issue Jan 19, 2022 · 1 comment
Open

False positive for comment creation with /* #1

stampyzfanz opened this issue Jan 19, 2022 · 1 comment

Comments

@stampyzfanz
Copy link
Collaborator

Steps to reproduce:

  1. Open a document formatted with hjson-mode
  2. Paste into editor
{
  key: value /*
}

One can notice that /* is classified as a comment and is continued for the rest of the document. A temporary fix is creating a comment in the next like using // or # and ending the multiline comment by using */

{
  key: "value /*"
  // */
}

The reason this exists is because the syntax-propertize-function is of higher priority than font-lock-defaults and I can't work out how to disable comments in the syntax-propertize-function which are placed where strings are parsed.

@dqsully
Copy link
Member

dqsully commented Jan 31, 2022

This is way outside of my wheelhouse, but I wrote the current version of the Hjson syntax highlighting for TextMate-like editors (Atom, VS Code, etc.). To solve this problem, I had the regex for a quoteless string value consume text through the end of the line (see here). Maybe you could add something in your hjson-highlights section that highlights such strings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants