Mass-screen validation, linkCommand auto-complete, API calls de-duplication, re-validation on active document change#15
Conversation
…ssing property checks
…ort in hover provider
…-driven completions and cancellable progress notifications
…ove conditional execution and error handling
There was a problem hiding this comment.
Pull request overview
This pull request enhances the AcuMate VS Code extension with comprehensive screen validation capabilities, improved backend action metadata handling, and better developer experience through new completion and hover features. The changes introduce mass validation commands for both HTML and TypeScript screens, add linkCommand auto-completion, implement request deduplication for backend API calls, and enable re-validation on active document changes.
Key changes:
- Added two new validation commands (
validateScreensandvalidateTypeScriptScreens) accessible from the command palette and CLI, with progress reporting and cancellable execution - Implemented auto-completion for
@linkCommanddecorators sourced from backend action metadata - Enhanced hover providers to show backend metadata for PXView properties and PXActionState members
- Improved caching layer to deduplicate concurrent API requests for graphs, features, and graph structures
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
acumate-plugin/src/validation/tsValidation/graph-info-validation.ts |
Added logic to skip diagnostics for fields with double underscores (custom fields) |
acumate-plugin/src/validation/htmlValidation/html-validation.ts |
Commented out validation for missing required config properties to reduce noise |
acumate-plugin/src/typescript/link-command-utils.ts |
New utility to locate @linkCommand decorator literals for completion support |
acumate-plugin/src/completionItemProviders/ts-completion-provider.ts |
Added completion provider for linkCommand decorators with backend action suggestions |
acumate-plugin/src/backend-metadata-utils.ts |
Introduced BackendActionMetadata interface and buildBackendActionMap function for better action lookup |
acumate-plugin/src/providers/ts-hover-provider.ts |
Refactored to show metadata for PXView properties, PXFieldState fields, and PXActionState members |
acumate-plugin/src/providers/html-completion-provider.ts |
Modified snippet generation to remove quotes from property names and attribute values |
acumate-plugin/src/api/layered-data-service.ts |
Added in-flight request tracking to prevent redundant concurrent API calls |
acumate-plugin/src/extension.ts |
Implemented new validation commands with debounced HTML validation and document lifecycle management |
acumate-plugin/src/model/view.ts |
Added optional displayName property to View model |
acumate-plugin/scripts/validate-screens.js |
New CLI script to run HTML screen validation via environment variable configuration |
acumate-plugin/scripts/validate-ts-screens.js |
New CLI script to run TypeScript screen validation via environment variable configuration |
acumate-plugin/src/test/suite/projectTsValidation.test.ts |
New test file for project-wide TypeScript validation |
acumate-plugin/src/test/suite/projectScreenValidation.test.ts |
New test file for project-wide HTML screen validation |
acumate-plugin/src/test/suite/tsGraphInfo.test.ts |
Added tests for double underscore field handling, hover metadata, and linkCommand completions |
acumate-plugin/src/test/suite/htmlValidation.test.ts |
Removed test assertion for missing required config properties |
acumate-plugin/src/test/fixtures/typescript/GraphInfoViewFieldDoubleUnderscore.ts |
New test fixture for double underscore field validation |
acumate-plugin/readme.md |
Updated documentation with new validation commands and features |
acumate-plugin/package.json |
Added command definitions and npm scripts for screen validation |
Comments suppressed due to low confidence (1)
acumate-plugin/src/test/suite/htmlValidation.test.ts:287
- The test assertion for missing required properties was removed, which reduces test coverage. This change should be aligned with the decision made in html-validation.ts (lines 464-474). If the validation for missing required properties is being intentionally removed, this test should either:
- Be updated to test that missing required properties are NOT reported (if that's the new expected behavior)
- Or be removed entirely if there's no validation to test
Simply removing the assertion without clarifying the expected behavior reduces test value.
it('reports qp-button config.bind issues from control metadata', async () => {
const document = await openFixtureDocument('TestConfigBindingInvalid.html');
await validateHtmlFile(document);
const diagnostics = AcuMateContext.HtmlValidator?.get(document.uri) ?? [];
assert.ok(
diagnostics.some(d => d.message.includes('property "bogus"')),
'Expected diagnostic for unknown config property'
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
acumate-plugin/src/extension.ts
Outdated
| context.subscriptions.push(disposable); | ||
| } | ||
|
|
||
| async function runWorkspaceScreenValidation() { |
There was a problem hiding this comment.
I'd consider to move most of this new code somewhere else to keep extension.ts as clean as possible.
acumate-plugin/src/extension.ts
Outdated
| async function runWorkspaceScreenValidation() { | ||
| const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; | ||
| if (!workspaceFolder) { | ||
| vscode.window.showWarningMessage('Open a workspace folder before running AcuMate screen validation.'); |
There was a problem hiding this comment.
We can get "workspace folder" even without workspace really opened, see workspaceFolderUri in create-screen.ts
This pull request introduces new screen validation commands for both HTML and TypeScript screens in the AcuMate VS Code extension, enhances backend action metadata utilities, and improves the extension's validation and completion features. The changes also add supporting scripts and update documentation to help users and CI workflows validate screens more easily. Additionally, the caching and concurrency logic for backend metadata fetching is improved to prevent redundant API calls.
New validation features and commands:
acumate.validateScreensfor validating HTML screens andacumate.validateTypeScriptScreensfor validating TypeScript screens, both accessible from the command palette and via new npm scripts (validate:screens,validate:screens:ts). These commands run validation across all screens with progress reporting and output diagnostics to a dedicated channel. [1] [2] [3] [4] [5] [6]Backend metadata and completion improvements:
BackendActionMetadataand a new functionbuildBackendActionMap, which maps normalized action names to metadata, improving action lookup and completion. [1] [2] [3]@linkCommanddecorators: when editing these decorators, the extension now provides completion items sourced from backend actions, making it easier to insert valid action names. [1] [2] [3]Caching and concurrency enhancements:
LayeredDataServiceAPI client to cache and deduplicate in-flight requests for graphs, features, and graph structures, preventing redundant concurrent backend calls and ensuring consistent caching. [1] [2] [3] [4]Validation UX improvements:
These changes collectively make screen validation more robust, user-friendly, and efficient, while also providing better completion and metadata support for AcuMate users.