Closed fireplusteam closed 9 months ago
I can not reproduce your problem. even your code compile failed, the reference works. what sourcekit-lsp version you use? may upgrade it fixes problem. also notice Sourcekit-LSP only update index after build
Yes, I built it first, here is the sample project where it's reproducible for me:
I used builtin sourcekit-lsp which comes with xcode 15.0.1
This issue appears to only be reproduced when used as an instance method. There is no problem with global methods. It can also be reproduced in the Package.swift project. So you should post an issue to sourcekit-lsp, here is my test code:
struct Foo {
func callMethod() {
// let a = 10
// print("\(a),\(self.po)")
bla(B: "", d: 10)
}
func bla( // this cannot goto references
B: String,
d: String
) {
}
}
func callMethod() {
// let a = 10
// print("\(a),\(self.po)")
bla(B: "", d: 10)
}
func bla( // this can goto references
B: String,
d: String
) {
}
Hi, thanks for the great work and server. Really awesome. By the way do you know why "Go To Reference" stops working if there's an error in a line of code. For example:
in that case if I put the cursor to
someFunc
and try to "Go to reference" it doesn't work, However if I change the line tosomeFunc(B: "", d: "")
it starts working immediately