Per the Code Action contributor documentation, code actions should generally be implemented in sourcekit-lsp since they are primarily a language-server feature, and should only be implemented in swift-syntax when the functionality needs to be reused outside of the language server.
Several code actions are currently implemented as SyntaxRefactoringProvider conformances in swift-syntax/Sources/SwiftRefactor/, but their only consumer is sourcekit-lsp, which wraps them via the SyntaxRefactoringCodeActionProvider adapter. These should be moved to sourcekit-lsp directly as SyntaxCodeActionProvider types.
Actions to move:
Out of scope:
ExpandEditorPlaceholdersToLiteralClosures and its supporting types (ExpandEditorPlaceholder, ExpandSingleEditorPlaceholder) — used directly in sourcekit-lsp's code completion, not as a code action
CallToTrailingClosures — used as an internal implementation detail of ExpandEditorPlaceholder within swift-syntax
PackageManifest/ refactorings (AddPackageDependency, AddPackageTarget, AddProduct, etc.) — used as building blocks for structured manifest editing
Per the Code Action contributor documentation, code actions should generally be implemented in sourcekit-lsp since they are primarily a language-server feature, and should only be implemented in swift-syntax when the functionality needs to be reused outside of the language server.
Several code actions are currently implemented as
SyntaxRefactoringProviderconformances inswift-syntax/Sources/SwiftRefactor/, but their only consumer is sourcekit-lsp, which wraps them via theSyntaxRefactoringCodeActionProvideradapter. These should be moved to sourcekit-lsp directly asSyntaxCodeActionProvidertypes.Actions to move:
AddSeparatorsToIntegerLiteral— "Add digit separators"ConvertComputedPropertyToStored— "Convert to stored property"ConvertComputedPropertyToZeroParameterFunction— "Convert to zero parameter function"ConvertStoredPropertyToComputed— "Convert to computed property" (currently not wired up)ConvertZeroParameterFunctionToComputedProperty— "Convert to computed property"FormatRawStringLiteral— "Convert string literal to minimal number of '#'s"MigrateToNewIfLetSyntax— "Migrate to shorthand 'if let' syntax"OpaqueParameterToGeneric— "Expand 'some' parameters to generic parameters"RemoveRedundantParentheses— "Remove Redundant Parentheses"RemoveSeparatorsFromIntegerLiteral— "Remove digit separators"Out of scope:
ExpandEditorPlaceholdersToLiteralClosuresand its supporting types (ExpandEditorPlaceholder,ExpandSingleEditorPlaceholder) — used directly in sourcekit-lsp's code completion, not as a code actionCallToTrailingClosures— used as an internal implementation detail ofExpandEditorPlaceholderwithin swift-syntaxPackageManifest/refactorings (AddPackageDependency,AddPackageTarget,AddProduct, etc.) — used as building blocks for structured manifest editing