Skip to content

Structured Assigns: better diags - #1927

Open
AndrewNolte wants to merge 3 commits into
MikePopoloski:masterfrom
AndrewNolte:AndrewNolte/stack/27
Open

Structured Assigns: better diags#1927
AndrewNolte wants to merge 3 commits into
MikePopoloski:masterfrom
AndrewNolte:AndrewNolte/stack/27

Conversation

@AndrewNolte

@AndrewNolte AndrewNolte commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Stacked PRs:


View individual changes

Structured Assigns: better diags

  • No more generic 'missing fields' - elaborate which fields
  • For arrays, specify the type of the array so the user can see which indexes to add, or which type to add
  • Highlight only first part of struct assign so that the diag doesn't obscure more important diags like syntax errors.

AndrewNolte added a commit to AndrewNolte/slang that referenced this pull request Aug 5, 2026
- No more generic 'missing fields' - elaborate which fields
- For arrays, specify the type of the array so the user can see which indexes to add, or which type to add
- Highlight only first part of struct assign so that the diag doesn't obscure more important diags like syntax errors.

stack-info: PR: MikePopoloski#1927, branch: AndrewNolte/stack/27
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/27 branch from fafd5df to 3aeacf5 Compare August 5, 2026 20:19
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.01961% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.06%. Comparing base (e3291f8) to head (fea47b7).

Files with missing lines Patch % Lines
source/diagnostics/DiagnosticEngine.cpp 97.22% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1927      +/-   ##
==========================================
+ Coverage   96.03%   96.06%   +0.03%     
==========================================
  Files         247      247              
  Lines       56855    56919      +64     
==========================================
+ Hits        54599    54681      +82     
+ Misses       2256     2238      -18     
Files with missing lines Coverage Δ
include/slang/diagnostics/DiagnosticEngine.h 100.00% <100.00%> (ø)
include/slang/diagnostics/JsonDiagnosticClient.h 100.00% <ø> (ø)
include/slang/diagnostics/TextDiagnosticClient.h 100.00% <ø> (ø)
source/ast/expressions/AssignmentExpressions.cpp 95.49% <100.00%> (+0.21%) ⬆️
source/diagnostics/JsonDiagnosticClient.cpp 91.56% <100.00%> (+37.39%) ⬆️
source/diagnostics/TextDiagnosticClient.cpp 93.89% <100.00%> (+0.59%) ⬆️
source/diagnostics/DiagnosticEngine.cpp 91.46% <97.22%> (-0.19%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3291f8...fea47b7. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AndrewNolte
AndrewNolte marked this pull request as draft August 6, 2026 04:13
AndrewNolte added a commit to AndrewNolte/slang that referenced this pull request Aug 6, 2026
- No more generic 'missing fields' - elaborate which fields
- For arrays, specify the type of the array so the user can see which indexes to add, or which type to add
- Highlight only first part of struct assign so that the diag doesn't obscure more important diags like syntax errors.

stack-info: PR: MikePopoloski#1927, branch: AndrewNolte/stack/27
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/27 branch from d8783ec to 31f70f1 Compare August 6, 2026 04:13
@AndrewNolte
AndrewNolte marked this pull request as ready for review August 6, 2026 04:13
@AndrewNolte
AndrewNolte marked this pull request as draft August 6, 2026 13:57
AndrewNolte added a commit to AndrewNolte/slang that referenced this pull request Aug 6, 2026
- No more generic 'missing fields' - elaborate which fields
- For arrays, specify the type of the array so the user can see which indexes to add, or which type to add
- Highlight only first part of struct assign so that the diag doesn't obscure more important diags like syntax errors.

stack-info: PR: MikePopoloski#1927, branch: AndrewNolte/stack/27
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/27 branch from 31f70f1 to 738cc8f Compare August 6, 2026 13:57
@AndrewNolte
AndrewNolte marked this pull request as ready for review August 6, 2026 13:57
@AndrewNolte
AndrewNolte marked this pull request as draft August 7, 2026 16:05
AndrewNolte added a commit to AndrewNolte/slang that referenced this pull request Aug 7, 2026
- No more generic 'missing fields' - elaborate which fields
- For arrays, specify the type of the array so the user can see which indexes to add, or which type to add
- Highlight only first part of struct assign so that the diag doesn't obscure more important diags like syntax errors.

stack-info: PR: MikePopoloski#1927, branch: AndrewNolte/stack/27
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/27 branch from 738cc8f to d79b51c Compare August 7, 2026 16:06
@AndrewNolte
AndrewNolte marked this pull request as ready for review August 7, 2026 16:06
@AndrewNolte
AndrewNolte marked this pull request as draft August 7, 2026 17:14
AndrewNolte added a commit to AndrewNolte/slang that referenced this pull request Aug 7, 2026
- No more generic 'missing fields' - elaborate which fields
- For arrays, specify the type of the array so the user can see which indexes to add, or which type to add
- Highlight only first part of struct assign so that the diag doesn't obscure more important diags like syntax errors.

stack-info: PR: MikePopoloski#1927, branch: AndrewNolte/stack/27
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/27 branch from d79b51c to fde8a9d Compare August 7, 2026 17:14
@AndrewNolte
AndrewNolte marked this pull request as ready for review August 7, 2026 17:14
This puts some more restrictions on notes, many that were already being followed:
- Notes cannot have subnotes
- Notes cannot be waived, only diags
- Note severities can only be remapped to ignored, not errors

stack-info: PR: MikePopoloski#1925, branch: AndrewNolte/stack/25
This moves 'Assignment pattern errors' to the be a slang-lit test to show the diag ranges, and make updating expectations easier.
It also adds to the test to show some suboptimal diag ranges.

stack-info: PR: MikePopoloski#1926, branch: AndrewNolte/stack/26
- No more generic 'missing fields' - elaborate which fields
- For arrays, specify the type of the array so the user can see which indexes to add, or which type to add
- Highlight only first part of struct assign so that the diag doesn't obscure more important diags like syntax errors.

stack-info: PR: MikePopoloski#1927, branch: AndrewNolte/stack/27
@AndrewNolte
AndrewNolte marked this pull request as draft August 13, 2026 14:25
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/27 branch from fde8a9d to fea47b7 Compare August 13, 2026 14:25
@AndrewNolte
AndrewNolte marked this pull request as ready for review August 13, 2026 14:26
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.

1 participant