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

Add syntax highlighting for typed string literals and user-defined literals

    XMLWordPrintable

Details

    • All
    • b795b4298 (master)

    Description

      This might be a request I need to pass on to KSyntaxHighlighting, but a cursory glance at that repository makes it seem like it may have support for this already in their isocpp definition, so I'm wondering if maybe the issue is that Qt Creator just doesn't have an entry for altering the relevant colors.

      When Qt 6.4 introduced the StringLiterals namespace I was excited to try it out as a replacement for QStringLiteral; however, I've actually kept the later as for me personally something about

      u"This is a String"_s; 
      

      when the 'u' and '_s' are the same color as the actual string somehow feels less readable when there are a large number of strings in sequence.

      I'm hoping that Qt Creator can be changed so that these typed strings with user-defined literals can be displayed as they are on both cppreference.com and doc.qt.io (and the code block above!), where the operator portion of the strings is regarded as a separate entry and can be painted a different color (or at least left uncolored):

      Without the strings being displayed as shown above, I know it's only a matter of time before I add new strings that are inadvertently missing the additional operator/type (which of course won't produce a warning/error) since they currently don't stand out from strings that do have them when there are many strings close-by.

      Please let me know if this actually isn't supported by KSyntaxHighlighting yet and I need to knock on that door instead.

      Thanks.

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            oblivioncth Chris Heimlich
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes