Skip to content

Conversation

@amanthatdoescares
Copy link

@amanthatdoescares amanthatdoescares commented Dec 20, 2025

Add Objective-C Method Implementation CodeActions

Problem

SourceKit-LSP provides code actions for Swift incomplete implementations but lacks this for Objective-C files. Xcode offers this functionality natively, and SourceKit-LSP should match this developer experience.

Current State

  • Basic AddMethodImplementation infrastructure exists in Sources/SwiftLanguageService/CodeActions/AddMethodImplementation.swift
  • Connected to main service but returns empty arrays (incomplete implementation)
  • No Objective-C specific parsing or method stub generation

Fixes: #2186

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sort of string-based scraping for error messages seems very brittle. Both clang and swift can already provide Fix-Its for diagnostics and offer them as code actions to the user. We should use those instead of synthesizing them in SourceKit-LSP.

The real task is figure out why the Fix-It might not have shown up in #2186 and, if that root cause has been identified, fix it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide "Add method implementation" CodeActions for missing objc method definitions (-Wincomplete-implementation)

2 participants