Community
    • Login

    SQL syntax color does not support double commenting

    Scheduled Pinned Locked Moved Blogs
    7 Posts 3 Posters 6.8k Views 2 Watching
    Loading More Posts
    • 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.
    • Jan N. PedersenJ Offline
      Jan N. Pedersen
      last edited by PeterJones

      I have comments in my SQL like /* --- comment ---*/ but I also sometimes comment out blocks of script like -

      /*
      /*--- comment ---*/
      SELECT . . .
      */
      

      The above SQL is shown by syntax coloring as active.
      -–

      moderator added code markdown around text; please don’t forget to use the </> button to mark example text as “code” so that characters don’t get changed by the forum

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Offline
        PeterJones @Jan N. Pedersen
        last edited by PeterJones

        @Jan-N-Pedersen ,

        Notepad++ uses a library called “Scintilla” for the syntax highlighting. After discovering that SQL does indeed allow nested comments, I just went and verified that the Scintilla library that we use does not correctly parse nested comments.

        It cannot be fixed in Notepad++ until it is fixed in Scintilla. I have put in a bug report with Scintilla, but there’s no guarantee they will fix it. If they do, then it may be a few Notepad++ versions before N++ has updated to the newest Scintilla.

        -—

        Useful References

        • Please Read Before Posting
        • Formatting Forum Posts
        PeterJonesP 1 Reply Last reply Reply Quote 1
        • PeterJonesP Offline
          PeterJones @PeterJones
          last edited by

          It cannot be fixed in Notepad++ until it is fixed in Scintilla. I have put in a bug report with Scintilla,

          It turns out that Scintilla/Lexilla has a separate lexer for MS-SQL compared to the other SQL variants. In SciTE, if I enable that lexer, it handles the nested comments okay. So it’s not a bug, it’s that Notepad++ has chosen to always use the standard-SQL lexer.

          Which means, if you are willing to install the PythonScript plugin, I could give you a script (maybe tomorrow) that would enable the MS-SQL lexer for you, and switch from SQL to MS-SQL on your SQL files. So if you are interested and willing to install that plugin, let me know.

          Michael VincentM 1 Reply Last reply Reply Quote 0
          • Michael VincentM Offline
            Michael Vincent @PeterJones
            last edited by

            @PeterJones said in SQL syntax color does not support double commenting:

            it’s that Notepad++ has chosen to always use the standard-SQL lexer

            @Jan-N-Pedersen

            May not have to wait too long:

            https://github.com/notepad-plus-plus/notepad-plus-plus/pull/13184

            Cheers.

            PeterJonesP 1 Reply Last reply Reply Quote 3
            • PeterJonesP Offline
              PeterJones @Michael Vincent
              last edited by

              @Michael-Vincent ,

              Nice. I am not going to bother with the script on this one, then. :-)

              Michael VincentM 1 Reply Last reply Reply Quote 2
              • Michael VincentM Offline
                Michael Vincent @PeterJones
                last edited by

                @PeterJones said in SQL syntax color does not support double commenting:

                Nice. I am not going to bother with the script on this one, then. :-)

                PR was just added to master. Looks like next version will have it, or you can test the artifact right now.

                https://github.com/notepad-plus-plus/notepad-plus-plus/commit/01bbebf825acaa458af7afaa27b0f6269310451b

                Cheers.

                Michael VincentM 1 Reply Last reply Reply Quote 2
                • Michael VincentM Offline
                  Michael Vincent @Michael Vincent
                  last edited by

                  @Michael-Vincent said in SQL syntax color does not support double commenting:

                  PR was just added to master. Looks like next version will have it, or you can test the artifact right now.

                  86dd6740-3ff4-499f-b740-0e710a2568e5-image.png

                  Looks like it’s working …

                  NOTE: Customized theme in the screenshot. The ‘stylers.model.xml’ has been updated for the default theme to include MS-SQL.

                  Cheers.

                  1 Reply Last reply Reply Quote 2

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors