Skip to content

textDocument/implementation on a protocol requirement returns locations at which conformance to that protocol is stated instead of their implementations #1600

Description

@ahoppen

Consider doing an implementation request at 1️⃣ in the following.

protocol MyProto {
  func 1️⃣myFunc()
}

class ClassA: MyProto {
  func 2️⃣myFunc() {}
}
class ClassB: MyProto {
  func 3️⃣myFunc() {}
}
class 4️⃣ClassBSubA: ClassB {}
class 5️⃣ClassBSubB: ClassB {}

class RetroactiveConformanceClassWithMyFuncInClassDecl {
  func 6️⃣myFunc() { }
}
extension 7️⃣RetroactiveConformanceClassWithMyFuncInClassDecl: MyProto {}

class RetroactiveConformanceClassWithMyFuncInExtension {}
extension RetroactiveConformanceClassWithMyFuncInExtension: MyProto {
  func 8️⃣myFunc() { }
}

Currently, we report 2, 3, 4, 5, 7, 8

We should not be reporting locations 4, 5 and 7 because they don't actually contain myFunc. We should, however, be reporting location 6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions