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. JavaScript formatting

JavaScript formatting

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
11 Posts 3 Posters 2.3k 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.
  • S Offline
    S Offline
    sideways
    wrote on 14 May 2018, 15:05 last edited by sideways
    #1

    Qt Creator 4.6.1 - I like the Qt Creator editor, but by default it does not handle JavaScript well. I cannot find how to format beyond a few settings in the Options/Text Editor tab. The built-in linter is also clumsy, relative to JSHint. The upgrade I just did to this version of Qt is forcing me to start using another editor for the JavaScript portion of my project. I'm using Atom, which I've used before just as a linter, because there is a nice JSHint plugin. But I really prefer the Qt Creator editor overall, so I'm wondering if anyone can guide me as to how to setup Qt Creator in a way that's more amenable to JavaScript.
    Thanks in advance.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 14 May 2018, 15:10 last edited by
      #2

      Hi and welcome to the forums
      Did it work better prior to upgrade to 4.6.1?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sideways
        wrote on 14 May 2018, 15:27 last edited by sideways
        #3

        It was better in the sense that the linter didn't show warnings in the pane's scrollbar, clouding it when displaying green lines for find and other such things. That's what pushed me over the edge to another editor. There doesn't seem to be a way to suppress lint warnings globally. The Refactoring menu option lets me comment individual lines, but there are hundreds of them, and to comment them all is annoying to me. JSHint lets me suppress the warnings globally with a comment at the top of the file. For me this is all about "==" versus "===". There is no performance hit from using ==, and I prefer to use it as my base logical equality operator. That way when I use ===, it's for a specific reason. It's all about personal preference.

        M 1 Reply Last reply 14 May 2018, 15:38
        0
        • S sideways
          14 May 2018, 15:27

          It was better in the sense that the linter didn't show warnings in the pane's scrollbar, clouding it when displaying green lines for find and other such things. That's what pushed me over the edge to another editor. There doesn't seem to be a way to suppress lint warnings globally. The Refactoring menu option lets me comment individual lines, but there are hundreds of them, and to comment them all is annoying to me. JSHint lets me suppress the warnings globally with a comment at the top of the file. For me this is all about "==" versus "===". There is no performance hit from using ==, and I prefer to use it as my base logical equality operator. That way when I use ===, it's for a specific reason. It's all about personal preference.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 14 May 2018, 15:38 last edited by
          #4

          @sideways
          Hi
          Im wondering what makes these checks.
          Could try disable the ClangCode model and restart Creator and see if it still shows the
          warnings in side ? I disabled it for c++ as it was often too happy.
          alt text

          But im not sure if its used for JS or thats some other plugin.

          S 1 Reply Last reply 14 May 2018, 15:48
          0
          • M mrjj
            14 May 2018, 15:38

            @sideways
            Hi
            Im wondering what makes these checks.
            Could try disable the ClangCode model and restart Creator and see if it still shows the
            warnings in side ? I disabled it for c++ as it was often too happy.
            alt text

            But im not sure if its used for JS or thats some other plugin.

            S Offline
            S Offline
            sideways
            wrote on 14 May 2018, 15:48 last edited by
            #5

            @mrjj Sorry, I don't see how to get to that Installed Plugins dialog. I do also doubt that Clang has anything to do with JS, but maybe it will disable this display warnings feature.

            M 1 Reply Last reply 14 May 2018, 15:51
            0
            • S sideways
              14 May 2018, 15:48

              @mrjj Sorry, I don't see how to get to that Installed Plugins dialog. I do also doubt that Clang has anything to do with JS, but maybe it will disable this display warnings feature.

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 14 May 2018, 15:51 last edited by
              #6

              @sideways
              Its in Help->About plugins
              Yeah, i have same doubt too but its worth a shot.

              S 1 Reply Last reply 14 May 2018, 16:20
              0
              • M mrjj
                14 May 2018, 15:51

                @sideways
                Its in Help->About plugins
                Yeah, i have same doubt too but its worth a shot.

                S Offline
                S Offline
                sideways
                wrote on 14 May 2018, 16:20 last edited by
                #7

                @mrjj
                An unusual menu/menu item for an interactive dialog, but my Clang is already turned off, so no luck there.

                M 1 Reply Last reply 14 May 2018, 16:31
                0
                • S sideways
                  14 May 2018, 16:20

                  @mrjj
                  An unusual menu/menu item for an interactive dialog, but my Clang is already turned off, so no luck there.

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 14 May 2018, 16:31 last edited by
                  #8

                  @sideways
                  ok. so not that. thx for testing.
                  Im not a JS user so lets see if some of the others have better ideas.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    sideways
                    wrote on 16 May 2018, 15:07 last edited by
                    #9

                    Well, it looks like this inquiry is a dead end here. It's a shame. The Atom editor is very cool in many ways, but it doesn't render text as crisply as the Qt editor. Qt renders the fonts in a crisp, legible manner, and black is very black.

                    A 1 Reply Last reply 16 May 2018, 17:48
                    0
                    • S sideways
                      16 May 2018, 15:07

                      Well, it looks like this inquiry is a dead end here. It's a shame. The Atom editor is very cool in many ways, but it doesn't render text as crisply as the Qt editor. Qt renders the fonts in a crisp, legible manner, and black is very black.

                      A Offline
                      A Offline
                      aha_1980
                      Lifetime Qt Champion
                      wrote on 16 May 2018, 17:48 last edited by
                      #10

                      @sideways: Feel free to file suggestions at bugreports.qt.io (one per wish). Please provide a link to the reports here. Thanks.

                      Qt has to stay free or it will die.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        sideways
                        wrote on 18 May 2018, 15:31 last edited by sideways
                        #11

                        Thanks for the link. I'm having the opposite problem now. I'm reconsidering living with the beige blobs in my scrollbar, because I'm missing too many C++ style features that the QT text editor provides. But now the Qt editor is not fully parsing my javascript files. It doesn't know about any of the symbols, and the only thing highlighted is literal test enclosed in quotes.

                        What did I do to turn this off, and how do I turn it back on? I can't remember what I did or find any options to reset.
                        Note that the javascript, css, html, and svg files in my project are not part of the C++ Qt project because that's a fork from an open source code base. But the text editor was parsing these javascript previously, and they have never been part of the Qt C++ projects.
                        Thanks!

                        1 Reply Last reply
                        0

                        1/11

                        14 May 2018, 15:05

                        • Login

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