Skip to content

Add is_reference relationships between synthetic case class symbols #561

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
merged 3 commits into from
Apr 24, 2023

Conversation

olafurpg
Copy link
Member

Previously, doing "Find references" on a synthetic case class symbol (for example, named parameter of a copy method) then it only showed usages of that symbol and the non-synthetic symbol (for example, the
case class field that matches the copy parameter). It didn't
return usages of other synthetic symbols that also relate to the case class field (for example, the apply parameter).

This PR fixes the issue by adding is_reference relationships between all synthetic symbols that relate to the same non-synthetic symbol.

Test plan

See updated snapshots.

Previously, doing "Find references" on a synthetic case class symbol
(for example, named parameter of a `copy` method) then it only showed
usages of that symbol and the non-synthetic symbol (for example, the
    case class field that matches the `copy` parameter). It didn't
return usages of other synthetic symbols that also relate to the case
class field (for example, the `apply` parameter).

This PR fixes the issue by adding `is_reference` relationships between
all synthetic symbols that relate to the same non-synthetic symbol.
Previously, it only ran `src code-intel upload` on git tags and master
branch.
Needed to use `Nullable` annotation
Comment on lines -20 to 23
distribution: 'temurin'
distribution: "temurin"
java-version: 8
cache: 'sbt'
cache: "sbt"

Copy link
Contributor

Choose a reason for hiding this comment

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

Rest of the changes aside, let's bikeshed about this for a few days.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have format on save enabled in VS Code and 🤷🏻 Worth adding a CI check to format the YAML files with prettier

// ________ synthetic_definition semanticdb maven . . minimized/Issue396#productElement().
// documentation ```scala\ndef productElement(x$1: Int): Any\n```
// relationship is_definition semanticdb maven . . minimized/Issue396#
// relationship is_reference semanticdb maven . . minimized/Issue396.apply().
Copy link
Contributor

Choose a reason for hiding this comment

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

Lifting from slack: both @olafurpg and I agree that productElement* family of methods shouldn't be referencing apply

copy is fine
default constructor is fine-ish (even though it's the other way around?)

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.

None yet

2 participants