Add SQL parameter scanning and local-scope analysis#61
Merged
Conversation
Introduce dialect-aware parameter scanning and local-scope detection to avoid spurious binding warnings and to ignore parameters inside comments/strings. Added internal helpers: ParameterReference, SqlDialect enum, SqlDialectResolver, SqlParameterScanner, and SqlLocalScopeAnalyzer. Updated SqlKernel to resolve dialects, use the scanner/analyzer for both binding and diagnostics (BindParameters now accepts dialect), and adjust diagnostic offsets when directive headers are present. Removed the previous regex-based detection and ad-hoc string-literal check in favor of the new single-pass scanner and local-name analysis. Added comprehensive unit tests for resolver, scanner, local-scope analyzer and updated kernel diagnostic/execution tests.
Closed
SummarySummary
CoverageVerso - 76.6%
Verso.Abstractions - 84.7%
Verso.Ado - 83.4%
Verso.Blazor - 18.9%
Verso.Blazor.Shared - 45.2%
Verso.Cli - 38.6%
Verso.FSharp - 82.6%
Verso.Host - 29.3%
Verso.Http - 75.7%
Verso.JavaScript - 43.9%
Verso.PowerShell - 65.3%
Verso.Python - 59.3%
Verso.Sample.Diagram - 80.1%
Verso.Sample.Dice - 82.1%
Verso.Sample.Slides - 79.5%
Verso.Testing - 80.3%
|
Trim DECLARE list captures to the actual statement boundary to avoid the regex capture spilling into a following statement when semicolons are omitted. Introduce TrimDeclareCaptureToStatement and change extraction to stop when an item’s first non-whitespace char is not '@'. Replace AddFirstAtName with TryAddFirstAtName (returns bool) and adjust callers to halt iteration on non-@ items. Add tests covering unterminated DECLARE followed by another statement and a reported user scenario to ensure kernel/global @@ references in following statements are not mis-registered as locals.
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.
Introduce dialect-aware parameter scanning and local-scope detection to avoid spurious binding warnings and to ignore parameters inside comments/strings. Added internal helpers: ParameterReference, SqlDialect enum, SqlDialectResolver, SqlParameterScanner, and SqlLocalScopeAnalyzer. Updated SqlKernel to resolve dialects, use the scanner/analyzer for both binding and diagnostics (BindParameters now accepts dialect), and adjust diagnostic offsets when directive headers are present. Removed the previous regex-based detection and ad-hoc string-literal check in favor of the new single-pass scanner and local-name analysis. Added comprehensive unit tests for resolver, scanner, local-scope analyzer and updated kernel diagnostic/execution tests.