Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve location of reported diagnostics #937

Merged
merged 1 commit into from Nov 23, 2023

Conversation

latonz
Copy link
Contributor

@latonz latonz commented Nov 21, 2023

Improve location of reported diagnostics

Description

Use more accurate location for reported diagnostics.
Fallback to mapper class is used a lot less.
For nested mappings the last user defined mapping method is used instead.
For attributes the attribute syntax is used.

Fixes #896

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code
  • Hard-to-understand areas of my code are commented
  • The documentation is updated (as applicable)
  • Unit tests are added/updated
  • Integration tests are added/updated (as applicable, especially if feature/bug depends on roslyn or framework version in use)

@latonz latonz self-assigned this Nov 21, 2023
@latonz latonz force-pushed the 896-appropriate-diagnostic-location branch from 88e3e42 to 806852b Compare November 21, 2023 16:42
Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (42d3e26) 91.27% compared to head (589ca19) 91.23%.

Files Patch % Lines
.../Riok.Mapperly/Configuration/HasSyntaxReference.cs 33.33% 1 Missing and 1 partial ⚠️
...ok.Mapperly/Configuration/AttributeDataAccessor.cs 75.00% 0 Missing and 1 partial ⚠️
.../Riok.Mapperly/Diagnostics/DiagnosticCollection.cs 0.00% 0 Missing and 1 partial ⚠️
src/Riok.Mapperly/Helpers/SymbolExtensions.cs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #937      +/-   ##
==========================================
- Coverage   91.27%   91.23%   -0.05%     
==========================================
  Files         221      222       +1     
  Lines        7074     7085      +11     
  Branches      886      895       +9     
==========================================
+ Hits         6457     6464       +7     
- Misses        410      411       +1     
- Partials      207      210       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@latonz latonz force-pushed the 896-appropriate-diagnostic-location branch 4 times, most recently from d5e991e to cf13a00 Compare November 22, 2023 11:03
Use more accurate location for reported diagnostics.
Fallback to mapper class is used a lot less.
For nested mappings the last user defined mapping method is used instead.
For attributes the attribute syntax is used.
@latonz latonz force-pushed the 896-appropriate-diagnostic-location branch from cf13a00 to 589ca19 Compare November 22, 2023 11:06
@latonz latonz marked this pull request as ready for review November 22, 2023 11:08
@latonz latonz requested a review from ni507 November 22, 2023 11:08
@latonz latonz enabled auto-merge (squash) November 22, 2023 11:08
@latonz latonz merged commit 980ac3e into riok:main Nov 23, 2023
17 of 19 checks passed
@latonz latonz deleted the 896-appropriate-diagnostic-location branch November 23, 2023 08:15
Copy link

🎉 This PR is included in version 3.3.0-next.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report diagnostics on the method which triggered it
2 participants