From 85463d00c00fd2fc11bb069e50d34c9d64b7561a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:05:52 +0000 Subject: [PATCH 1/3] Initial plan From 4ddc5975af26cd26e3732b1f63652379e0cdcfb7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:08:04 +0000 Subject: [PATCH 2/3] fix: process already-open documents on extension activation for diagnostics Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com> --- CHANGELOG.md | 2 +- src/documents.ts | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5642421..f6eb72d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Logging: Fixed log flooding from repeated running state checks by only logging on state changes - Logging: Fixed log feedback loop caused by Output Channel document events triggering diagnostics - +- Diagnostics: Run diagnostics for Dev Proxy files already open before extension activation - Diagnostics: Language model diagnostic now correctly targets plugins that can use a local language model (OpenAIMockResponsePlugin, OpenApiSpecGeneratorPlugin, TypeSpecGeneratorPlugin) and shows as an informational hint instead of a warning ## [1.12.0] - 2026-01-29 diff --git a/src/documents.ts b/src/documents.ts index 41890e5..02dbc50 100644 --- a/src/documents.ts +++ b/src/documents.ts @@ -76,4 +76,26 @@ export const registerDocumentListeners = (context: vscode.ExtensionContext, coll }); }) ); + + // Process already-open documents that were opened before the extension activated + for (const document of vscode.workspace.textDocuments) { + if (document.uri.scheme !== 'file') { + continue; + } + try { + if (isConfigFile(document)) { + updateConfigFileDiagnostics(context, document, collection); + } else if (isProxyFile(document)) { + updateFileDiagnostics(context, document, collection); + } + } catch (error) { + console.error('Error processing already-open document:', error); + } + } + + // Set context for the active editor if it contains a config file + const activeEditor = vscode.window.activeTextEditor; + if (activeEditor && activeEditor.document.uri.scheme === 'file') { + vscode.commands.executeCommand('setContext', 'isDevProxyConfigFile', isConfigFile(activeEditor.document)); + } }; From 4be324979a9ef40af862aef6f4b5d4e3a3bf0f93 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:09:31 +0000 Subject: [PATCH 3/3] refactor: include document URI in error log for already-open document processing Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com> --- src/documents.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/documents.ts b/src/documents.ts index 02dbc50..f9beba7 100644 --- a/src/documents.ts +++ b/src/documents.ts @@ -89,7 +89,7 @@ export const registerDocumentListeners = (context: vscode.ExtensionContext, coll updateFileDiagnostics(context, document, collection); } } catch (error) { - console.error('Error processing already-open document:', error); + console.error('Error processing already-open document:', document.uri.fsPath, error); } }