Commit Graph

10 Commits

Author SHA1 Message Date
Michael Gottesman
9d59dbed17 [swift-settings] Now that we aren't using it immediately, remove it from tree.
We can always get it back from the git history.

rdar://150695113
2025-05-05 13:39:03 -07:00
Doug Gregor
ed2c7d693b Update for rename of FixIt.Change.textualReplacement -> replaceText 2025-03-28 14:39:14 -07:00
Doug Gregor
ceb1152ce7 Add support for FixIt.Change.textualReplacement 2025-03-28 13:20:47 -07:00
Holly Borla
b005df366a [Macros] Add an overload of findSyntaxNodeInSourceFile that accepts
a predicate.

The new overload is used during macro expansion to find the nearest
syntax node that is either a `DeclSyntax` or a `ClosureExprSyntax`.
This avoids an issue where calling the overload that accepts a
specific type may find an outer, unrelated declaration or closure.
2025-03-20 18:58:47 -07:00
Holly Borla
ab19ad2b54 [Macros] Look for specific syntax node kinds instead of Syntax when
expanding an attached macro.

This fixes a crash in one of the attached macro tests.
2025-03-19 21:45:58 -07:00
Holly Borla
31d4f661fc [Macros] Support function body macros on closures. 2025-03-18 20:50:47 -07:00
Michael Gottesman
f64dd5a8d5 [concurrency] Add initial support for SwiftSettings to control defaultIsolation at the file level.
We introduce a new macro called #SwiftSettings that can be used in conjunction
with a new stdlib type called SwiftSetting to control the default isolation at
the file level. It overrides the current default isolation whether it is the
current nonisolated state or main actor (when -enable-experimental-feature
UnspecifiedMeansMainActorIsolated is set).
2025-03-10 17:33:45 -07:00
Rintaro Ishizaki
f3329b3b5d [ASTGen/MacroEvaluation] Fix and adjust FixIt application
* Fix mismatch on 'FixIt.Change.replace' between several application
  implementations. Specifically '.replace' should includes the trivia.
* Ignore no-op 'FixIt.Change.replace{Leading|Trailing}Triviia'.
2025-01-16 10:04:08 -08:00
Rintaro Ishizaki
e566a746c8 [ASTGen] Support macro expanded buffer
* Make ExportedSourceFile hold any Syntax as the root node
* Move `ExportedSourceFileRequest::evaluate()` to `ParseRequests.cpp`
* Pass  the decl context and `GeneatedSourceFileInfo::Kind` to
  `swift_ASTGen_parseSourceFile()` to customize the parsing
* Make `ExportedSourceFile` to hold an arbitrary Syntax node
* Move round-trip checking into `ExportedSourceFileRequest::evaluate()`
* Split `parseSourceFileViaASTGen` completely from C++ parsing logic
  (in `ParseSourceFileRequest::evaluate()`)
* Remove 'ParserDiagnostics' experimental feature: Now that we have
  ParserASTGen mode which includes the swift-syntax parser diagnostics.
2024-11-05 11:00:33 -08:00
Rintaro Ishizaki
7dad37ac58 [ASTGen] Rename 'swiftMacros' module to 'swiftMacroEvaluation'
'swiftMacros' is confusing with 'SwiftMacros' which is the standard
libary macro plugin.

rdar://137448282
2024-10-09 15:15:59 -07:00