Skip to content

Incorrect highlighting #174

@ouuan

Description

@ouuan

Describe the bug

  1. Highlighting is incorrect when inline/block comments and string literals are mixed together.
  2. Raw string literals and string literals with prefixes are not supported.

To Reproduce

// /*
/*
// */
"//\"" // ""
R"(//"/*")"
R"(//"/*")"
uR"test(//"R"(/*)"*/")test"
u8"test"
L"test"
U"test"

Screenshots

CP Editor:

image

VS Code: (mistake due to string literals with different character kinds cannot be concatenated)

image

Environment

  • OS: Manjaro
  • Version: 5.9.8

Additional context

We don't need to fix it before 6.0, because CPers seldom write such codes. There are usually not many comments, and string literals are not much more than "Yes"/"No"/"Impossible", etc.

This is a QCodeEditor issue, which is similar to ouuan/QCodeEditor#2, open here for easier bug tracking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmedium_priorityMedium Priority IssuesqcodeeditorIssue related to QCodeEditor

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions