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..f9beba7 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:', document.uri.fsPath, 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)); + } };