company-sourcekit
company-sourcekit copied to clipboard
Completion of symbols in current module
import Foundation
let x = "Hello"
func test(x: String) -> String {
return x + " World"
}
let y = te // Completion doesn't work
But if we write
let y = Temp.te // Completion works perfectly
where Temp
is module name
It seems that just like #13 it's running into an issue where sourcekit returns never-ending gibberish for completions that don't have a .
or (
or import
.
I'm not sure if it's because we're sending the wrong offset to sourcekit or if sourcekittendaemon is sending the wrong flags.
This is how it currently works:
let y = te|
# ^ Offset: 11, Prefix: ""
# Results: gibberish
It probably should work like this but even after manually sending the offset it's still getting gibberish:
let y = |te
# ^ Offset: 9, Prefix: "te"
# Results: gibberish
I've tried to see how XCode does it using export SOURCEKIT_LOGGING=3 && /Applications/Xcode.app/Contents/MacOS/Xcode
but things were too slow with the logging on and I've run out of time today :)