[CodeCompletion] Improve completion for Swift keypath expression

* Handle completion in 'parseExprKeyPath()' instead of
  'parseExprPostfixSuffix()'.
* Fix a crash for implicit type keypath. e.g. '\.path.<complete>'. (SR-8042).
* Use 'completeExprKeyPath()' callback.
* Implement completion without '.'. e.g. '\Ty.path<complete>'
* Improved handling for 'subscript' in completion.
* Improved handling for optional unwrapping in completion.

https://bugs.swift.org/browse/SR-8042
rdar://problem/41262612
This commit is contained in:
Rintaro Ishizaki
2018-08-21 21:55:02 +09:00
parent 8467203b9e
commit 1ac6afb3cf
4 changed files with 200 additions and 75 deletions

View File

@@ -160,8 +160,6 @@ public:
bool InPoundLineEnvironment = false;
bool InPoundIfEnvironment = false;
bool InSwiftKeyPath = false;
Expr* SwiftKeyPathRoot = nullptr;
SourceLoc SwiftKeyPathSlashLoc = SourceLoc();
LocalContext *CurLocalContext = nullptr;