Add Notepad++ Plugins Admin listing support - #1
Conversation
- 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>
There was a problem hiding this comment.
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 DLLVERSIONINFOresource (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.
| void destroyMessageWindow() | ||
| { | ||
| if (g_messageWindow) { | ||
| DestroyWindow(g_messageWindow); | ||
| g_messageWindow = nullptr; | ||
| } | ||
| UnregisterClassW(kMessageWindowClass, g_module); | ||
| } |
There was a problem hiding this comment.
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.
| $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" |
There was a problem hiding this comment.
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.
- 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>
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:
VERSIONINFOdriven by a single source of truth (src/Version.h). Verified the built DLL now reportsFileVersion 1.0.0.0.Changes
src/Version.h(new) — centralized plugin version.src/LLMAssistant.rc— addedVERSIONINFOblock..github/workflows/build-and-release.yml(new) — on push/PR: build x64 Release + run Catch2 tests; onv*tag: packageLLMAssistant_v<ver>_x64.zip(DLL at zip root), publish a GitHub Release, and emit the SHA-256 + a readypl.x64.jsonentry.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|x64builds cleanly with the new resource (MSBuild).FileVersion/ProductVersion1.0.0.0.packaging/make-release-zip.ps1producesLLMAssistant_v1.0_x64.zipwithLLMAssistant.dllat the zip root and a valid SHA-256.v1.0and confirm the workflow publishes the release zip.Notes
pl.x64.json.maincommitd641e6b.