Commit Graph

2426 Commits

Author SHA1 Message Date
Rintaro Ishizaki
97b16ce5e3 [CodeCompletion] Remove unsound check in override completion
In override completion, we didn't use to emit 'class var' with the initial
expression. However, having initial expression does not have any bearing
on whether the declaration is overridable or not.
2019-11-12 17:40:36 +09:00
Rintaro Ishizaki
d51d8447f0 Do 'bindExtensions()' as a part of 'performParseAndNameBindingOnly()' 2019-11-12 13:30:55 +09:00
Rintaro Ishizaki
f6a76f51a0 Utilize forEachTypeWitness()/forEachValueWitness() 2019-11-12 13:30:55 +09:00
Rintaro Ishizaki
2564a6e494 [CodeCompletion] Avoid typechecking all toplevel decls in the current file
- Use `performParseAndResolveImportsOnly()` to invoke the frontend
- Do `bindExtensions()` in `ide::typeCheckContextUntil()`
- Typecheck preceding `TopLevelCodeDecl`s only if the compleiton is in
  a `TopLevelCodeDecl`
- Other related tweaks

rdar://problem/56636747
2019-11-12 12:57:18 +09:00
swift-ci
0c05ef9f71 Merge remote-tracking branch 'origin/master' into master-next 2019-11-08 13:49:24 -08:00
Nathan Hawes
345bcdb875 Merge pull request #28134 from nathawes/fix-cursor-info-on-call-arg-label-with-invalid-function
[IDE] Fix CursorInfo crash on arg label when the called 'function' is actually a module decl.
2019-11-08 13:45:38 -08:00
Nathan Hawes
1218613e27 [IDE] Fix CursorInfo crash on arg label when the called 'function' is actually a module decl. 2019-11-07 13:49:27 -08:00
swift-ci
daa3b7ce7f Merge remote-tracking branch 'origin/master' into master-next 2019-11-06 08:49:32 -08:00
Ben Langmuir
63ef99e20c Merge pull request #28014 from rintaro/ide-completion-secondpass-rdar56819166
[CodeCompleiton] Avoid walking the whole module to find the delayed func
2019-11-06 08:34:15 -08:00
swift-ci
ad069c5106 Merge remote-tracking branch 'origin/master' into master-next 2019-11-06 07:49:18 -08:00
Robert Widmann
d9b03a56a9 Merge pull request #28104 from CodaFi/broken-declspec
[NFC] Drop More Type Checkers
2019-11-06 07:31:49 -08:00
swift-ci
3a97d96bfb Merge remote-tracking branch 'origin/master' into master-next 2019-11-06 00:49:28 -08:00
David Ungar
069db6e661 Merge pull request #28038 from davidungar/rdar-56760957-dont-do-ide-lookups-into-inactive-clauses
[SourceKit NameLookup] Don't walk into inactive clauses.
2019-11-06 00:40:20 -08:00
Robert Widmann
6c6035eca2 Drop TypeCheckers out of TypeCheckStmt 2019-11-05 22:52:28 -08:00
swift-ci
ad3ea35608 Merge remote-tracking branch 'origin/master' into master-next 2019-11-05 20:10:09 -08:00
Robert Widmann
2b08d1b834 [NFC] ASTContext::getLazyResolver -> ASTContext::getLegacyGlobalTypeChecker 2019-11-05 14:44:41 -08:00
David Ungar
cd95ddb395 Don't do lookups into inactive clauses 2019-11-05 12:10:43 -08:00
swift-ci
9f6c8cbf3a Merge remote-tracking branch 'origin/master' into master-next 2019-11-04 12:50:07 -08:00
Robert Widmann
ce4b20c90d [Gardening] Remove dead LazyResolver members 2019-11-04 11:13:14 -08:00
swift-ci
c1290fb1b3 Merge remote-tracking branch 'origin/master' into master-next 2019-11-01 14:09:51 -07:00
Nathan Hawes
aeea756718 Merge pull request #27935 from nathawes/module-qualified-type-completion
[code-completion] Suggest module names, and handle module name bases for member completion in type position
2019-11-01 13:51:17 -07:00
Nathan Hawes
eabb561994 [code-completion] Give Modules a SemanticContextKind of None
This seems more correct than OtherModule, and means they're treated as
low-priority results for the session-based completion APIs. With default
options that means won't be shown in global completion results but will be
once there's some matching filter text. It also sorts them below any symbols
that actually come from other modules, which is desirable, since most symbols
don't need to be module qualified.

The SemanticContextKind change doesn't seem to affect Xcode's handling of the
results.
2019-11-01 11:11:52 -07:00
Rintaro Ishizaki
4b01a973f3 [CodeCompleiton] Avoid walking the whole module to find the delayed func
Previously delayed parsing was performed by AST walker
'ParseDelayedFunctionBodies' by finding "delayed" function decl from the AST
of the whole module. This is not necessary. Optimize it by remembering the
"delayed" function decl in 'PersistentParserState'.

NOTE: 'SourceLoader' stopped using this delayed parsing mechanism in
d8b745db77

rdar://problem/56819166
2019-11-01 10:51:40 -07:00
swift-ci
5323db1cfc Merge remote-tracking branch 'origin/master' into master-next 2019-10-31 13:49:56 -07:00
Robert Widmann
8a69f886ad Merge pull request #27955 from AnthonyLatsis/bracestmt_cleanup
NFC: Solidify and tidy up the BraceStmt interface
2019-10-31 13:48:40 -07:00
swift-ci
067dbed0c9 Merge remote-tracking branch 'origin/master' into master-next 2019-10-31 12:50:01 -07:00
Nathan Hawes
14107acfe6 Merge pull request #27983 from nathawes/complete-self-dot-init-in-struct-initializer
[code-completion] Suggest self.init in value type constructors
2019-10-31 12:34:36 -07:00
Nathan Hawes
1317db9520 [code-completion] Suggest self.init(..) in value type constructors
We missed these previously.
2019-10-30 17:41:34 -07:00
swift-ci
36da3cab70 Merge remote-tracking branch 'origin/master' into master-next 2019-10-30 16:49:48 -07:00
Robert Widmann
0267384e11 Fixup SourceKit and Tests
Patch up all the places that are making a syntactic judgement about the
isInvalid() bit in a ValueDecl.  They may continue to use that query,
but most guard themselves on whether the interface type has been set.
2019-10-30 15:09:14 -07:00
Robert Widmann
4996858c4d Re-implement isInvalid for ValueDecls 2019-10-30 15:09:14 -07:00
Nathan Hawes
b871454b8f [code-completion] Suggest module names in type and expression position
They can be used to qualify both.
2019-10-30 11:28:56 -07:00
swift-ci
2689ff9343 Merge remote-tracking branch 'origin/master' into master-next 2019-10-30 07:49:45 -07:00
Anthony Latsis
6325915b4b NFC: Solidify and tidy up the BraceStmt interface 2019-10-30 16:43:59 +03:00
Robert Widmann
e7006a92b1 Clean up some trivially true condition clauses
ProtocolConformanceRef::isConcrete checks the invalid bit for us.
2019-10-29 16:56:22 -07:00
Robert Widmann
b849e51768 Use operator bool to claw back some readability 2019-10-29 16:56:21 -07:00
Robert Widmann
3e1a61f425 [NFC] Fold The Tri-State In Optional<ProtocolConformanceRef>
ProtocolConformanceRef already has an invalid state.  Drop all of the
uses of Optional<ProtocolConformanceRef> and just use
ProtocolConformanceRef::forInvalid() to represent it.  Mechanically
translate all of the callers and callsites to use this new
representation.
2019-10-29 16:55:56 -07:00
Nathan Hawes
7350917c22 [code-completion] Complete after qualifying module names in type position
Previously we would just return if the parsed type loc didn't type check as a
type.
2019-10-29 10:48:53 -07:00
Xi Ge
64c0680686 Merge remote-tracking branch 'apple/master' into master-next 2019-10-28 10:19:36 -07:00
Robert Widmann
3b829943af Uniformly iterate over the pattern binding entry indices
Clarify a bunch of C-style for loops and remove a ton of references to getPatternList().
2019-10-17 13:39:07 -07:00
Robert Widmann
56b6e53dae Remove raw references to PatternBindingEntry APIs
Switch most callers to explicit indices.  The exceptions lie in things that needs to manipulate the parsed output directly including the Parser and components of the ASTScope.  These are included as friend class exceptions.
2019-10-17 13:31:14 -07:00
Rintaro Ishizaki
bf5aa0a5a1 Revert "Merge pull request #27325 from rintaro/syntaxparse-cctype"
This reverts commit 439b9111b7, reversing
changes made to 4e476ff243.
2019-10-14 12:20:57 -07:00
swift-ci
e4cbf824ae Merge remote-tracking branch 'origin/master' into master-next 2019-10-11 15:10:04 -07:00
Robert Widmann
060cbb293f [NFC] Downgrade The TypeLoc in VarDecl to a TypeRepr
TypeCheckPattern used to splat the interface type into this, and
different parts of the compiler would check one or the other.   There is
now one source of truth: The interface type.  The type repr is now just
a signal that the user has written an explicit type annotation on
a parameter.  For variables, we will eventually be able to just grab
this information from the parent pattern.
2019-10-11 11:15:51 -07:00
swift-ci
f770a376e8 Merge remote-tracking branch 'origin/master' into master-next 2019-10-10 14:10:19 -07:00
Nathan Hawes
d930599394 Merge pull request #27591 from nathawes/r55680999-fix-object-literals-in-invalid-code
[syntax-coloring] Add fallback handling for object literals when no ObjectLiteralExpr appears in the AST
2019-10-10 13:54:10 -07:00
swift-ci
84f192ddce Merge remote-tracking branch 'origin/master' into master-next 2019-10-10 13:50:08 -07:00
Xi Ge
dd33540231 AST: rename printDeclUSRForModuleDoc to printDeclUSR. NFC 2019-10-09 15:29:52 -07:00
Nathan Hawes
666a98cfd8 [syntax-coloring] Add fallback handling for coloring object literals when they don't appear in the AST
Resolves rdar://problem/55680999
2019-10-09 12:15:43 -07:00
swift-ci
3bad1c2af4 Merge remote-tracking branch 'origin/master' into master-next 2019-10-08 07:49:04 -07:00