Commit Graph

5 Commits

Author SHA1 Message Date
Rintaro Ishizaki
4870d1c017 [SourceKit] Don't use diagnostics to indicate fast-completion
Add 'key.reusingastcontext: 1' to the response instead.
Using diagnostics can be a noise to indexing log clients.

rdar://problem/61367416
2020-04-07 16:26:00 -07:00
Argyrios Kyrtzidis
4d337f2db2 [SourceKit] Turn-on by default the fast completion mode
rdar://59830963
2020-02-26 18:16:07 -08:00
Rintaro Ishizaki
0a0cde92a4 [CodeCompletion] Fast completion for top-level code in single file script
e.g. Playground.
A single file script is like a single function body; the interface of
the file does not affect any other files.
So when a completion happens in a single file script, re-parse the whole
file. But we are still be able to reuse imported modules.

rdar://problem/58378157
2020-02-25 15:56:28 -08:00
Rintaro Ishizaki
7b4db904a1 [CodeCompletion] Complete at the top of accessor block in body parsing
If a CC token is right after the '{' we still don't know it's an implicit
getter or a start of a accessor block. Previously, the parser used to
parse it as an accessor block, but it prevents fast-completion kicks in.

Instead handle it as a part of function body parsing so the
fast-completion works.

rdar://problem/58851121
2020-02-12 10:19:18 -08:00
Rintaro Ishizaki
3018b55914 [CodeCompletion] Enable fast completion within accessors
'getEquivalentDeclContextFromSourceFile()' didn't work for accessors
because DeclContext hierarchy and AST hierarhy are not the same.

AST hierarchy:
    (TypeDecl or SourceFile) > AbstractStorageDecl > AccessorDecl
DeclContext hierarchy:
    (TypeDecl or SourceFile) > AccessorDecl

Handle them specially.

rdar://problem/58632889
2020-01-15 21:33:49 -08:00