Community
    • Login

    SQL Code Folding

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    sqlcode folding
    2 Posts 2 Posters 754 Views 1 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.
    • dfs-D Offline
      dfs-
      last edited by

      Does anyone else notice the SQL code folding seem to have major issues. Using the following code:

      if @dbdump=1
      begin
          select @ret=status from master..sysdatabases where dbid=@dbid
          if @ret is null
          begin
              select @errno=50391, @textnach=@dbname
              goto error
          end
          -- select into/bulkcopy
          if @ret & 4 = 4
          begin
              exec master..sp__changedbopt @dbname, 'select into', false
          end
      end
      

      I’d suspect having three fold markers, one for the surrounding if…begin…end and two for the inner begin…end. I will receive those folding markers, but the outer one ends at the end in line 8.

      In the following screenshot only the selected text is folded when clicking on the marker in line 2, but it should actually span until line 14:

      798fd9e5-7bcc-43b2-a786-471516cf797e-image.png

      Why is that?

      Possibly relevant topic: https://community.notepad-plus-plus.org/topic/15073/folding-behavior-of-sql-code

      rdipardoR 1 Reply Last reply Reply Quote 0
      • rdipardoR Offline
        rdipardo @dfs-
        last edited by

        Notepad++ does not have built-in support for Microsoft Transact-SQL: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12610#issuecomment-1340297100

        That may change in a future release, but I would not hold my breath.

        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