Commit Graph

1230 Commits

Author SHA1 Message Date
Doug Gregor
75a5496bc1 Merge pull request #26084 from DougGregor/request-evaluator-cross-file-vis
[Request-evaluator] Graphviz visualization of cross-file dependencies
2019-07-11 13:25:14 -07:00
Doug Gregor
e2df49e5d6 Fix SourceKit test for property wrappers init(initialValue:) rename. 2019-07-11 10:26:37 -07:00
Gwen Mittertreiner
518196cde9 Properly Compare True and False Order in Sourcekit
Comparing "false" > "true" will return 0, which when returned by compare
indicates the two are equal which will result in a non deterministic
ordering of "false" and "true". Using .compare returns a negative number
as expected.
2019-07-10 18:25:53 -07:00
Nathan Hawes
0d59bffd81 [SourceKit] Fix placeholder expansion not working inside #if
Update the PlaceholderFinder ASTWalker to walk into the clauses of
IfConfigDecls. It wasn't previously, resulting in any placeholders there not
being expanded.

Also update CallExprFinder (used to determine if expansions should use trailing
closure syntax) to walk into inactive if-config clauses. Previously it only
walked into active regions, so expansions never used trailing closure syntax in
inactive regions.

Resolves rdar://problem/51995648
2019-07-09 14:18:40 -07:00
Sergej Jaskiewicz
0446ad3c3d Fix failing test cases for expected_keyword_in_decl diagnostic 2019-07-07 00:12:37 +03:00
Sergej Jaskiewicz
95eea2f3e9 [Parse] Implement "missing 'func' keyword" diagnostic with a fix-it
- When parsing a type or extension declaration, attempt to parse a function or property declaration when meeting an identifier, an operator or a paren (for tuple declarations).
- Produce the diagnostic with a fix-it suggesting to insert the needed keyword
- Recover parsing as if the declaration with the missing keyword is a function/property declaration

Resolves https://bugs.swift.org/browse/SR-10477
2019-07-04 20:06:35 +03:00
Argyrios Kyrtzidis
b5254ec2fc Merge pull request #25940 from nkcsgexi/avoid-ident-close-paren
SourceKit/Indentation: avoid indenting closing paren of function-like decls if it appears in a new line
2019-07-02 16:27:16 -07:00
Xi Ge
c2d8c460f3 SourceKit/Indentation: avoid indenting closing paren of function-like decls if it appears in a new line
rdar://51719094
2019-07-02 12:41:08 -07:00
Rintaro Ishizaki
9525f16440 [SourceKit] Add completion kind field to completion response
rdar://problem/52352045
2019-07-01 14:40:03 -07:00
Jordan Rose
02e1a11e35 [Index] Don't index non-public imported declarations (#25865)
Apart from mildly speeding up indexing, this also keeps the compiler
from running into issues with implementation-only imports that may not
be present while we're trying to index.

rdar://problem/52083709
2019-06-28 16:57:29 -07:00
Nathan Hawes
e08a6c1994 [IDE][Index][test] Update sourcekit/indexing support for latest property wrapper changes
The backing property for 'foo' is now '_foo', and the projected value '$foo'.
This updates Indexing to report occurrences of foo within both $foo and
_foo occurrences (rather than just $foo - the old _foo).

FindRelatedIdents was similarlar updated, so it reports 'foo' ranges in both
_foo and $foo.

CursorInfo now reports the USR, documentation, and location of foo when invoked
occurrences of $foo or _foo, but now leaves the name, type, and annotated
declaration of _foo/$foo as is. Having the same USR ensures rename invoked on
any of them will still rename via foo. Reporting foo's documentation comment
instead is just to present something more useful to the user.
2019-06-28 10:15:00 -07:00
Nathan Hawes
c547e6885e [test] Add more index/refactoring/cursor-info tests for property wrappers
Make sure they handle the case when a property wrapper type's constructor is
called with the first argument coming from the var initializer, and the rest
from the custom attribute's argument.
2019-06-26 18:37:47 -07:00
Nathan Hawes
91e2e35a77 [IDE] Update CursorInfo and FindRelatedIdents to treat property wrapper backing properties as the underlying property
This is the final piece to get rename and findRelatedIdents to include all foo
and $foo occurrences, for example, in the set of occurrences to be renamed or
shown, regardless of whether they were initiated on a foo or $foo.

Resolves rdar://problem/51695783.
2019-06-26 18:37:47 -07:00
Argyrios Kyrtzidis
7fd19f3d67 Merge pull request #25674 from akyrtzi/disable-typo-correction
Disable typo-correction by default until we can make it work within acceptable performance bounds
2019-06-25 09:06:27 -07:00
Argyrios Kyrtzidis
cf65b8f952 Disable typo-correction by default until we can make it work within acceptable performance bounds
Typo-correction can be so expensive that it can slow down typechecking over 10x.
It can be a significant productivity drain for developing on large projects.

Unfortunately it is best that we disable it until we can dedicate the time to address its performance issues
and we are certain it works within acceptable performance bounds.

rdar://51966070
2019-06-22 17:02:03 -07:00
swift-ci
88a5c00b34 Merge pull request #25672 from akyrtzi/index-remove-module-hash 2019-06-21 18:16:29 -07:00
Argyrios Kyrtzidis
3332b37d00 [Index/SourceKit] Remove the code related to calculating a module hash from the indexing walker
This has been an unnecessary code path for a long time now and should be removed particularly because it triggers wasteful `stat` calls.

rdar://51523161
2019-06-21 17:09:12 -07:00
Rintaro Ishizaki
16bc322cd3 Merge pull request #24813 from rintaro/comment-refactor
[AST] Inherit doc-brief comment from protocol, superclass, and requirement
2019-06-20 15:54:17 -07:00
David Ungar
aac3a3d2ae Add a test & don’t look for a module with a special name. 2019-06-20 11:19:12 -07:00
Rintaro Ishizaki
db2c11787b [AST] Inherit doc-brief comment from protocol, superclass, and requirement
rdar://problem/38422822
2019-06-20 10:04:05 -07:00
Rintaro Ishizaki
319d386f75 [SourceKit] Extend opaque type results test case 2019-06-17 17:50:28 -07:00
Argyrios Kyrtzidis
b3be8ae772 [ASTPrinter] Make sure to print some as a keyword
rdar://50073494
2019-06-14 17:22:30 -07:00
Rintaro Ishizaki
1c2c5c5114 [placeholder-expansion] Function builder: add basic expansion test
rdar://problem/50074177
2019-06-11 17:34:45 -07:00
Rintaro Ishizaki
5cc5b933dc [SourceKit] Function builder: Add cursor-info test cases
rdar://problem/50074156
2019-06-11 17:34:45 -07:00
Xi Ge
5280254325 Sourcekit/Indentation: avoid indenting dot member access appearing after trailing closure 2019-06-11 15:12:30 -07:00
Xi Ge
2b190648c0 SourceKit/Indentation: avoid indenting the end of subscript expressions in call chain.
rdar://50591281
2019-06-11 10:54:07 -07:00
Xi Ge
c7cf96660a SourceKit/Indentation: align function names in chained trailing closures
Chained trailing closures are sibling-like thus they should be aligned.

rdar://22205716
2019-06-10 17:07:20 -07:00
mishal_shah
1e38fc3030 Update master to build with Xcode 11 beta, macOS 10.15, iOS 13, tvOS 13, and watchOS 6 SDKs 2019-06-03 22:50:02 -07:00
swift-ci
df46bb53fb Merge pull request #25183 from DougGregor/property-wrapper-diag-cleanups 2019-05-31 23:12:15 -07:00
Doug Gregor
d430ddb717 [SE-0258] Minor diagnostic fix for $ and a test case update 2019-05-31 21:33:56 -07:00
Ben Cohen
e9d4687e31 De-underscore @frozen, apply it to structs (#24185)
* De-underscore @frozen for enums

* Add @frozen for structs, deprecate @_fixed_layout for them

* Switch usage from _fixed_layout to frozen
2019-05-30 17:55:37 -07:00
Xi Ge
b520708f07 Sourcekit/Indentation: avoid indenting the end of array/dictionary literals if they appear at the argument end
rdar://40093469
2019-05-30 15:51:50 -07:00
Rintaro Ishizaki
6da1be5d16 Merge pull request #25130 from rintaro/ide-mangledtype-rdar51198887
[TypeContextInfo/ConformingMethods] Map type out of context
2019-05-30 15:07:03 -07:00
Rintaro Ishizaki
5ff4b0cfcd [TypeContextInfo/ConformingMethods] Map type out of context
To print mangling names.

rdar://problem/51198887
rdar://problem/51227338
2019-05-30 10:59:32 -07:00
David Goldman
7b6f9499b7 Comment and sourcekitd-test fixes 2019-05-28 04:36:29 -04:00
David Goldman
1b1756cb55 Add InternalDiagnostic to CursorInfoData and NameTranslatingInfo 2019-05-28 04:24:25 -04:00
David Goldman
176cd6cce1 Fail requests when an error occurs
Previously, requests would fail silently by returning an empty struct
in the response.

With this change, responses will properly report fail with the internal
error.
2019-05-28 04:24:25 -04:00
Argyrios Kyrtzidis
b1b6ce6916 Merge pull request #25033 from akyrtzi/sourcekitd-expose-indent-switch-option
[sourcekitd] Expose the indentation option for extra indentation of switch case
2019-05-23 20:48:00 -07:00
Argyrios Kyrtzidis
1dcb1e083a [sourcekitd] Expose the indentation option for extra indentation of switch case
rdar://51079623
2019-05-23 16:21:30 -07:00
Joe Groff
7d54810b92 Revert "[SourceKit] Fail requests when an error occurs" 2019-05-22 15:18:28 -07:00
Argyrios Kyrtzidis
729a9558e8 Merge pull request #24124 from DavidGoldman/master
[SourceKit] Fail requests when an error occurs
2019-05-22 10:49:42 -07:00
David Goldman
1c819820fa Comment and sourcekitd-test fixes 2019-05-21 10:40:22 -04:00
Xi Ge
1ca8e83aa3 Sourcekit/DocSupport: fix an assertion when generating documentation for extensions with attributes
When sanitizing the documentation comments for synthesized extensions,
we expect some text like "<declaration>extension". This isn't the case
when use-facing attributes are present.

rdar://50913510
2019-05-20 17:43:29 -07:00
Brent Royal-Gordon
82928fd821 Merge pull request #24464 from brentdax/charmed-interpolations
[Parse][Sema] Improve interpolation parsing and construction
2019-05-14 17:49:46 -07:00
Rintaro Ishizaki
663defab4a [SourceKit] Add InterfaceGen test case for pure Swift system module
rdar://problem/50458412
(Reapply - Forgot to add `-target` in SourceKit test in previous change.)
2019-05-13 10:55:23 -07:00
Ted Kremenek
4beb673b8e Bump compiler version to Swift 5.1 (#24671)
* Bump version to Swift 5.1

* Update tests with compiler version bump

* Undo flatMap and math obsolescences
2019-05-13 07:32:39 -07:00
Rintaro Ishizaki
4cb7d27eba Revert "[SourceKit] Add InterfaceGen test case for pure Swift system module" 2019-05-10 18:35:34 -07:00
Rintaro Ishizaki
6c8641b9b1 [SourceKit] Add InterfaceGen test case for pure Swift system module
rdar://problem/50458412
2019-05-10 10:12:24 -07:00
Brent Royal-Gordon
a4e5bcea6a Move strange interpolation fix to PreCheckExpression
This defers diagnosis until a stage where #if conditions have definitely been evaluated, at the cost of a slightly more complex implementation. We’ll gain some of that complexity back in a subsequent refactoring. Fixes SR-9937.
2019-05-09 15:29:21 -07:00
Rintaro Ishizaki
d3d30ee246 [Serialization] Support Swift only system module
Previously 'isSystemModule()' returns true only if the module is:
- Standard library
- Clang module and that is `IsSystem`
- Swift overlay for clang `IsSystem` module

Now:
- Clang module and that is `IsSystem`; or
- Swift overlay for clang `IsSystem` module
- Swift module found in either of these directories:
  - Runtime library directoris (including stdlib)
  - Frameworks in `-Fsystem` directories
  - Frameworks in `$SDKROOT/System/Library/Frameworks/` (Darwin)
  - Frameworks in `$SDKROOT/Library/Frameworks/` (Darwin)

rdar://problem/50516314
2019-05-08 17:03:06 -07:00