Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator 4.3.1 code highlighting for custom files not working
Forum Update on Monday, May 27th 2025

Qt Creator 4.3.1 code highlighting for custom files not working

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
7 Posts 2 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lawand87
    wrote on last edited by lawand87
    #1

    I am using Qt Creator and opening TypeScript files using it but the code highlighting is not working. I used the "Import existing project" option to open a project that contains some .ts files, opened one of the files and the "a highlight definition was not found" error. Then I added *.ts to the patterns of the application/javascript MIME type but this didn't make the highlighting work. Then I tried renaming the file from filename.ts to filename.js but this also didn't make the highlighting work. How do I get the IDE to highlight my ts files?

    Update: it seems that the IDE is highlighting ts files as html files.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Can you check against a more recent version of Qt Creator ? The actual is 4.4.1

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lawand87
        wrote on last edited by
        #3

        I tried using v4.5.0 but saw the same problem. I'm using Ubuntu 64bit

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lawand87
          wrote on last edited by
          #4

          by the way, I actually noticed that if I rename a *.ts file to a *.js then the highlighting doesn't work, but then if I close that file and open it again, the highlighting then works

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lawand87
            wrote on last edited by lawand87
            #5

            I was able to isolate the issue. Adding extensions other than *.ts to the application/javascript MIME type enables code highlighting for those extensions, but not for *.ts. I went through all MIME types in Qt Creator and noticed that there are other MIME types (for example mp2t) that include ts. I was able to remove ts from all of them except from one, the application/x-linguist MIME type. For some reason, this MIME type is not possible to be edited. Everytime I edit it, it automatically reverts. I think this is the issue.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Thanks for sharing your findings.

              Did you check the bug report system to see if there's anything related ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • L Offline
                L Offline
                lawand87
                wrote on last edited by
                #7

                I submitted the bug: https://bugreports.qt.io/browse/QTCREATORBUG-19449

                1 Reply Last reply
                1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved