Commit Graph

4066 Commits

Author SHA1 Message Date
Anthony Latsis
bda6edb85c AST: Rename GenericContext::isGeneric to hasGenericParamList
`isGeneric` is a misleading name because this method checks for the
existence of a `GenericParamList`, which is not implied by genericity.
2025-11-11 15:55:16 +00:00
Allan Shortlidge
9b7c531fd8 AST/IDE/Sema: Remove unnecessary AvailabilityInference.h includes.
NFC.
2025-10-24 16:14:49 -07:00
Hamish Knight
364eba482d [AST] Use CustomAttr's DeclContext for ResolveMacroRequest
Remove the DeclContext parameter from ResolveMacroRequest, we can now
retrieve the DeclContext either from the CustomAttr or macro expansion
expr/decl directly.
2025-10-16 11:21:54 +01:00
Becca Royal-Gordon
60b3b088d5 Merge pull request #84358 from beccadax/common-concurrency 2025-10-07 12:21:50 -07:00
Hamish Knight
5171b84dba [CS] Replace UnresolvedType with ErrorType in simplifyType/resolveType
This means we now either produce a bare ErrorType, or an ErrorType
with a generic parameter original type for a generic parameter hole.
We ought to further consolidate this logic by sinking the generic
parameter original type replacement into `simplifyType` itself, but
I'm leaving that for a future patch since it affects completion
results and I want to try keep this close to NFC.
2025-10-03 09:50:42 +01:00
Becca Royal-Gordon
3abbfaa9cb Introduce separately-imported stdlib overlays
The `_Concurrency` and `_StringProcessing` modules are implementation details of the standard library; to developers, their contents should behave as though they are declared directly within module `Swift`. This is the exact same behavior we expect of cross-import overlays, so treat these modules as though they are cross-import overlays with no bystanding module.

Because these modules don’t re-export the standard library, it’s also necessary to treat `Swift` as a separately imported overlay of itself; do so and make that actually work.
2025-10-02 12:05:12 -07:00
swift-ci
499f4ff714 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-29 06:15:20 -07:00
Hamish Knight
a7dd04ed6f Merge pull request #84403 from a7medev/refactor/signature-help-to-ide
[IDE] Move signature help formatting to IDE instead of SourceKit
2025-09-29 14:05:02 +01:00
Ahmed Mahmoud
6f6b9d8a61 [IDE] Simplify createSignatureString parameters 2025-09-26 22:39:46 +03:00
swift-ci
6b28979fb4 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-25 16:24:58 -07:00
Allan Shortlidge
2467b931a7 ConstraintSystem: Move key path type utilities to AST. 2025-09-25 07:13:17 -07:00
swift-ci
06fb7384ce Merge remote-tracking branch 'origin/main' into rebranch 2025-09-23 03:14:56 -07:00
Hamish Knight
14a125c2ca [IDE] Use consistent PrintOptions in swift-ide-test
Use the same set of PrintOptions when printing the results for
different requests.
2025-09-21 23:19:06 +01:00
Ahmed Mahmoud
0b123340ba [IDE] Move CodeCompletionStringBuilder.h to lib/IDE 2025-09-19 21:24:30 +03:00
Ahmed Mahmoud
2f6064675e [IDE] Move signature help formatting to IDE instead of SourceKit 2025-09-19 18:24:57 +03:00
swift-ci
781d0fdfd9 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-11 08:37:41 -07:00
Hamish Knight
9beb2e3e36 [Completion] Simplify opened function type in tryResolveDoubleAppliedFunction 2025-09-11 10:31:46 +01:00
swift-ci
95736f8e88 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-10 01:39:11 -07:00
Hamish Knight
d3be024a54 [IDE] Introduce ReadyForTypeCheckingCallback
This avoids the layering violation of calling `bindExtensions` from
parser code.
2025-09-09 23:18:52 +01:00
Hamish Knight
92f2acaa67 [IDE] Remove redundant extension binding logic
I missed this in my previous patch that moved extension binding until
after we've mutated the AST for IDE inspection, this ad-hoc extension
binding logic is no longer necessary.
2025-09-09 23:18:52 +01:00
Anthony Latsis
e1450e011e Manually merge remote-tracking branch 'origin/main' into rebranch
Conflicts:
*	utils/build_swift/build_swift/defaults.py
2025-09-04 14:07:50 +01:00
Ahmed Elrefaey
9d1436c1c8 [IDE] [Signature Help] Add basic signature help request to SourceKit (#83378) 2025-09-04 10:09:02 +01:00
Ahmed Elrefaey
1bc96857a8 Merge pull request #82464 from a7medev/feat/full-documentation-in-code-completion
[IDE] Add full documentation to code completion result
2025-09-04 10:06:21 +01:00
swift-ci
35ae6d8866 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-01 03:14:00 -07:00
Hamish Knight
0c3be92c10 Merge pull request #83652 from a7medev/feat/generalize-erase-archetypes
[IDE] Erase archetypes without declaration generic signature
2025-09-01 11:01:54 +01:00
swift-ci
69e3469a9f Merge remote-tracking branch 'origin/main' into rebranch 2025-08-31 03:55:05 -07:00
Hamish Knight
d7fea157a1 [IDE] Remove fallback type-checking logic
This should no longer be necessary, rip it out.
2025-08-30 14:08:42 +01:00
Ahmed Mahmoud
491b3a0fbc [IDE] Erase archetypes with no declaration generic signature
This generalization enables curried functions with generic parameters coming from the initial declaration to be printed with the archetype's upperbound rather than '_' unresolved type.

As an added benefit, T.self and T.Type for generic parameters now get shown as the upperbound of the generic parameter provided
2025-08-29 13:39:58 +03:00
swift-ci
5ed4b2a070 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-28 13:06:19 -07:00
Hamish Knight
44ba366759 Merge pull request #83662 from hamishknight/unqualified-fallback
[Completion] Fall back to unqualified lookup on solver failure
2025-08-28 20:39:11 +01:00
swift-ci
9a46a42e72 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-28 11:35:27 -07:00
Hamish Knight
4f010f0fc7 Merge pull request #83646 from a7medev/refactor/extract-code-completion-string-builder
[IDE] [Signature Help] Extract primitive `CodeCompletionString` creation into `CodeCompletionStringBuilder`
2025-08-28 19:35:21 +01:00
swift-ci
68a3d56c8d Merge remote-tracking branch 'origin/main' into rebranch 2025-08-28 05:15:09 -07:00
Hamish Knight
0eae70cd84 Merge pull request #83961 from hamishknight/null-and-void
[IDE] Use `nullableTypesEqual` in `AfterPoundExprCompletion::sawSolutionImpl`
2025-08-28 13:06:53 +01:00
swift-ci
591d0502e6 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-28 04:15:50 -07:00
Hamish Knight
4aeb7e1b52 [IDE] Use nullableTypesEqual in AfterPoundExprCompletion::sawSolutionImpl
Avoid crashing if we can't compute the expected type.
2025-08-28 00:33:54 +01:00
Hamish Knight
7e22297b71 [AST] Walk ErrorExpr's original expr in ASTWalker
We set an original expression on ErrorExpr for cases where we have
something semantically invalid that doesn't fit into the AST, but is
still something that the user has explicitly written. For example
this is how we represent unresolved dots without member names (`x.`).
We still want to type-check the underlying expression though since
it can provide useful diagnostics and allows semantic functionality
such as completion and cursor info to work correctly.

rdar://130771574
2025-08-27 15:27:06 +01:00
Ahmed Mahmoud
ec1b146581 [IDE] Move CodeCompletionString building into CodeCompletionStringBuilder
[IDE] Move primitive completion function label into CodeCompletionStringBuilder

[IDE] NFC: Remove unneeded string builder methods on CodeCompletionResultBuilder

[IDE] Move addValueBaseName into CodeCompletionStringBuilder

[IDE] Make CodeCompletionResultBuilder a CodeCompletionStringBuilder

[IDE] Explicitly pass DeclContext in CodeCompletionStringBuilder

[IDE] Reduce includes in CodeCompletionStringBuilder.h
2025-08-27 00:40:20 +03:00
Hamish Knight
a63ab6d161 [Completion] Fall back to unqualified lookup on solver failure
Even if the solver fails we can still do an unqualified lookup without
a contextual type.
2025-08-25 11:13:40 +01:00
swift-ci
3181aeff9a Merge remote-tracking branch 'origin/main' into rebranch 2025-08-14 06:35:33 -07:00
Hamish Knight
6b2b28ae81 Merge pull request #83565 from hamishknight/synth
[IDE] Use LookUpConformanceInModule for synthesized extension requirement substitution
2025-08-14 14:23:30 +01:00
swift-ci
02ce1af46b Merge remote-tracking branch 'origin/main' into rebranch 2025-08-13 15:58:04 -07:00
Hamish Knight
5e27e83456 Merge pull request #83613 from hamishknight/next-step
[IDE] Perform extension binding after AST mutation
2025-08-13 22:37:56 +01:00
Hamish Knight
d4f2e2ba10 [IDE] Use getProtocolSubstitutions in SynthesizedExtensionAnalyzer
Get the substitution map from the conformance rather than building it
from the base type.
2025-08-13 21:19:07 +01:00
Hamish Knight
da0525a6d2 [IDE] Avoid building redundant substitution map
We only care about the case where we're substituting into a protocol
extension, otherwise the substitution map is an identity map.
2025-08-13 21:19:07 +01:00
Hamish Knight
e1e0f72288 [IDE] Avoid redundant worklist visitor
This is unnecessary since the local conformances for a protocol
can only contain self-conformances, which we don't want to visit
anyway. This can just be a straightforward loop over the local
conformances.
2025-08-13 21:19:07 +01:00
Hamish Knight
831ed310a6 [IDE] Sink SubstitutionMap computation into handleRequirements
And check `is-><ProtocolType>` instead of `isExistentialType`. Should
be NFC.
2025-08-13 21:19:07 +01:00
Hamish Knight
8ccd658d9e [IDE] NFC: Remove redundant use of getInnermostDeclContext
An extension decl is its own inner DeclContext.
2025-08-13 21:19:07 +01:00
Hamish Knight
02d2b4aa46 [IDE] Use LookUpConformanceInModule for synthesized extension requirement substitution
The extension may have requirements stating new conformance requirements
that aren't present in the underlying substitution map for the
conforming type.

rdar://152164768
2025-08-13 21:19:07 +01:00
swift-ci
11e8f15988 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-12 17:17:23 -07:00