Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ahoppen opened this issue Jul 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ahoppen
Copy link
Member

ahoppen commented Jul 31, 2024

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.

@ahoppen ahoppen added the bug Something isn't working label Jul 31, 2024
@ahoppen
Copy link
Member Author

ahoppen commented Jul 31, 2024

Synced to Apple’s issue tracker as rdar://132935019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant