Skip to content

Change code actions to provide functionality through SyntaxRefactoringCodeActionProvider #2628

Description

@ahoppen

Currently, many of the code actions in SwiftLanguageService/CodeActions directly conform to SyntaxCodeActionProvider. For those for which it makes sense, I think we could avoid some boilerplate (and add some more structure) by making the code action conform to SyntaxRefactoringCodeActionProvider as well as SyntaxRefactoringCodeActionProvider, removing the explicit implementation of codeActions(in:) and instead rely on the synthesized version.

As this is a learning-oriented task, please don’t address this purely by using an AI tool, as described in https://github.com/swiftlang/project-operations/blob/main/contributing/ai-tools.md#learning-oriented-contributions.

Activity

  1. 25harsh commented on May 9, 2026

    @25harsh
    Contributor

    Hi @ahoppen, I'd like to pick this up

  2. rintaro commented on May 10, 2026

    @rintaro
    Member

    Hmm, I'm not sure this is the right direction. I thought SyntaxRefactoringCodeActionProvider is just a glue code to adopt SyntaxRefactor refactorings to SyntaxCodeActionProvider. What's the benefit of SyntaxRefactoringCodeActionProvider?

  3. rintaro commented on May 11, 2026

    @rintaro
    Member

    Code owners discussed offline and we concluded that using SyntaxRefactoringCodeActionProvider is preferable. So please disregard my previous comment.

  4. 25harsh commented on May 12, 2026

    @25harsh
    Contributor

    Will pick this up once #2642 is merged most of the files needing conformance changes are moved in that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersrefactoringAn internal refactoring of the codebase

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions