Start moving toward a callback model for code-completion type-checking #4605
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
... 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