swiftlang / sourcekit-lsp

Language Server Protocol implementation for Swift and C-based languages
Apache License 2.0
3.32k stars 276 forks source link

[SR-11276] Sourcekit-LSP returns wrong position for protocol method implementations #543

Open swift-ci opened 5 years ago

swift-ci commented 5 years ago
Previous ID SR-11276
Radar None
Original Reporter cukier (JIRA User)
Type Bug
Environment commit c0d2ad0eb8a2c371ca2c5c9f65b4f71baece24dc of sourcekit-lsp
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | SourceKit-LSP | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 1f8f35a85d2991c3ff9d52e044c6482d

Issue Description:

protocol Aaa { 
    func bbb()
}
class Ccc { 
    func bbb() { } //5
}
extension Ccc: Aaa { } //7
class Ddd: Ccc { } //8

If you ask for implementations for function `bbb` in the protocol, Sourcekit-LSP will return positions at lines 7 and 8. I would expect it to return the position of the method at line 5.

ahoppen commented 2 years ago

rdar://95597776