• Login
Community
  • Login

nppPluginList npp-compatible-versions and old-versions-compatibility parameters

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
6 Posts 4 Posters 964 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.
  • B
    Bas de Reuver
    last edited by May 3, 2023, 7:08 PM

    I received an issue from a github user for the latest version of my CSV Lint plugin
    but I wasn’t able to reproduce this. The debug info they posted says “Notepad++ v8.4.6” which is an older Notepad++ version, so I started looking into older versions and the compatibility with the plug-in.

    I ended up doing some extensive testing, installing several different Notepad++ versions, and older versions of the plugin. I haven’t tried every single combination, but see the result below.

    csvlint_compatibility.png

    Wherever there is a text like “ok” etc. I have explicitly confirmed it, so the texts mean:

    ok = no issues
    LEXER! = crashes due to lexer v5 issues, known bug
    not comp = Notepad++ flags this plugin version as "not compatible" and won't use the dll
    ok DM issue = (one time) in Dark Mode some funky purple/orange dialogs but otherwise ok
    

    Looking at the compatibility I found, obviously any version v0.4.5 and older should not run on the newer Notepad++ versions. But I was a bit surprised that the latest version of CSV Lint also ran on the oldest Notepad++ v8.2 that I tested, it didn’t crash and worked just fine.

    Starting with version v0.4.5.2 of CSV Lint it was submitted to nppPluginList with two extra parameters, see here

    "npp-compatible-versions": "[8.4,]",
    "old-versions-compatibility": "[,0.4.5.1][,8.3.3]",
    

    If I understand correctly this means Notepad++ v8.4 or newer should use the latest plugin, and Notepad++ v8.3.3 and older should use 0.4.5.1 or older.

    My question is, looking at this compatibility chart, is this still correct? I mean give that Don Ho himself initially set them I’m hesitant to change them, but couldn’t they be changed to [8.2,] for the first one, and [,0.4.6.4][,8.3.3] for the second? Or are the two versions not supposed to overlap, so to speak, so the Npp version in the “npp-compatible” should always be higher than the “old-versions” one?

    M R 2 Replies Last reply May 3, 2023, 7:40 PM Reply Quote 1
    • B Bas de Reuver referenced this topic on May 3, 2023, 7:13 PM
    • M
      Mark Olson @Bas de Reuver
      last edited by Mark Olson May 3, 2023, 7:48 PM May 3, 2023, 7:40 PM

      @Bas-de-Reuver
      Nice detective work!

      I had something similar happen with JsonTools. My older versions of that plugin were only compatible with 8.4.1+, and then I found a bug that made it compatible back as far as I bothered to test (7.3.3).

      So here’s what I currently have in NppPluginList for JsonTools :

      "npp-compatible-versions": "[7.3.3,]",
      "old-versions-compatibility": "[,4.10.0][8.4.1,]"
      

      In short, the only rule is that these values should accurately reflect the compatibility of current versions and older versions.

      So yeah, probably for CsvLint you would want

      "npp-compatible-versions": "[8.2,]",
      "old-versions-compatibility": "[,0.4.5.1][8.2,8.3.3]",
      

      Unless you can verify that the older versions of your plugin work on older NPP than 8.2, I would err on the side of not saying that it does.

      My strategy (admittedly not the most thorough) was to not bother trying to test JsonTools on every single NPP release since 7.3.3. I just picked 7.3.3, 7.8.9, and 1-3 bugfix releases from every minor release since 8.3.

      B 1 Reply Last reply May 3, 2023, 7:58 PM Reply Quote 1
      • B
        Bas de Reuver @Mark Olson
        last edited by May 3, 2023, 7:58 PM

        @Mark-Olson said in nppPluginList npp-compatible-versions and old-versions-compatibility parameters:

        Nice detective work!

        Thanks, it felt a bit like playing minesweeper 😆

        If I understand correctly, the two parameters were added in Notepad++ v8.4.4 and they are baked into the Notepad binary file. So that means older Npp versions like 7.3.3 don’t even look at these parameters I assume?

        M 1 Reply Last reply May 3, 2023, 8:28 PM Reply Quote 0
        • M
          Mark Olson @Bas de Reuver
          last edited by May 3, 2023, 8:28 PM

          @Bas-de-Reuver
          No, the plugin list is actually a separate plugin, at plugins/config/nppPluginList.dll.

          But now that you mention it, the plugin manager can’t even be installed on 7.3.3 (just tried it now), so as far as the plugin manager is concerned it’s not super important to test your plugin that far back.

          P 1 Reply Last reply May 3, 2023, 8:36 PM Reply Quote 0
          • P
            PeterJones @Mark Olson
            last edited by PeterJones May 3, 2023, 8:40 PM May 3, 2023, 8:36 PM

            @Mark-Olson said,

            But now that you mention it, the plugin manager can’t even be installed on 7.3.3 (just tried it now), so as far as the plugin manager is concerned it’s not super important to test your plugin that far back.

            Please be very precise when talking about Plugins Admin, especially when talking about versions going back that far.

            • In Notepad++ v7.5.9 and earlier, there was a plugin called “Plugin Manager” which was used for managing plugins (it shipped with Notepad++ through v7.4.2, even though it was maintained by someone else; but in v7.5, it stopped shipping with Notepad++ due to advertisements added to “Plugin Manager”). That plugin is incompatible with Notepad++ v7.6 and newer.

            • In Notepad++ v7.6, Notepad++ shipped with a new built-in Plugins Admin tool (though it wasn’t stable until v7.6.3). The list of plugins for the Plugins Admin tool is provided by the DLL called plugins/config/nppPluginList.dll, but it is not itself a plugin (not all DLLs are “Plugins”). That DLL does nothing before v7.6, because nothing inside Notepad++ was looking for that DLL before then (and since it’s not a plugin, it doesn’t get auto-recognized like real plugins do).

            Thus, when you talk about “plugin manager”, but are talking about the nppPluginList.dll, you should really be calling it Plugins Admin, which is the name that shows up in the Plugins menu and the Plugins Admin dialog box.

            So the “earliest” you might want to test compatibility for setting in the nppPluginList repo is Notepad++ v7.6.3

            1 Reply Last reply Reply Quote 4
            • R
              rdipardo @Bas de Reuver
              last edited by rdipardo May 3, 2023, 8:44 PM May 3, 2023, 8:43 PM

              @Bas-de-Reuver said in nppPluginList npp-compatible-versions and old-versions-compatibility parameters:

              I was a bit surprised that the latest version of CSV Lint also ran on the oldest Notepad++ v8.2 that I tested, it didn’t crash and worked just fine.

              Not surprising if you consider that N++ doesn’t actually know what lexer functions it’s looking for. It calls them through function pointers , which are nothing but pointers to void. All that any C++ app can do is dereference them and hope there’s a real function at the other end.

              As long as current versions of your plugin export GetLexerCount, GetLexerName and the (now obsolete) GetLexerFactory and GetLexerStatusText, that’s enough to pass in pre-8.4 N++ versions. One of my own plugins was backported all the way to v7.7 by exporting a stub of GetLexerFactory that simply returns 0.

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