Commit Graph

2143 Commits

Author SHA1 Message Date
Allan Shortlidge
af84818e5c IDETool: Register SourceFile for replaced function body.
This prevents a nullptr dereference in `ASTScope::unqualifiedLookup()` after
querying for the `SourceFile` containing a give source location.

Fixes rdar://137652856 and https://github.com/swiftlang/swift/issues/76944.
2024-10-10 17:24:17 -07:00
swift-ci
b8a5d2d6d7 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-03 01:35:42 -07:00
Konrad `ktoso` Malawski
45b97f146b Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-30 13:47:39 +09:00
swift-ci
415b83acd6 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-24 05:54:22 -07:00
Hamish Knight
0869a3abd9 [test] Add -no-emit-module-separately to a couple of tests
A couple of tests are expecting merge-modules behaviour,
add `-no-emit-module-separately` in those cases to
ensure that merge modules is used in both the old
and new driver.
2024-09-22 21:15:45 +01:00
Konrad `ktoso` Malawski
d89347bed0 Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-20 18:34:45 +09:00
swift-ci
ed74391004 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-18 12:41:02 -07:00
Alex Hoppen
6ab4f36986 Merge pull request #76441 from vincentisambart/macro-decl-format
[SourceKit] Format macro decl without crashing
2024-09-18 12:25:09 -07:00
Vincent Isambart
93c06738d3 Check that formatting is as expected 2024-09-18 13:16:31 +09:00
swift-ci
6060b71e0e Merge remote-tracking branch 'origin/main' into rebranch 2024-09-17 16:54:22 -07:00
Konrad `ktoso` Malawski
7d1ce789ad Revert "Revert "Isolated synchronous deinit"" 2024-09-17 17:35:38 +09:00
Alex Hoppen
7691569344 [SourceKit] Update completion cancellation test to a harder type checking example
https://github.com/swiftlang/swift/pull/63585 will resolve rdar://80582770 and the type checker performance problem that we were relying on. Use a harder example (stolen from https://github.com/swiftlang/swift/blob/main/unittests/SourceKit/SwiftLang/CloseTest.cpp#L131-L151), that’s unlikely to get a significant performance improvement soon.
2024-09-16 14:48:18 -07:00
Ben Barham
a7b50f357f Merge remote-tracking branch 'origin/main' into manual-main-merge
Conflicts:
  - `lib/Driver/ToolChains.cpp` conflicting with the `addAllArgs` rename
    for multiple options
2024-09-16 13:53:18 -07:00
Vincent Isambart
a48ff77a75 Format macro decl without crashing 2024-09-13 14:38:19 +09:00
Doug Gregor
8b91a922cb Only consider the active clauses of IfConfigDecls in placeholder expansion
This is another step toward the removal of IfConfigDecl
2024-09-07 23:31:13 -07:00
Doug Gregor
8ec800d35e Remove bespoke handling of IfConfigDecl within code formatting
The SourceKit code formatting tools have effectively been replaced
by swift-syntax's basic formatting functionality and more full-featured
formatters like swift-format and SwiftFormat. Remove the special
handling of IfConfigDecl as staging for the removal of IfConfigDecl.
2024-09-07 21:48:18 -07:00
Doug Gregor
9936f64c2a Ignore inactive IfConfigDecls in SourceKit's syntax model
Clients that need syntactic information should use SourceKit-LSP or
swift-syntax.
2024-09-07 21:36:39 -07:00
swift-ci
756fe355fa Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 22:34:34 -07:00
Alex Hoppen
c5aa49ba64 Revert "Isolated synchronous deinit" 2024-09-03 18:11:26 -07:00
swift-ci
dd7533d4e7 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 09:33:55 -07:00
Mykola Pokhylets
6d265145d7 Fixed test/SourceKit/InterfaceGen/gen_swift_module.swift 2024-09-02 20:21:32 +02:00
Konrad `ktoso` Malawski
c55ad6fa88 Merge branch 'main' into mpokhylets/isolated-deinit 2024-09-02 23:16:17 +09:00
swift-ci
763c61f92f Merge remote-tracking branch 'origin/main' into rebranch 2024-08-30 18:13:35 -07:00
Jim M. R. Teichgräber
f2e57d8c76 [SourceKit] Add optional declarations array to interface gen request (#75802)
Introduces the new DeclarationsArrayBuilder and adds it to the
EditorConsumer. Declaration info always includes a kind, offset, and
length, and includes a USR where applicable.
As the USR is already available for editor.open.interface type requests,
this doesn't compute any new information, it just exposes more of what's
there already.
2024-08-30 18:04:12 -07:00
swift-ci
1c7d7d56c9 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-29 20:14:36 -07:00
Doug Gregor
6a310074c4 Ensure that the source buffer passed to #if evaluation contains the condition
The implementation of `#if` configuration evaluation assumed that the
SourceFile instance within the `Parser` contained all of the source ranges
for code parsed within that `Parser` instance. This is not always the case,
so avoid using the SourceFile directly and instead use the source buffer
that directly contains the condition.

Fixes https://github.com/swiftlang/swift/issues/76137. Big thank you
to Alex Hoppen and the stress tester for finding this.
2024-08-29 14:31:48 -07:00
Mykola Pokhylets
e0ad7bde82 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/AST/ASTPrinter.cpp
#	lib/AST/FeatureSet.cpp
2024-08-29 11:28:43 +02:00
swift-ci
bf588f0b48 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 23:14:01 -07:00
Mishal Shah
3ac0dff27d Bump the Swift version to 6.1 2024-08-19 23:09:31 -07:00
swift-ci
c19582ba53 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-16 21:34:46 -07:00
Alex Hoppen
d47c50e1a7 Merge pull request #75741 from ahoppen/indent-no-format
[Macros] Test adjustment because we no longer trim whitespace from macro expansions
2024-08-16 21:26:50 -07:00
Alex Hoppen
21070b5770 Merge pull request #75888 from ahoppen/enable-test
[SourceKit] Enable `Misc/embedded_no_wmo.swift`
2024-08-16 21:25:39 -07:00
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
Alex Hoppen
bc9f3f33a5 [SourceKit] Enable Misc/embedded_no_wmo.swift 2024-08-14 11:21:37 -07:00
Becca Royal-Gordon
58ba7046c0 Merge pull request #75849 from beccadax/rebranch-modulemap
Rename module.map -> module.modulemap in tests
2024-08-13 02:17:36 -07:00
Becca Royal-Gordon
fd84e7273d Rename module.map -> module.modulemap in tests
The legacy `module.map` spelling of module map files was deprecated by llvm/llvm-project#75142 and clang expects to remove support for them in the future. Switch all tests to use the supported spelling.

Fixes rdar://128431478.
2024-08-12 17:47:26 -07:00
Kuba Mracek
30d1fe6f88 [embedded] Explicitly pass a -target in SourceKit/Diagnostics/embedded_non_wmo.swift 2024-08-12 17:43:11 -07:00
Kuba Mracek
3ad777b942 [embedded] Don't produce PerfDiags when in non-WMO mode (e.g. when building during indexing) 2024-08-10 14:48:24 -07:00
Alex Hoppen
8edb57c756 Merge pull request #75667 from ahoppen/build-issues-live-issues
[Sema/SourceKit] Emit same diagnostics for missing protocol requirements on the command line and in SourceKit
2024-08-07 17:24:47 -07:00
Alex Hoppen
66104395d7 [Sema/SourceKit] Emit same diagnostics for missing protocol requirements on the command line and in SourceKit
Some editors use diagnostics from SourceKit to replace build issues. This causes issues if the diagnostics from SourceKit are formatted differently than the build issues. Make sure they are rendered the same way, removing most uses of `DiagnosticsEditorMode`.

To do so, always emit the `add stubs for conformance` note (which previously was only emitted in editor mode) and remove all `; add <something>` suffixes from notes that state which requirements are missing.

rdar://129283608
2024-08-07 14:01:30 -07:00
Alex Hoppen
000298cbc7 [Macros] Test adjustment because we no longer trim whitespace from macro expansions
Companion of https://github.com/swiftlang/swift-syntax/pull/2776
2024-08-07 09:14:49 -07:00
Alex Hoppen
eec3d752cb Inherit doc comments from default implementations of inherited protocols
For example when we have

```swift
protocol BaseProtocol {}

extension BaseProtocol {
  /// Say hello
  func hello() { }
}
struct MyStruct: BaseProtocol {
  func hello() {}
}
```

Then `MyStruct.hello` should inherit the doc comment from the implementation of `BaseProtocol.hello`. Currently no doc comment is associated with `MyStruct.hello`.

rdar://126240546
2024-08-02 11:26:51 -07:00
Alex Hoppen
c5e201dd07 Merge pull request #75490 from ahoppen/swiftparser-on-deep-stack
[SourceKit] Run SwiftParser on a deep stack for the related identifiers request
2024-07-29 15:52:43 -07:00
Alex Hoppen
3bffa7970d [SourceKit] Run SwiftParser on a deep stack for the related identifiers request
We ran SwiftParser in `handlePrimaryAST` for related identifiers. That function is called on a dispatch queue with reduced stack size and could cause the parser to stack overflow if the program is very nested.

Run `handlePrimaryAST` on a deep stack for this request to fix the issue.

rdar://129960285
2024-07-25 16:57:08 -07:00
Allan Shortlidge
ecc1a2de2c Tests: Drop maccatalyst_support requirement for several tests.
As much as possible, we should avoid using `REQUIRES: maccatalyst_support`
since tests restricted this way are not run in PR tests. Many tests that
exercise macCatalyst behaviors can be run in a macOS configuration, without
full macCatalyst standard library support.

Also, adopt `%target-cpu` lit substitution where appropriate to avoid needless
standard library module rebuilds when running tests locally.
2024-07-19 17:02:28 -07:00
Alex Hoppen
8d236de2c2 Merge pull request #75027 from Sajjon/cyon_typo_batch__test__SourceKit
Typos: `test/SourceKit`
2024-07-18 13:42:33 -07:00
Alexander Cyon
64466cd8b8 Update error_swift_module.swift
Co-authored-by: Alex Hoppen <alex@alexhoppen.de>
2024-07-18 08:11:33 +02:00
Mykola Pokhylets
816d62c972 Merge remote-tracking branch 'upstream/main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/SILGen/SILGenDestructor.cpp
#	test/Concurrency/flow_isolation.swift
#	test/abi/macOS/arm64/concurrency.swift
#	test/abi/macOS/x86_64/concurrency.swift
2024-07-11 13:11:59 +02:00
Mykola Pokhylets
9dcea15d21 Fixed tests on Linux, Windows and older MacOS versions 2024-07-11 13:09:07 +02:00
Mykola Pokhylets
62dbc6c966 Fixed some tests. Using extract_executor SIL instruction instead of custom code. 2024-07-11 13:09:06 +02:00