Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-126714

qmlls: avoid psychedelic highlighting mode on invalid code

    XMLWordPrintable

Details

    • fcc4fd340 (dev), 0d5bf1dfe (6.8)

    Description

      From the original bug report:
      Coloring of the syntax highlighter can change color mid-keyword so you can have for example a Rectangle partly rendered in blue and partly in green. This happens as you type and the syntax highlighter just can't keep up; for example, when fixing missing closing braces or adding missing commas on json array items where multiple lines require re-parsing for syntax highlighting at the same time due to knock-on effects of semantic changes/fixes.
      See "Poor Color Breaks" for an example.

      Steps to reproduce:

      1. have a valid file with correct semantic highlighting
      2. add some incomplete code somewhere, like an empty enum that breaks the current parser (enum HelloWorld {} for example)
      3. the semantic highlighting is unchanged and looks psychedelic because all the offsets behind the incomplete code are not adapted and will highlight wrong parts of the code

      For example, when deleting a line, the semantic colors behind that line should be assumed to be unchanged and should be adapted to the new line/column/offset numbers.
      Same for adding text or lines, etc. Like this we don't get any highlighting for the currently incorrect code but then we should be able to limit the psychedelic parts for all the unedited parts of the code.

      The longterm strategy for this would be to implement the new parser, but this issue is about the short-term solution.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              semih.yavuz Semih Yavuz
              sami.shalayel Sami Shalayel
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes