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

Fixed logic around fallback resolver in URIResolverRegistry #2101

Merged
merged 5 commits into from
Dec 18, 2024

Conversation

rodinaarssen
Copy link
Member

Fixed a (latent) bug where the result of logical source location resolution would be de facto discarded by the fallback resolver returning null. This popped up during evolution of the FallbackResolver class in the rascal-lsp project.

Copy link
Member

@DavyLandman DavyLandman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good catch. I added one more edge case that we might have missed.

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 49%. Comparing base (043b663) to head (5a64534).
Report is 55 commits behind head on main.

Files with missing lines Patch % Lines
src/org/rascalmpl/uri/URIResolverRegistry.java 0% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##              main   #2101    +/-   ##
========================================
  Coverage       49%     49%            
- Complexity    6317    6336    +19     
========================================
  Files          666     667     +1     
  Lines        59695   59836   +141     
  Branches      8670    8692    +22     
========================================
+ Hits         29600   29709   +109     
- Misses       27863   27873    +10     
- Partials      2232    2254    +22     

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

var fallBack = fallbackLogicalResolver;
if (fallBack != null) {
return resolveAndFixOffsets(loc == null ? original : loc, fallBack, Collections.emptyList());
if (loc == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the right place for this check, it changes the logic of the case where there is no fallbackLogicalResolver defined.

@DavyLandman DavyLandman merged commit cfc601c into main Dec 18, 2024
6 of 7 checks passed
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.

2 participants