feat: Add DynamicValues and DynamicSchema validation diagnostics (#43)#76
Open
daviburg wants to merge 6 commits into
Open
feat: Add DynamicValues and DynamicSchema validation diagnostics (#43)#76daviburg wants to merge 6 commits into
daviburg wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds new LSP diagnostics for validating [DynamicValues] and [DynamicSchema] attribute usage in connector code, wiring the validator into the server and introducing new diagnostic codes and unit tests.
Changes:
- Added CSDK300–CSDK305 diagnostic codes for DynamicValues/DynamicSchema validation.
- Implemented
DynamicValuesValidatorto perform attribute/type checks plus dynamic operation registry lookups. - Registered the new validator in DI and added a new test suite.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| Server/Program.cs | Registers DynamicValuesValidator as an IDiagnosticValidator. |
| Server/Diagnostics/Validators/DynamicValuesValidator.cs | New validator implementing CSDK300–CSDK305 checks. |
| Server/Diagnostics/DiagnosticCodes.cs | Adds constants for CSDK300–CSDK305. |
| Server.Tests/DynamicValuesValidatorTests.cs | Adds unit tests for the new validator. |
2f61aa5 to
4786bdb
Compare
4786bdb to
97610bd
Compare
) Validates call sites where SDK connector client methods are invoked. When a string literal is passed to a [DynamicValues]-annotated parameter, the validator checks the LSPStore.DynamicData cache (populated by hover and completion handlers) to see if the value is among known dynamic values. CSDK300: String literal does not match any cached dynamic value. Only emits when cached values exist — no false positives before hover/completion has populated the cache. Dropped CSDK301 — [DynamicValues] is used on non-string types (e.g., int approvalType) so type-checking the argument is wrong.
97610bd to
bdb28f3
Compare
…ix named-arg matching, add tests Co-authored-by: Dobby <dobby@microsoft.com>
…med-arg test Co-authored-by: Dobby <dobby@microsoft.com>
Co-authored-by: Dobby <dobby@microsoft.com>
…alue-only matching Co-authored-by: Dobby <dobby@microsoft.com>
…vocation Co-authored-by: Dobby <dobby@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a DynamicValuesValidator that validates call sites where SDK connector client methods are invoked with [DynamicValues]-annotated parameters.
How it works
When a string literal is passed to a [DynamicValues] parameter, the validator checks the LSPStore.DynamicData cache (populated by hover/completion) to see if the value matches any known dynamic value. If not, it emits CSDK300.
Key design decisions:
Diagnostic
Changes
Testing
Closes #43