Commit Graph

1994 Commits

Author SHA1 Message Date
swift-ci
5f8d932159 Merge remote-tracking branch 'origin/master' into master-next 2018-05-24 14:49:06 -07:00
Ben Langmuir
a90aeca095 Merge pull request #16534 from AnthonyLatsis/self-completion-dot-expr
[CodeCompletion] SR-943 'self' for dot expressions
2018-05-24 14:44:21 -07:00
swift-ci
b8605f732d Merge remote-tracking branch 'origin/master' into master-next 2018-05-23 16:09:20 -07:00
Rintaro Ishizaki
025f4dde55 Merge pull request #16789 from rintaro/refactoring-nested-if
[Refactoring] Re-implement "collapse nested if" action
2018-05-24 07:56:02 +09:00
Rintaro Ishizaki
70ff0c013b [Refactoring] Disallow extracting partial statement
`BraceStmt`, `CatchStmt` and `CaseStmt` cannot be independent
statement, thus unextractable.

rdar://problem/38390401
2018-05-23 18:03:27 +09:00
Rintaro Ishizaki
639fb85c5f [Refactoring] Rename CollapseNestedIfExpr to CollapseNestedIfStmt
'if' is not expression, but statement.
2018-05-23 17:13:35 +09:00
Rintaro Ishizaki
f1c8230b2a [Refactoring] Re-implement "collapse nested if" action
Narrowed `isApplicable()` condition to ensure that we don't emit this
action when it's not safe to apply this action.

Fixes rdar://problem/39516354
2018-05-23 17:13:35 +09:00
swift-ci
35dbca34c8 Merge remote-tracking branch 'origin/master' into master-next 2018-05-21 17:09:18 -07:00
Davide Italiano
dd65d69ed5 [TypeReconstruction] Fix reconstruction for VarDecls.
We were previously asserting on the following tree:
kind=Global
  kind=Variable
    kind=Module, text="EyeCandySwift"
    kind=PrivateDeclName
      kind=Identifier, text="_ADC08935D64EA4F796440E7335798735"
      kind=Identifier, text="_previousUniqueNumber"
    kind=Type
      kind=Structure
        kind=Module, text="Swift"
        kind=Identifier, text="UInt64"

<rdar://problem/39283527>
2018-05-21 14:39:50 -07:00
Bob Wilson
1fc7f1391e [master-next] Update endian stream interface to match Clang r332757 2018-05-19 22:19:35 -07:00
Davide Italiano
2a91041ea0 [TypeReconstruction] Add support for generic typealiases.
This fixes the compiler side of the problem.
An lldb test will be added to make sure this doesn't regress
in the future (or, if it does, at least we know).

<rdar://problem/40261592>.
2018-05-17 14:19:20 -07:00
Davide Italiano
8d3045dcb8 [TypeReconstruction] Handle InOutType when reconstructing elements.
Before, we were just ignoring it, and this resulted in the type
being reconstructed incorrectly when assertion were disabled, and
in an assertion firing otherwise (AST invariants being broken).

<rdar://problem/39248252>
2018-05-14 15:01:33 -07:00
swift-ci
aa5cb47fec Merge pull request #16598 from nkcsgexi/migrator-arg-rename-hoist 2018-05-14 12:31:48 -07:00
Xi Ge
343d84ba35 migrator: handle argument renames when a global function is hoisted to a static member function. rdar://40145590 2018-05-14 11:33:25 -07:00
fischertony
7b41a41fb6 updated tests & added completions for postfixExpr 2018-05-12 09:05:57 +03:00
fischertony
c88e1c983f [CodeCompletion] self for dot expressions
May dot expressions finally have a 'self' completion.
2018-05-11 09:48:53 +03:00
Rintaro Ishizaki
dc76149150 [IDE] Use getStartLoc() for matching pattern ranges
For Example `getLoc()` for `foo as Ty`(`IsPattern`) is at 'as'. We
should try to resolve this at position of 'foo'.
2018-05-11 15:34:42 +09:00
Alex Hoppen
9149cb61c5 Merge pull request #16474 from ahoppen/namelength
[SourceKit] Make the NameLength of EnumElements take argument labels into account
2018-05-10 12:14:11 -07:00
Alex Hoppen
4f43c8e93c [SourceKit] Make the NameLength of EnumElements take argument labels into account 2018-05-10 11:27:49 -07:00
Rintaro Ishizaki
06a9ef6073 Merge pull request #16440 from rintaro/ide-walkdefer
[IDE] Fix visiting DeferStmt
2018-05-09 09:55:54 +09:00
Xi Ge
33e0570fda migrator: ignore return value rewritten for constructors. rdar://40041102 2018-05-08 11:26:25 -07:00
Rintaro Ishizaki
1fa04208e0 [IDE] Fix visiting DeferStmt
* Call balanced walkToStmtPost() for DeferStmt.
* In walkToStmtPre(), return DeferStmt itself instead of the body.

rdar://problem/39948168
2018-05-08 16:32:52 +09:00
Jordan Rose
18162a3ed0 Revert "AST: Simplify ModuleDecl::forAllVisibleModules()"
This reverts commit 0c32c54e36.
2018-05-03 22:40:37 -06:00
swift-ci
d037d29944 Merge pull request #16329 from nkcsgexi/doc-info-std-lib 2018-05-02 19:18:19 -07:00
Xi Ge
714775eb0a DocSupport: don't assume we've printed the first extension when merging several together. rdar://39887195
When printing the content of several extensions into a
synthesized one, we shouldn't assume the first extension in the
group always gets printed.
2018-05-02 17:46:41 -07:00
swift-ci
e2f3e6d2e6 Merge pull request #16290 from nkcsgexi/avoid-under-api 2018-05-01 17:00:36 -07:00
Xi Ge
82a2c2c644 migrator: ignore migration scripts with underscored new names. rdar://39877447
Updating something to underscored names is hardly correct. This patch
disallows picking up such migration scripts.
2018-05-01 16:06:06 -07:00
Nathan Hawes
af7169a648 Merge pull request #16265 from nathawes/rdar38153332-code-completion-hits-unreachable-in-matchtypes
[code-completion] Don't try to equate/convert GenericTypeParameterTypes when computing type relations of completion results
2018-05-01 13:44:03 -07:00
Huon Wilson
d4f49a1252 [IDE] std::function -> llvm::function_ref for some non-escaping params. 2018-05-01 08:29:06 +10:00
Nathan Hawes
d9ca14203d [code-completion] Don't try to equate/convert GenericTypeParameterTypes computing type relations of completion results
For call argument completion, if the expected type and completion result type are
both GenericTypeParameterTypes, comparing them doesn't make sense we can't account
for their different contexts at this point in the code, and hit assertions in the
constraint solver if we try.

For now, don't attempt to add a type relation for this case.
Resolves rdar://problem/38153332.
2018-04-30 15:12:54 -07:00
Slava Pestov
af875829a7 Merge pull request #16206 from slavapestov/serialization-cleanup
Serialization cleanup
2018-04-27 05:22:40 -07:00
Slava Pestov
0c32c54e36 AST: Simplify ModuleDecl::forAllVisibleModules() 2018-04-26 23:37:16 -07:00
Pavel Yaskevich
57ad592844 [Sema] Switch computeDefaultMap to use AnyFunctionType::getParams() 2018-04-26 17:33:08 -07:00
Xi Ge
36b2c93c90 Merge pull request #16048 from nkcsgexi/name-correction
swift-api-digester: add a new action to dump name correction template.
2018-04-20 09:00:13 -07:00
Huon Wilson
18683f305d Merge pull request #15587 from huonw/minmax
[Sema] Perform name lookup in outer scopes in some cases involving conditional conformances
2018-04-20 22:33:07 +10:00
Xi Ge
53c9f1aaa9 swift-api-digester: add a new action to dump name correction template.
Rename detection in the tool may not reflect overlay additions; thus we
mistakes a new name to be an underscored one. This new action searches
migration scripts for suspicious ones and generates a template for us to
specify the correct names.
2018-04-19 18:01:01 -07:00
Huon Wilson
6a13fc5336 Merge pull request #15944 from huonw/fatalError-bodies
[IDE] Tweak replace.bodies.with.fatalError.
2018-04-18 07:56:33 +10:00
Rintaro Ishizaki
095623b61c [code-complete] Small refactoring in addImportModuleNames (#15943)
Improves readability.
In the future, we will fix "FIXME: Add user-defined swift modules" based
on this.
2018-04-17 08:24:24 +09:00
Huon Wilson
75313cfed5 [IDE] make replace.bodies.with.fatalError an internal refactoring.
This shouldn't be exposed to general users.
2018-04-17 09:05:26 +10:00
Huon Wilson
fac1a529fe [IDE] Tweak replace.bodies.with.fatalError.
The menu item should be capitalised, and it's nicer if the fatalError is on its
own line in the new function body.
2018-04-16 12:58:55 +10:00
Huon Wilson
3124f6ad50 Merge pull request #15916 from huonw/fatalError-bodies
[IDE] Refactoring to change function bodies to "fatalError()".
2018-04-14 12:30:05 +10:00
Ben Langmuir
45936f5242 [gardening] Tweak comment wording 2018-04-13 13:49:57 -07:00
Huon Wilson
8056102ee5 [IDE] Refactoring to change function bodies to "fatalError()".
This is immensely useful when working on generic code, where the signatures
of (many) functions are all that is required, and removing the bodies makes
things compile faster, allows tools like creduce to work better and results in
less noise in a debugger.

Unfortunately the design of refactoring means this currently only works on a
single top-level decl, or multiple decls inside a type.
2018-04-13 15:56:56 +10:00
Xi Ge
e405bab9bf swift-api-digester: separate migration kind from the other node annotation kind. NFC 2018-04-09 16:18:24 -07:00
Rintaro Ishizaki
53be298f1f [IDE] Don't emit “Convert to Trailing Closure” for trailing closure (#15824)
rdar://problem/39253640
2018-04-09 15:30:52 +09:00
Huon Wilson
fe00f53e48 [AST] Use flags instead of booleans for UnqualifiedLookup. 2018-04-09 10:58:49 +10:00
David Zarzycki
7174d14dad [Parsing] NFC: metaprogram contextual decl keywords into Attr.def 2018-04-07 18:00:12 -04:00
Xi Ge
72f49e2351 swift-api-digester: separate internal and external names for node kinds. NFC 2018-04-05 15:38:17 -07:00
Nathan Hawes
73ac297736 Merge pull request #15630 from nathawes/rdar39011293-range-resolver-assertion-hit
[IDE] Fix imbalanced walkToDeclPre/Post calls in SemaAnnotator for IfConfigDecls
2018-03-30 15:45:27 -07:00
Nathan Hawes
8fab22f124 [IDE] Fix imbalanced walkToDeclPre/Post calls in SemaAnotator for IfConfigDecls.
Resolves rdar://problem/39011293.
2018-03-30 13:03:49 -07:00