Surface const-sql diagnostics from generated files by gtbuchanan · Pull Request #178 · DapperLib/DapperAOT · GitHub
Skip to content

Surface const-sql diagnostics from generated files#178

Open
gtbuchanan wants to merge 1 commit into
DapperLib:mainfrom
gtbuchanan:fix/177-const-sql-generated-diagnostics
Open

Surface const-sql diagnostics from generated files#178
gtbuchanan wants to merge 1 commit into
DapperLib:mainfrom
gtbuchanan:fix/177-const-sql-generated-diagnostics

Conversation

@gtbuchanan

Copy link
Copy Markdown

When the sql argument resolves to a const string, the SQL parameter analysis already runs, but its diagnostics (DAP214, etc.) were anchored at the constant's declaration. For a constant emitted into a generated file, the analyzer driver drops diagnostics there (generated-code suppression), so only the call-site DAP018 survived and it looked like the SQL was never analyzed.

Re-home the SQL-parse diagnostics onto the call-site sql argument when the declaration is in generated code, so they stay visible. Inline literals and constants in hand-written documents (same or sibling file) keep their precise declaration-token location.

Closes #177

When the `sql` argument resolves to a `const string`, the SQL parameter
analysis already runs, but its diagnostics (DAP214, etc.) were anchored at
the constant's declaration. For a constant emitted into a generated file,
the analyzer driver drops diagnostics there (generated-code suppression),
so only the call-site DAP018 survived and it looked like the SQL was never
analyzed.

Re-home the SQL-parse diagnostics onto the call-site sql argument when the
declaration is in generated code, so they stay visible. Inline literals and
constants in hand-written documents (same or sibling file) keep their
precise declaration-token location.

Closes DapperLib#177
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQL/parameter diagnostics suppressed when sql is a const declared in a generated file

1 participant