Incorrect syntax highlighting for # inside .properties values

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor incorrectly highlights # and the text following it as a comment when # appears inside a value in a .properties file.

For example, in password=abc#def, Cursor highlights #def as a comment.

The same file is highlighted correctly in VS Code. This appears to be a syntax-highlighting/grammar issue rather than a parsing issue.

Steps to Reproduce

  1. Create or open a .properties file in Cursor.
  2. Add the following content:
# This is a comment
password=abc#def
anotherPassword=test!@#
  1. Observe that Cursor highlights #def and the trailing # as comments.
  2. Open the same file in VS Code and observe that the # characters are highlighted as part of the property values.

Expected Behavior

# should be highlighted as part of the property value when it appears within a value.

In Java .properties syntax, # starts a comment when it is the first non-whitespace character of a line. A # appearing within a property value is part of that value.

VS Code correctly highlights the same example.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Version Information

Cursor Version: 3.16.29 (user setup)
OS: Windows 11 25H2
File type: .properties

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report with screenshots and repro.

This behavior comes from the built-in .properties syntax highlighting that Cursor inherits from VS Code. Plain VS Code with no extensions renders password=abc#def the same way. You can verify it with code --disable-extensions. In your VS Code it looks correct because you have the Language Support for Java™ by Red Hat extension installed as part of the Java Extension Pack. It adds a more accurate .properties grammar where # is treated as part of the value unless it’s at the start of the line.

Fix: install the same extension in Cursor. Open the Extensions view, search for Language Support for Java, and install it. The highlighting should be correct here too.

This is a long-standing limitation in the upstream grammar, not something specific to Cursor and not related to your settings, so there likely won’t be a global fix on our side. The extension above should solve it. Let me know if anything still looks off after installing it.

Thanks for the clarification. I confirmed that the difference was caused by the Red Hat Java extension installed in VS Code. After installing the same extension in Cursor, .properties highlighting works correctly. Thanks for identifying the cause!