Commit Graph

1784 Commits

Author SHA1 Message Date
Doug Gregor
eeeea49764 Remove -enable-experimental-concurrency almost everywhere. 2021-07-26 21:24:43 -07:00
Doug Gregor
b2dee32b00 Enable async let without the experimental flag 2021-07-26 16:14:34 -07:00
Ben Barham
fabb02100f [Test] Add @escaping to async refactoring tests
The async refactorings ignore whether a completion handler had
`@escaping` or not. In preparation of fixing this, fix up all functions
to have `@escaping` for their completion handler parameter.

Also some small miscellaneous fixes in order to reduce the number of
warnings output on test failures and also the addition of `REQUIRES:
concurrency` on all tests.
2021-07-24 09:53:17 +10:00
Ted Kremenek
13f04295c9 Update Swift version to 5.6 (#38574)
* Update Swift version to 5.6

* Add Swift 5.6 to changelog
2021-07-22 19:35:58 -07:00
Doug Gregor
1e2012d816 Disable availability checking in tests that use concurrency 2021-07-20 12:46:26 -07:00
Rintaro Ishizaki
90b3f6ec57 [CodeCompletion] Fix a test case after CodeComletionString::getName() obsoletion
Since 7c24d19, sorted result from SourceKit for 'foo(a: Int)' and
'foo(a: String)' is non-deterministic. Update the test case.

rdar://80729544
2021-07-19 14:10:22 -07:00
David Ungar
9e7eb2fb7d Disable failing test. 2021-07-17 10:30:28 -07:00
Rintaro Ishizaki
7c24d19df2 Merge pull request #38446 from rintaro/ide-completion-getname-remove 2021-07-16 17:47:27 -07:00
Rintaro Ishizaki
18dc9c1c27 [CodeCompletion] Remove CodeComletionString::getName()
`CodeCompletioString::getName()` was used only as the sorting keys in
`CodeCompletionContext::sortCompletionResults()` which is effectively
deprecated. There's no reason to check them in `swift-ide-test`. Instead,
check `printCodeCompletionResultFilterName()` that is actually used for
filtering.
2021-07-16 13:24:19 -07:00
Ben Barham
f9b3e40595 [SourceKit/DocInfo] Add is_async for properties with async getters
Resolves rdar://80546521
2021-07-16 13:35:50 +10:00
Alex Hoppen
92b7e135b8 Merge pull request #38084 from fwcd/fix-sourcekit-var-types-if-let
[SourceKit] Determine correctly whether typed  variables in `if/guard/while-let`-statements have explicit type annotations
2021-07-02 12:02:32 +02:00
Alex Hoppen
3ea37693a5 Merge pull request #38085 from fwcd/fix-wildcard-name-range
[IDE] Fix name range of wildcard declarations
2021-06-29 15:03:27 +02:00
Fredrik Wieczerkowski
8a79268202 Add VariableType test for unnamed variables 2021-06-25 13:19:35 +02:00
Ben Barham
eaf604f4e8 Merge pull request #37946 from bnbarham/importer-use-working-dir
[ClangImporter] Respect -working-directory in the created VFS
2021-06-25 09:01:13 +10:00
Fredrik Wieczerkowski
88dd082260 Add VariableType test case for backticked names 2021-06-24 23:03:28 +02:00
Fredrik Wieczerkowski
748f60d0f4 Add wildcard parameter case to VariableType test 2021-06-24 21:59:37 +02:00
Fredrik Wieczerkowski
1b74379b1a Add VariableType test cases for if/guard/while-let
- Add VariableType test case for guarded variables
- Add if-let to VariableType test case
- Add while-let test case for VariableType
- Test pattern matching with VariableType
- Test guard/while-case-let with VariableType
2021-06-24 21:07:13 +02:00
Alex Hoppen
ba910cc786 Merge pull request #37867 from fwcd/sourcekit-var-types
[SourceKit] Add `CollectVariableType` request
2021-06-24 08:50:45 +02:00
Ben Barham
28bb2505b0 [ClangImporter] Respect -working-directory in the created VFS
Pass a wrapped VFS down into `clang::createInvocationFromCommandLine` so
that the working directory is set and then used in the underlying Clang
`CompilerInstance`.

Fixes the possibility of differing modules hashes when the same
arguments are used in Clang directly vs from the importer.

Resolves rdar://79376364
2021-06-24 11:07:40 +10:00
Fredrik Wieczerkowski
1a844efe5e Ignore error types in VariableTypeCollector
Also add a test to verify that error types get ignored (as intended).
2021-06-22 15:02:43 +02:00
Mishal Shah
10e93d62e4 Merge pull request #37979 from rintaro/disable-rdar79416986
[SourceKit][Tests] Disable a test case while investigating
2021-06-21 10:51:37 -07:00
Fredrik Wieczerkowski
ebe1b91663 Add tests for CollectVariableType request
- Add CollectVariableType test for function/closure parameters
- Test ranged CollectVariableType request
- Add separate test for ranged CollectVariableType
- Use line:col positions in sourcekitd-test for var types
- Add test case for CollectVariableType and inout params
- Update ranged CollectVariableType test
  ...as per the PR suggestions.
- Fix style issue
2021-06-21 19:33:43 +02:00
Rintaro Ishizaki
c48dc6d9c8 [SourceKit][Tests] Disable a test case while investigating
This test fails in Apple Silicon bot. Disable it while investigating.

rdar://79416986
2021-06-17 14:00:17 -07:00
Varun Gandhi
02afb9d49b [ModuleInterface] Print full type if ambiguous for extensions.
The patch introduces a new setting instead of changing existing settings
because the generated interfaces in the IDE have slightly different
requirements; the extended type there is unconditionally not printed
qualified (even if it is ambiguous). This is likely because the
ambiguity heuristic is very weak; it doesn't even do name lookup.
Simplifying that logic would be nice, but then we'd need to update
a bunch of IDE/print* tests and end up with more more visual clutter
in the IDE.

Introducing the new setting means we can change the behavior for
swiftinterface files without affecting the behavior for IDE interfaces.

Fixes rdar://79093752.
2021-06-11 20:04:43 -07:00
Alex Hoppen
2826871ceb Merge pull request #37827 from ahoppen/pr/offset-refactoring-sourcekitd-test
[sourcekitd-test] Support refactoring based on a byte offset location
2021-06-11 10:12:21 +02:00
Mishal Shah
5a7b8c7922 Merge pull request #37823 from apple/xcode-13-beta-main
[main] Support Xcode 13 beta
2021-06-10 09:21:09 -07:00
Alex Hoppen
80bfcf5dad [sourcekitd-test] Support refactoring based on a byte offset location
If an offset position but no line/column combination is given to `sourcekitd-test` when requesting a refactoring action, compute the line/column from the offset.
2021-06-10 16:54:04 +02:00
Rintaro Ishizaki
e3ba60995c Merge pull request #37834 from rintaro/ide-completion-protocol-at-expr-rdar77934897
[CodeCompletion] Add flairs to cached items
2021-06-09 21:20:57 -07:00
Rintaro Ishizaki
1855e1a143 [CodeCompletion] Add flairs to cached items
* Starting a statement with a protocol name is rare
* Starting a statemnet at top-level of non-script file is invalid

rdar://77934897
2021-06-08 14:09:39 -07:00
Doug Gregor
5004a5447b [Concurrency] Make "self" parameter of actor-isolated functions 'isolated'.
The notion of "actor-isolated" currently exists at the declaration level.
For functions, it is going to be captured in the function type itself,
where 'self' is declared to be 'isolated'. Model isolation both
ways: the 'self' of a method that is isolated to an actor instance
will be 'isolated' as well.

We are still using declaration-based checking of actor isolation.
However, by mirroring this information we can move more incrementally
over to doing checking based on 'isolated' parameters.
2021-06-07 23:59:38 -07:00
Mishal Shah
23c3b15f5f Support Xcode 13 beta
* Updating availability versions
* Remove all remaining overlays in stdlib/public/Darwin/*:
   - ObjectiveC
   - Dispatch
   - CoreFoundation
   - CoreGraphics
   - Foundation
2021-06-07 12:04:31 -07:00
Ben Barham
a3e4f1ac2c Merge pull request #37472 from bnbarham/cleanup-allow-errors
[Serialization] Add whether allowing errors to the pretty stack output
2021-05-26 11:07:47 +10:00
Alex Hoppen
80d3dedb08 Merge pull request #37450 from ahoppen/pr/count-instructions-for-completion-request
[SourceKit] Report number of instructions executed since SourceKit was started in statistics request
2021-05-25 08:39:43 +02:00
swift-ci
2f5cb80c60 Merge pull request #36865 from beccadax/remarkable-notes 2021-05-22 15:22:38 -07:00
Rintaro Ishizaki
3cbc6e7c18 Merge pull request #37591 from rintaro/ide-completion-cache-rdar78315441
[CodeCompletion] Don't check 'InvalidAsyncContext' for imported globals
2021-05-21 23:21:23 -07:00
Ben Barham
b9a97586c3 [Serialization] Cleanup allow module with errors references 2021-05-22 13:12:46 +10:00
Doug Gregor
9896589022 Merge pull request #37590 from DougGregor/se-0313-enable-nonisolated 2021-05-21 19:10:59 -07:00
Becca Royal-Gordon
769ea4aa78 Share diagnoseAndRemoveAttr()
Merge together several helpers and code patterns for “diagnose/fix-it/invalidate bad attribute” into helper functions in TypeChecker.h.

This requires minor test changes in some places where we’re testing ObjC interop without importing Foundation; it’s otherwise NFC.
2021-05-21 16:10:11 -07:00
Doug Gregor
3fe712dfda [SE-0313] Enable nonisolated by default. 2021-05-21 15:17:43 -07:00
Rintaro Ishizaki
0ce1faa6c7 [CodeCompletion] Don't check 'InvalidAsyncContext' for imported globals
'InvalidAsyncContext' depends on the decl context. That may case
"sticky" not-recommended If it's cached for a non-async context.

To workaround this, stop checking 'InvalidAsyncContext' when collecting
completion items for caching. Also consistently use the 'SourceFile' as
the decl context to avoid decl context specific behavior.

rdar://78315441
2021-05-21 15:16:36 -07:00
Rintaro Ishizaki
4bf9682085 [SourceKit] Avoid unnecessary parsing in 'open' request
If the client doesn't want anything as the response of editor.open,
avoid parsing the source because it's not necessary.

rdar://77693214
2021-05-21 12:16:34 -07:00
Argyrios Kyrtzidis
53264a64d9 Merge pull request #37547 from bnbarham/line-col-crash
[SourceKit] Map line and column using the latest snapshot
2021-05-21 08:53:06 -07:00
Hamish Knight
6f6691be71 Merge pull request #37534 from hamishknight/one-more-for-luck 2021-05-21 14:22:25 +01:00
Alex Hoppen
285cea4670 Merge pull request #37512 from ahoppen/pr/allow-driver-errors
[SourceKit] Recover if compiler arguments have errors
2021-05-21 09:17:01 +02:00
Alex Hoppen
f03ef8fd1d Merge pull request #37452 from ahoppen/pr/refactoring-in-sourcekitd
[SourceKit] Expose all refactoring actions as requests in `sourcekitd-test`
2021-05-21 09:16:10 +02:00
Ben Barham
0f21991f02 [SourceKit] Map line and column using the latest snapshot
During a cursor info request, the resolved offset was mapped to line and
column using the buffer inside `SwiftDocumentSyntaxInfo`.

However, prior to 54683ca607,
`editorReplaceText` was not updating the syntax info. This meant that
snapshots would be more up to date than the buffer in the syntax info,
allowing for the possibility of an invalid offset.

While 54683ca607 would also fix this,
snapshots actually have a `getLineAndColumn` anyway. Use that instead of
grabbing the buffer from syntax info.

Resolves rdar://78161348.
2021-05-21 15:42:33 +10:00
Pavel Yaskevich
ce63aa6e5b Merge pull request #37516 from xedin/rdar-75753598
[Parse] Disallow use of `actor` as a declaration modifier
2021-05-20 18:02:39 -07:00
Hamish Knight
c19359af57 [test] Add additional test case for rdar://76685011
Make sure we don't print the @completionHandlerAsync
attr in the doc info.
2021-05-20 16:35:43 +01:00
Alex Hoppen
e8b5bcac1d [SourceKit] Report number of instructions executed since SourceKit was started in statistics request
This can be used to measure how many instructions a request executes by retrieving the number of instructions executed since the process’s start before and after executing the request.
2021-05-20 16:30:28 +02:00
Pavel Yaskevich
aeddab4dd0 [Parse] Disallow use of actor as a declaration modifier
`actor` is a standalone contextual keyword now and should
be treated as such, `actor class` is no longer allowed
and results in a parse error.

Resolves: rdar://75753598
2021-05-19 16:18:32 -07:00