mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Expand macros in the specified source file syntactically (without any
module imports, nor typechecking).
Request would look like:
```
{
key.compilerargs: [...]
key.sourcefile: <file name>
key.sourcetext: <source text> (optional)
key.expansions: [<expansion specifier>...]
}
```
`key.compilerargs` are used for getting plugins search paths. If
`key.sourcetext` is not specified, it's loaded from the file system.
Each `<expansion sepecifier>` is
```
{
key.offset: <offset>
key.modulename: <plugin module name>
key.typename: <macro typename>
key.macro_roles: [<macro role UID>...]
}
```
Clients have to provide the module and type names because that's
semantic.
Response is a `CategorizedEdits` just like (semantic) "ExpandMacro"
refactoring. But without `key.buffer_name`. Nested expnasions are not
supported at this point.
19 lines
354 B
CMake
19 lines
354 B
CMake
|
|
add_swift_host_library(swiftIDETool STATIC
|
|
CompileInstance.cpp
|
|
CompilerInvocation.cpp
|
|
IDEInspectionInstance.cpp
|
|
DependencyChecking.cpp
|
|
SyntacticMacroExpansion.cpp
|
|
)
|
|
|
|
target_link_libraries(swiftIDETool PRIVATE
|
|
swiftAST
|
|
swiftDriver
|
|
swiftFrontend
|
|
swiftFrontendTool
|
|
clangAST
|
|
clangFrontend)
|
|
|
|
set_swift_llvm_is_available(swiftIDETool)
|