Skip to content

Start moving toward a callback model for code-completion type-checking #4605

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

Closed
wants to merge 1 commit into from

Conversation

benlangmuir
Copy link
Contributor

... to reduce and someday eliminate all the places we do double
typechecking. The goal is to setup any 'interesting' expressions ahead
of time so that if we type-check them at any point - e.g. during
checking the context - we don't lose the results and try to check them
again.

For now, this is limited to cases where the original expression is not
replaced by pre-checking or CSGen (i.e. we don't handle
UnresolvedDeclRef through this mechanism yet), and we're only using it
for the "parsed expression", which is either the base of a dot
completion, or the name in a function-call or initializer call
expression. The intent is to move unresolved member completion to the
same model in the future.

Currently, we use the results from the callbacks for 60% of these
completions, and of the 40% we miss, about 80% are simply
UnresolvedDeclRef or similarly obvious cases.

Progress toward rdar://21466394
Incidentally fixes rdar://20962472

... to reduce and someday eliminate all the places we do double
typechecking.  The goal is to setup any 'interesting' expressions ahead
of time so that if we type-check them at any point - e.g.  during
checking the context - we don't lose the results and try to check them
again.

For now, this is limited to cases where the original expression is not
replaced by pre-checking or CSGen (i.e. we don't handle
UnresolvedDeclRef through this mechanism yet), and we're only using it
for the "parsed expression", which is either the base of a dot
completion, or the name in a function-call or initializer call
expression.  The intent is to move unresolved member completion to the
same model in the future.

Currently, we use the results from the callbacks for 60% of these
completions, and of the 40% we miss, about 80% are simply
UnresolvedDeclRef or similarly obvious cases.

Progress toward rdar://21466394
Incidentally fixes rdar://20962472
@benlangmuir benlangmuir self-assigned this Sep 2, 2016
@benlangmuir
Copy link
Contributor Author

@swift-ci Please smoke test

@benlangmuir
Copy link
Contributor Author

@swift-ci Please ASAN test

@benlangmuir
Copy link
Contributor Author

Asan bot timed out, but it got through all the tests I was interested in anyway.

@benlangmuir
Copy link
Contributor Author

@DougGregor and/or @rudkx could you glance at the type-checker side of my changes?

@rudkx
Copy link
Contributor

rudkx commented Aug 6, 2018

@benlangmuir Is this PR still worth keeping open?

[I'm going through all the open PRs where I'm @-mentioned to see if there is anything I need to follow-up on.]

@benlangmuir
Copy link
Contributor Author

Closing. I have no immediate plans to work on this and it's probably the wrong direction anyway.

@benlangmuir benlangmuir closed this Aug 6, 2018
kateinoigakukun added a commit that referenced this pull request Aug 31, 2022
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