• Login
Community
  • Login

JSONC support?

Scheduled Pinned Locked Moved General Discussion
5 Posts 4 Posters 1.1k Views
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.
  • H
    Harald-René Flasch
    last edited by Oct 13, 2022, 2:21 PM

    Is there a plan to support JSONC (JSON with comments) - see also https://changelog.com/news/jsonc-is-a-superset-of-json-which-supports-comments-6LwR

    Visual Studio Code already supports it but it would be nice to have it in NP++ as well.

    –hfrmobile

    P M 2 Replies Last reply Oct 13, 2022, 3:10 PM Reply Quote 0
    • P
      PeterJones @Harald-René Flasch
      last edited by Oct 13, 2022, 3:10 PM

      @Harald-René-Flasch ,

      There is a backdoor to enable it.

      If you have the PythonScript plugin, running editor.setProperty("lexer.json.allow.comments",1) will enable that. Or if you have the NppExec plugin, SCI_SENDMSG SCI_SETPROPERTY "lexer.json.allow.comments" "1" will enable that.

      Giving non-power-users access to that option, similar to how Notepad++ allows the user to toggle the SQL backslash-as-escape using a checkbox on Settings > Preferences > Language, is a good idea. If you follow the feature request FAQ instructions, you could suggest that to the developers. This was actually discussed in this forum a few years back (which is where I got the NppExec command, and where I previously published the PythonScript command), but the poster at that point didn’t make the effort to put in the feature request, so no one on the development team has thought about adding it. (The “power users” who frequent this forum weren’t as likely to make feature requests back then, because the developer gives more “weight” to requests from normal users like you than he does to “us”. He still gives more weight to you even today, so I will ask that if you care about it, you put in that feature request. You can even just paste the mockup that I showed in the discussion two years ago as part of your feature request.)

      If you do create the request, make sure you post a link to it in your reply here.

      1 Reply Last reply Reply Quote 1
      • A
        ArkadiuszMichalski
        last edited by Oct 13, 2022, 3:45 PM

        Request exist:
        https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11676

        1 Reply Last reply Reply Quote 1
        • A
          ArkadiuszMichalski
          last edited by Oct 13, 2022, 3:57 PM

          Another one:
          https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11713

          1 Reply Last reply Reply Quote 0
          • M
            Mark Olson @Harald-René Flasch
            last edited by Oct 28, 2022, 12:22 AM

            @Harald-René-Flasch Now is as good a time as any to make a shameless plug of my JSON Tools plugin, which can parse JSONC.

            The JSTool plugin is another good option with JSONC parsing ability. I assume it is better for a JavaScript developer and its tree viewer loads faster than mine, but it is a bit less feature-rich when it comes to working with pure JSON.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors