Commit Graph

6605 Commits

Author SHA1 Message Date
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
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
swift-ci
685f31b87a Merge remote-tracking branch 'origin/main' into rebranch 2021-08-17 03:54:04 -07:00
Hamish Knight
1d2d15a52c Merge pull request #38857 from hamishknight/third-times-a-charm
[test] Re-enable convert_bool.swift
2021-08-17 11:33:32 +01:00
swift-ci
e0484efde8 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-16 18:13:23 -07:00
Konrad `ktoso` Malawski
fbd66e2b87 [Distributed] Only parse distributed when experimentla mode enabled 2021-08-16 18:11:06 +09:00
Hamish Knight
95ba42387c [test] Re-enable convert_bool.swift
`%build-clang-importer-objc-overlays` builds the
overlays for the current target rather than the
host, so update the `%refactor` invocations to
take the target as an argument.

rdar://81128571
2021-08-12 14:57:22 +01:00
swift-ci
d21e7e0aba Merge remote-tracking branch 'origin/main' into rebranch 2021-08-11 13:32:56 -07:00
Rintaro Ishizaki
ed1db1bed2 [CodeCompletion] Explain why results aren't recommended
* Implement 'getDiagnosticSeverity()' and 'getDiagnosticMessage()' on
  'CodeCompletionResult'
* Differentiate 'RedundantImportIndirect' from 'RedundantImport'
* Make non-Sendable check respects '-warn-concurrency'

rdar://76129658
2021-08-10 17:11:14 -07:00
Rintaro Ishizaki
f8751d466e [CodeCompletion] Provide known module source file information
* 'CodeCompletionContext' now has 'requiresSourceFileInfo()' flag
* When 'true', 'SourceFiles' is populated.
* 'SourceFiles' is a list of pairs of a known module source
  file path and its up-to-date-ness
* Clients (i.e. 'CodeCompletionConsumer') can retrieve it from
  'CodeCompletionContext' in 'handleResults'
* Each completion item now has 'SourceFilePath' property
* C-APIs to get those informations
2021-08-10 17:11:14 -07:00
Ben Langmuir
d6eec880cb [completion] Update CodeCompletionConsumer::handleResults()
Receive 'CodeCompletionContext' so that consumers can get more
information from it.
2021-08-10 14:14:15 -07:00
swift-ci
9de5554745 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-10 09:33:25 -07:00
Alex Hoppen
5b738fab0e Merge pull request #38749 from ahoppen/pr/sourcekitd-test-instruction-counter
[sourcekitd-test] Add option to count number of instructions taken to execute request
2021-08-10 17:55:59 +02:00
swift-ci
1123f03d46 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-09 14:33:42 -07:00
willtunnels
d2138d089e Rename --enable-experimental-opaque-return-types and gate structural … (#38780)
* Rename --enable-experimental-opaque-return-types and gate structural opaque types with a flag

* Separate out structural opaque type result builder tests
2021-08-09 17:27:59 -04:00
swift-ci
ca8a8bd825 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-09 05:13:32 -07:00
Max Desiatov
69bdaad019 tools: disable ObjC for wasm in SILFunctionExtractor (#31920)
Currently, `clang` doesn't support Objective-C with the WebAssembly object format. Because of this, `sil-function-extractor` tool crashes in [Clang's `CGObjCCommonMac::GetSectionName` function](c3e5ae3fde/clang/lib/CodeGen/CGObjCMac.cpp (L5065-L5084)). Since Swift doesn't provide Objective-C interop for WebAssembly, it would make sense to disable it explicitly. `sil-function-extractor` is used in the test suite, so this PR is required for those tests to proceed when testing the WebAssembly toolchain and SDK.

Related to SR-9307.

Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2021-08-09 12:57:36 +01:00
swift-ci
8e11ea0ae8 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-06 16:13:41 -07: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
Arnold Schwaighofer
c288cbb6ab Fix some more SmallVector usage without an on stack size 2021-08-05 12:15:23 -07:00
Arnold Schwaighofer
b5a5d38756 Adjust to LLVM's llvm_execute_on_thread removal 2021-08-05 12:15:23 -07:00
Arnold Schwaighofer
5a83172a55 Merge remote-tracking branch 'upstream/main' into rebranch 2021-08-05 12:04:56 -07:00
Alex Hoppen
85869bb8b7 [sourcekitd-test] Add option to count number of instructions taken to execute request
This adds a `-measure-instructions` option to `sourcekitd-test` which measures the number of instructions the SourceKit process took to execute the request.
2021-08-04 16:19:24 +02:00
Slava Pestov
d5e5253cee Merge pull request #38711 from slavapestov/no-requirement-machine-for-autodiff
AutoDiff: Disable requirement machine when building or testing Differentiation library
2021-07-31 00:05:33 -04:00
Slava Pestov
28b450dd95 sil-opt: Add -requirement-machine {off,on,verify} flag to match frontend 2021-07-30 19:41:28 -04: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
swift-ci
f892076f11 Merge remote-tracking branch 'origin/main' into rebranch 2021-07-28 16:13:36 -07:00
Ben Barham
3b51e86796 [Refactoring] Disable availability checking to reduce errors 2021-07-28 13:39:46 +10:00
swift-ci
fd87ebc401 Merge remote-tracking branch 'origin/main' into rebranch 2021-07-23 07:13:34 -07:00
Robert Widmann
d86551de67 Lift Requirement and Parameter Accessors up to GenericSignature
Start treating the null {Can}GenericSignature as a regular signature
with no requirements and no parameters. This not only makes for a much
safer abstraction, but allows us to simplify a lot of the clients of
GenericSignature that would previously have to check for null before
using the abstraction.
2021-07-22 23:27:05 -07:00
swift-ci
cdf7a9314f Merge remote-tracking branch 'origin/main' into rebranch 2021-07-22 21:54:12 -07:00
Rintaro Ishizaki
7a3f7c6aff [CodeCompletion] Add '-warn-concurrency' to swift-ide-test 2021-07-22 14:33:45 -07:00
swift-ci
94817d06b4 Merge remote-tracking branch 'origin/main' into rebranch 2021-07-20 09:13:59 -07:00
Rintaro Ishizaki
5559d9406f [CodeCompletion] NFC: rename CallParameter* to CallArgument*
Since these chunks are for call sites, the correct term is "argument".
2021-07-19 16:30:12 -07:00
swift-ci
f9e8208cb3 Merge remote-tracking branch 'origin/main' into rebranch 2021-07-16 16:14:43 -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
swift-ci
797c3918e7 Merge remote-tracking branch 'origin/main' into rebranch 2021-07-14 12:53:29 -07:00
Xi Ge
d22b348adb cmake: add a workaround to rdar://77839981 2021-07-14 10:02:27 -07:00
Xi Ge
e12148ae13 libSwiftScanner: add an API to invoke compiler in process 2021-07-13 14:56:19 -07:00
swift-ci
97cfa6b6f8 Merge remote-tracking branch 'origin/main' into rebranch 2021-07-13 13:52:43 -07:00
Xi Ge
504cfb9573 link libswift later 2021-07-13 11:00:15 -07:00
Xi Ge
515cf21ba3 driver: refactor driver tool logics into a library. NFC 2021-07-13 10:03:12 -07:00
Evan Wilde
c75d19845f Merge pull request #38326 from etcwilde/ewilde/swift-rebranch
[Swift Rebranch] Cherry-picking swift changes from next branch
2021-07-12 13:24:29 -07:00
swift-ci
a3ebc9a069 Merge remote-tracking branch 'origin/main' into rebranch 2021-07-12 10:51:07 -07:00
Doug Gregor
06bbc70b3e Module printing and serialization support for @unchecked Sendable 2021-07-11 12:29:54 -07:00
Evan Wilde
b1ea839b1d Merge branches 'ewilde/rebranch/printHelp', 'ewilde/rebranch/vkrvalue', 'ewilde/rebranch/datalayout', 'ewilde/rebranch/withNullAsEmpty', 'ewilde/rebranch/format', 'ewilde/rebranch/collectUsedGlobals' and 'ewilde/rebranch/SILSerialization' into ewilde/swift-rebranch 2021-07-08 17:48:06 -07:00
Evan Wilde
29509d16ed Add Format.h to swift-syntax-parser-test
Something happened so that's not being transitively included. Adding it
in explicitly.
2021-07-08 17:07:57 -07:00
Evan Wilde
685ebd4660 Fix PrintName calls
OptTable::PrintName was renamed 'printName' in commit f1e2d5851bf86.
2021-07-08 16:42:34 -07:00
swift-ci
8eed427d64 Merge remote-tracking branch 'origin/main' into rebranch 2021-07-07 06:34:04 -07:00