Skip to content

[TypeChecker] Add a entry point to be used for code completion #32391

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 1 commit into from
Jun 16, 2020

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 15, 2020

As part of the code completion redesign this new entry point is going
to replace use of:

  • typeCheckExpression
  • getTypeOfExpressionWithoutApplying (which could be removed)

and possibly other methods currently used to retrieve information
for code completion purposes.

Advantages of a new approach:

  • Avoids mutating AST;
  • Allows to avoid sub-expression type-checking;
  • Allows code completion access to multiple solutions in ambiguous cases;
  • Provides all possible solutions - valid and invalid (with holes);
  • Allows code completion to easily access not only types but
    overload choices and other supplimentary information associated
    with each solution.

As part of the code completion redesign this new entry point is going
to replace use of:

- `typeCheckExpression`
- `getTypeOfExpressionWithoutApplying` (which could be removed)

and possibly other methods currently used to retrieve information
for code completion purposes.

Advantages of a new approach:

- Avoids mutating AST;
- Allows to avoid sub-expression type-checking;
- Allows code completion access to multiple solutions in ambiguous cases;
- Provides all possible solutions - valid and invalid (with holes);
- Allows code completion to easily access not only types but
  overload choices and other supplimentary information associated
  with each solution.
@xedin xedin requested review from rintaro and nathawes June 15, 2020 21:05
@xedin
Copy link
Contributor Author

xedin commented Jun 15, 2020

@swift-ci please smoke test

@xedin xedin merged commit f159175 into swiftlang:master Jun 16, 2020
Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis left a comment

Choose a reason for hiding this comment

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

Just throwing in some low-priority textual nits.

@xedin
Copy link
Contributor Author

xedin commented Jun 17, 2020

Addressed all suggestions in #32426

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