Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-31418

Multi line suggestion aplied word-by-word support in the TextEditor

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • P2: Important
    • Qt Creator 15.0.0-beta1
    • None
    • Editors
    • None
    • 7dec58dbb (master), def7d6c81 (master)

    Description

      I've been investigating the behavior of multi-line suggestions in the TextEditor. My observations indicate that the suggestion is treated as a single line, and attempts to set the cursor to move to the next line have not been successful. I tried forcing it to two linesĀ  block->setLineCount during insertion, but this didn't help. The new line is not recognized as expected.

      Inserting a newline character ('\n') or any word that does not align with the suggestion (grayed text) causes the suggestion to be destroyed. I understand that QTextCursor behaves like a user during insertion, allowing the suggestion to remain visible as long as the text being inserted aligns with the suggestion. However, inserting anything misaligned or pressing [ENTER] also destroys the suggestion.

      I'm unsure if it can be resolved with the current TextEditor implementation. As a workaround, I'm also considering re-inserting the suggestion without the already consumed lines.

      Additionally, it appears that the TextEditor is designed for handling a single suggestion at a time, although we support multiple suggestions to allow cycling through and selecting one. For this purpose, we reinsert the suggestion to update it. Moreover, since the TextEditor provides access to the inserted suggestion through its interface, it could be beneficial to have the capability to update the suggestion, when changes occur in the already inserted suggestion.

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-31418
        # Subject Branch Project Status CR V

        Activity

          People

            davschul David Schulz
            lukasz.papierkowski Lukasz Papierkowski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes