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

Provide a function for languages to influence reference resolution out of candidates #1909

Merged
merged 2 commits into from
Dec 27, 2024

Conversation

oxisto
Copy link
Member

@oxisto oxisto commented Dec 19, 2024

This adds a new function Language.bestViableReferenceCandidate which takes the old implementation as a default behaviour.

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 61.53846% with 5 lines in your changes missing coverage. Please review.

Project coverage is 77.03%. Comparing base (a2d326e) to head (621f3d3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...n/de/fraunhofer/aisec/cpg/passes/SymbolResolver.kt 16.66% 4 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...tlin/de/fraunhofer/aisec/cpg/frontends/Language.kt 92.24% <100.00%> (+0.49%) ⬆️
...n/de/fraunhofer/aisec/cpg/passes/SymbolResolver.kt 86.62% <16.66%> (-1.34%) ⬇️

... and 2 files with indirect coverage changes

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

@oxisto oxisto added the core label Dec 22, 2024
@konradweiss
Copy link
Collaborator

Now the default behavior changed from being singleOrNull in all cases to to one candidate if the list of candidates contains exactly one element and null otherwise. I hope this was the intention

@oxisto
Copy link
Member Author

oxisto commented Dec 27, 2024

Now the default behavior changed from being singleOrNull in all cases to to one candidate if the list of candidates contains exactly one element and null otherwise. I hope this was the intention

The default behavior is unchanged, but a language can override it.

…t of candidates

This adds a new function `Language.bestViableReferenceCandidate` which takes the old implementation as a default behaviour.
@oxisto oxisto force-pushed the language-ref-candidate branch from f827d33 to 621f3d3 Compare December 27, 2024 12:13
@oxisto oxisto enabled auto-merge (squash) December 27, 2024 12:13
@oxisto oxisto merged commit 9f0e957 into main Dec 27, 2024
2 checks passed
@oxisto oxisto deleted the language-ref-candidate branch December 27, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants