Commit Graph

2145 Commits

Author SHA1 Message Date
Kavon Farvardin
eecaa44cdd disable SourceKit/Sema/sema_build_session.swift to unblock CI 2021-08-25 17:04:28 -07:00
Ben Barham
3b99e9079b Merge pull request #38920 from apple/show-cursor-refactorings
[Refactorings] Add cursor refactorings for the start of the range
2021-08-21 07:35:51 +10:00
Egor Zhdan
3464cb189d Merge pull request #38882 from egorzhdan/astprinter-protocols
ASTPrinter: print public inherited protocols of the skipped private protocols
2021-08-20 23:44:15 +03:00
Ben Barham
c7620fa979 [Refactorings] Add cursor refactorings for the start of the range
When a range is a single expression/statement/decl or part of
expression, also return cursor based refactorings for the start of the
range.

This is a stop gap until the available refactorings are properly fixed
to be more lenient in general - the current fix is a little odd as eg.
if all of `foo.bar()` is selected, rename will be returned as an
available refactoring for `foo`. Still an improvement over completely
missing cursor based refactorings, however.

Resolves rdar://82060063
2021-08-18 14:04:10 +10:00
Egor Zhdan
b2198e2c99 ASTPrinter: print public inherited protocols of the skipped private protocols
When printing the list of inherited protocols in the module interface, if private stdlib protocols are requested to be hidden, make sure to print public inherited protocols of the hidden protocols.
2021-08-14 14:10:25 +03:00
Ben Barham
f6899eda96 [SourceKit] Suppress oslog_invalid_log_message diagnostic in live issues
The index build skips *all* function bodies, including inlinable. The
`OSLogOptimization` pass expects SIL for inlinable bodies and thus
outputs a spurious diagnostic for live issues when the
`OSLogInterpolation` extension is in a separate module to the log
statement.

Ignore this for now, but we may need to re-evaluate if this becomes a
more widespread problem.

Resolves rdar://79100763
2021-08-06 16:49:43 +10:00
Doug Gregor
f9c34756ef Parameterize conformance lookup on whether "missing" conformances are allowed.
Many clients of the conformance lookup operations would prefer to get
an invalid conformance (== there is no conformance) rather than a
missing conformance. Parameterize the conformance lookup operations so
that most callers won't see missing conformances, by filtering them
out at the end. Opt-in those callers that do want to see missing
conformances so they can be diagnosed.
2021-08-03 00:10:45 -07:00
Rintaro Ishizaki
d747ee97c1 Merge pull request #38521 from rintaro/astprinter-introducerkeyword
[ASTPrinter] Intorduce 'IntroducerKeyword' name kind
2021-07-30 14:57:41 -07:00
Rintaro Ishizaki
6e69a44c3d [ASTPrinter] Intorduce 'IntroducerKeyword' name kind
For more fine grained annoations. For now, it's handled as the same as
'Keyword' name kind.

Fix an issue where 'extension' wasn't marked as "keyword".

Also, move 'static' priting out of 'SkipIntroducerKeywords' guard
because 'static' is not an declaration introducer.
2021-07-29 12:50:24 -07:00
Ben Barham
e7e9b57051 Replace @completionHandlerAsync with @available(*, renamed:)
Instead of a new attribute `@completionHandlerAsync`, allow the use of
the existing `renamed` parameter of `@available` to specify the
asynchronous alternative of a synchronous function.

No errors will be output from invalid names as `@completionHandlerAsync`
had, but if a function is correctly matched then it will be used to
output warnings when using the synchronous function in an asynchronous
context (as before).

Resolves rdar://80612731
2021-07-29 09:14:44 +10:00
Hamish Knight
470cb261ef [SyntaxModel] Correctly annotate unlabelled unary args
Previously we would only handle TupleExpr argument
list exprs. Update the logic to handle ParenExpr
argument lists too.

rdar://81154978
2021-07-27 11:38:07 +01:00
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