Skip to content

Consider containingClass when matching psi methods and KFuncitons #1398 #1502

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

Merged

Conversation

volivan239
Copy link
Collaborator

Description

To get ExecutableIds of methods selected in plugin, we have to somehow match psi methods with reflections of the corresponding loaded methods. Previously we did matching by Signature, but it was not sufficient, e.g. abstract method and its implementation would have the same Signature. This PR replaces Signature with MethodDescription which includes signature, but also has containingClass parameter.

Fixes #1398

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manual Scenario

Tested on the example from #1398 -- now the tests class with tests is generated for Point

Checklist (remove irrelevant options):

This is the author self-check list

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

@volivan239 volivan239 marked this pull request as ready for review December 9, 2022 11:53
Copy link
Collaborator

@Domonion Domonion left a comment

Choose a reason for hiding this comment

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

// Note that rules for obtaining signature here should correlate with PsiMethod.signature()

Hope it will be always correlated)

@volivan239 volivan239 merged commit 82c0351 into main Dec 16, 2022
@volivan239 volivan239 deleted the volivan239/fix_no_methods_found_for_abstract_inheritor branch December 16, 2022 09:04
@alisevych alisevych added this to the 2023.03 Release milestone Mar 21, 2023
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.

RdFault: No method source set for method - for an abstract class inheritor
4 participants