Skip to content

Add Notepad++ Plugins Admin listing support - #1

Merged
Gvo87 merged 4 commits into
mainfrom
plugins-admin-listing
Jul 19, 2026
Merged

Add Notepad++ Plugins Admin listing support#1
Gvo87 merged 4 commits into
mainfrom
plugins-admin-listing

Conversation

@Gvo87

@Gvo87 Gvo87 commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

Enables listing LLM Assistant in Notepad++ → Plugins → Plugins Admin, so anyone can search, install, and auto-update it via the official nppPluginList.

Two blockers in the repo are fixed here:

  • The DLL had no version resource — Plugins Admin uses the DLL's binary version to detect updates, so auto-update could never have worked. Added VERSIONINFO driven by a single source of truth (src/Version.h). Verified the built DLL now reports FileVersion 1.0.0.0.
  • No release pipeline — added CI that produces a correctly-packaged, downloadable zip and the SHA-256 required by the plugin list.

Changes

  • src/Version.h (new) — centralized plugin version.
  • src/LLMAssistant.rc — added VERSIONINFO block.
  • .github/workflows/build-and-release.yml (new) — on push/PR: build x64 Release + run Catch2 tests; on v* tag: package LLMAssistant_v<ver>_x64.zip (DLL at zip root), publish a GitHub Release, and emit the SHA-256 + a ready pl.x64.json entry.
  • packaging/make-release-zip.ps1 (new) — reproduce the zip + SHA-256 and generate the JSON entry locally.
  • packaging/nppPluginList-entry.json (new) — entry template.
  • packaging/PLUGINS_ADMIN_SUBMISSION.md (new) — end-to-end submission + auto-update guide.
  • README.md — documented the Plugins Admin install path.
  • .gitignore — ignore packaging output.

Test plan

  • Release|x64 builds cleanly with the new resource (MSBuild).
  • Built DLL reports FileVersion/ProductVersion 1.0.0.0.
  • packaging/make-release-zip.ps1 produces LLMAssistant_v1.0_x64.zip with LLMAssistant.dll at the zip root and a valid SHA-256.
  • Tag v1.0 and confirm the workflow publishes the release zip.
  • Local Plugins Admin install test with a debug Notepad++ before the nppPluginList PR.

Notes

  • Plugin is x64-only, so it targets pl.x64.json.
  • This branch also carries the previously-unpushed main commit d641e6b.

Gvo87 and others added 2 commits July 19, 2026 00:21
- Fix wrong Notepad++ message IDs: NPPM_GETFILENAME collided with
  NPPM_LAUNCHFINDINFILESDLG (opened the Find dialog and crashed) and
  NPPM_SETSTATUSBAR was mapped to NPPM_DMMSHOW.
- Add a model selector to the Settings dialog (persisted to the registry)
  covering GPT-4o/4.1 and the GPT-5 family; the combo is editable for
  future models.
- Send model-aware request params: GPT-5/o-series use max_completion_tokens
  and omit temperature; chat models keep max_tokens + temperature.
- Deliver LLM results via a hidden message-only window instead of the
  fragile NPPM_MSGTOPLUGIN routing that left requests stuck on "Processing".
- Use INTERNET_OPEN_TYPE_PRECONFIG for proxy support and raise the timeout.
- Replace the "Processing..." status with an outcome message that auto-clears.
- Only treat real text inserts/deletes as document edits so styling no
  longer triggers a false "document changed" discard; fix SCNotification
  x64 struct layout (Sci_Position is pointer-sized).

Co-authored-by: Cursor <cursoragent@cursor.com>
Enable submission to the official nppPluginList so the plugin is
searchable, installable, and auto-updatable via Plugins Admin.

- Add VERSIONINFO to the DLL (was missing) via src/Version.h so
  Plugins Admin can detect updates
- Add build-and-release GitHub Actions workflow: build x64, run tests,
  package a Plugins-Admin-ready zip (DLL at zip root), publish release
  and emit the SHA-256 needed for the pl.x64.json entry
- Add packaging/make-release-zip.ps1 to reproduce the zip + SHA-256 and
  generate the JSON entry locally
- Add nppPluginList entry template and submission guide
- Document Plugins Admin install path in README

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the Notepad++ LLM Assistant plugin for inclusion in Notepad++ Plugins Admin by adding a single-source version resource, a release/packaging pipeline that emits a Plugins-Admin-compatible ZIP + SHA-256 metadata, and a few runtime/UI improvements (model selection, safer notifications, and more reliable result delivery back to the UI thread).

Changes:

  • Added centralized version definitions (src/Version.h) and compiled them into the DLL VERSIONINFO resource (src/LLMAssistant.rc) for Plugins Admin update detection.
  • Added GitHub Actions CI to build/test and package a Plugins-Admin-ready ZIP, plus local packaging helpers/docs under packaging/.
  • Improved plugin runtime behavior: configurable model selection in settings, updated Scintilla notification parsing, and a message-only window for cross-thread completion delivery.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Version.h Introduces a single source of truth for DLL/plugin versioning.
src/LLMAssistant.rc Adds VERSIONINFO and extends Settings dialog to include model selection UI.
src/SettingsDialog.cpp Populates/selects an OpenAI model combo and persists it via LLMService.
src/resource.h Adds resource IDs for the new model label/combo controls.
src/PluginInterface.h Fixes NPPM_GETFILENAME constant and corrects SCNotification layout/types for x64.
src/PluginDefinition.h Updates testConnection signature and introduces WM_LLM_RESULT for completion dispatch.
src/PluginDefinition.cpp Implements message-only window routing, status bar transient messaging, and model-aware connection tests.
src/NppPlugin.cpp Filters SCN_MODIFIED events to actual text insert/delete modifications only.
src/LLMService.h Adds persisted model configuration and removes model defaulting from call sites.
src/LLMService.cpp Persists model, adjusts request timeout, handles reasoning-model parameter differences, and uses system proxy config.
README.md Documents the intended Plugins Admin install path and links submission guide.
packaging/PLUGINS_ADMIN_SUBMISSION.md Provides end-to-end maintainer steps for submission and auto-update workflow.
packaging/nppPluginList-entry.json Adds a template entry for nppPluginList submission.
packaging/make-release-zip.ps1 Adds a local script to package the DLL + emit SHA-256 and JSON entry.
.gitignore Ignores release packaging outputs (dist + zips).
.github/workflows/build-and-release.yml Adds CI build/test/package and tag-triggered GitHub Release publishing with metadata output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/PluginDefinition.cpp
Comment on lines +103 to +110
void destroyMessageWindow()
{
if (g_messageWindow) {
DestroyWindow(g_messageWindow);
g_messageWindow = nullptr;
}
UnregisterClassW(kMessageWindowClass, g_module);
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0303d21: destroyMessageWindow() now drains queued WM_LLM_RESULT messages via PeekMessage(...PM_REMOVE) and deletes their RequestCompletion payloads (plus KillTimer) before DestroyWindow, so no message is dropped and nothing leaks on shutdown.

Comment thread packaging/make-release-zip.ps1 Outdated
Comment on lines +76 to +78
$repoUrl = (git config --get remote.origin.url) 2>$null
if ($repoUrl) { $repoUrl = $repoUrl -replace '\.git$', '' } else { $repoUrl = "https://github.com/Gvo87/NotepadPlusPlus-LLM-Plugin" }
$downloadUrl = "$repoUrl/releases/download/v$Version/$zipName"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0303d21: the git lookup is now guarded with \Get-Command git\ + try/catch, so the script falls back to the known repo URL instead of aborting under \ErrorActionPreference = 'Stop'\ when Git isn't on PATH.

Gvo87 and others added 2 commits July 19, 2026 11:10
- destroyMessageWindow: drain queued WM_LLM_RESULT messages and free their
  RequestCompletion payloads before DestroyWindow, preventing a message drop
  and heap leak during shutdown
- make-release-zip.ps1: guard the git lookup so the script does not abort
  under ErrorActionPreference=Stop on machines without Git in PATH

Co-authored-by: Cursor <cursoragent@cursor.com>
The source files are UTF-8, but without /utf-8 MSVC decodes string literals
using the system ANSI code page (CP1252 on the CI runner). That corrupted
literals like L"Café 🙂", so the "OpenAI content parses escaped Unicode" test
failed in CI (the runtime UTF-8 decoding was correct; the literal was not).

- Add /utf-8 to the CMake test target (fixes the failing test in CI)
- Add /utf-8 to the plugin project (both configs) so the shipping DLL is
  compiled with the correct source encoding as well

Co-authored-by: Cursor <cursoragent@cursor.com>
@Gvo87
Gvo87 merged commit 9596007 into main Jul 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants