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

[SourceKit/CursorInfo] Mark dynamic calls #36508

Merged
merged 2 commits into from Mar 23, 2021
Merged

Conversation

@bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Mar 19, 2021

Adds two new fields to the cursor info response:

  1. is_dynamic: whether a call is dynamic
  2. receivers: receivers of the call (USRs)

Users of the CursorInfo request can use "is_dynamic" to decide whether
to lookup overrides or not, and then the "receivers" as the starting
point of the lookup.

Resolves rdar://75385900

@bnbarham bnbarham requested review from akyrtzi and nathawes Mar 19, 2021
@bnbarham
Copy link
Contributor Author

@bnbarham bnbarham commented Mar 19, 2021

@swift-ci please test

lib/IDE/Utils.cpp Outdated Show resolved Hide resolved
if (!TyD)
return false;

if (isa<StructDecl>(TyD) || isa<EnumDecl>(TyD) || D->isFinal())

This comment has been minimized.

@bnbarham

bnbarham Mar 19, 2021
Author Contributor

isFinal is new here

@swift-ci
Copy link
Contributor

@swift-ci swift-ci commented Mar 19, 2021

Build failed
Swift Test Linux Platform
Git Sha - c600b5d

@swift-ci
Copy link
Contributor

@swift-ci swift-ci commented Mar 19, 2021

Build failed
Swift Test OS X Platform
Git Sha - c600b5d

@akyrtzi akyrtzi requested a review from benlangmuir Mar 19, 2021
bnbarham added 2 commits Mar 19, 2021
The cursor info request also needs to output whether a call is "dynamic"
or not, move the functions related to this out of Index.cpp and into
IDE/Utils.cpp.

Also cleanup the `TrailingExpr` handling in `CursorInfoResolver` - it
only needs the first expression.
Adds two new fields to the cursor info response:
  1. is_dynamic: whether a call is dynamic
  2. receivers: receivers of the call (USRs)

Users of the CursorInfo request can use "is_dynamic" to decide whether
to lookup overrides or not, and then the "receivers" as the starting
point of the lookup.

Resolves rdar://75385900
@bnbarham bnbarham force-pushed the bnbarham:static-dynamic-flag branch from c600b5d to 19f2313 Mar 20, 2021
@bnbarham
Copy link
Contributor Author

@bnbarham bnbarham commented Mar 20, 2021

@swift-ci please test

@bnbarham bnbarham changed the title [SourceKit/CursorInfo] Add a field to mark when a result is dynamic [SourceKit/CursorInfo] Mark dynamic calls Mar 20, 2021
@swift-ci
Copy link
Contributor

@swift-ci swift-ci commented Mar 20, 2021

Build failed
Swift Test Linux Platform
Git Sha - 19f2313

@bnbarham
Copy link
Contributor Author

@bnbarham bnbarham commented Mar 22, 2021

@swift-ci please test Linux platform

@swift-ci
Copy link
Contributor

@swift-ci swift-ci commented Mar 22, 2021

Build failed
Swift Test Linux Platform
Git Sha - 19f2313

@bnbarham
Copy link
Contributor Author

@bnbarham bnbarham commented Mar 22, 2021

@swift-ci please test Linux platform

@bnbarham
Copy link
Contributor Author

@bnbarham bnbarham commented Mar 23, 2021

@benlangmuir going to merge but let me know if there's any changes you'd like me to make.

@bnbarham bnbarham merged commit 8948a03 into apple:main Mar 23, 2021
5 checks passed
5 checks passed
Swift Test Linux Platform
Details
Swift Test Linux Platform (smoke test)
Details
Swift Test Windows Platform Build finished. No test results found.
Details
Swift Test macOS Platform
Details
Swift Test macOS Platform (smoke test)
Details
@bnbarham bnbarham deleted the bnbarham:static-dynamic-flag branch Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants