It still boggles my mind that Xcode's *built in* AI autocomplete keeps suggesting APIs that don't exist.

Like, it's literally sitting on top of a compiler that can determine if an API exists, so why can't it ask the compiler *before* suggesting it?

The entire purpose of autocomplete is to help me find out the real name of hard-to-remember APIs. I'm perfectly capable of *misremembering* them by myself, I don't need the computer to do it for me

@nicklockwood this is my experience of AI autocomplete on other platforms too. It’s the complete opposite of helpful.
@nicklockwood yeah I just use Xcode without AI and cursor or Claude code at the same time. Xcode is the worst form of AI assistance
@nicklockwood It's not even capable of correcting obvious typos -- it will happily generate a fake API with comical results.
@nicklockwood yes! Lately I see autocompletes in Xcode it's like, "wow this API is exactly what I need!" — then you realise it's too good to be true because it's not true
@nicklockwood Oh, yes. It's especially annoying when it puts a hallucinated autocompletion above an existing one. It's such a frustrating usability regression.
@nighthawk @nicklockwood I turned it off and went back to the old one because of this. The first time you lose 15 minutes because it hallucinates a delegate method name that’s just slightly different from the real one, you lose all the time it saves you with decent suggestions. I don’t like to feel like I’m playing a slot machine while I code.

@nicklockwood I’m pretty sure playing with types and using the leveinstein distance to sort autocomplete suggestions would achieve a better job (types to determine the subset of suggestions that match your existing code)

AI is just glittered hype, it breaks when you blow on it

@lexplt I think this is basically how autocomplete worked in IDEs since the '90s
@nicklockwood Finally Xcode got the update bringing its autocomplete almost on par with visual studio's?
(VS sometimes will be showing the right autocomplete proposal, e.g. "ToString()", and then as you hit tab or enter to accept it replace it with stuff like "ToStephensSeventhsSon(StepehensChilldhoodMemory mem)" which it found in a package referenced once somewhere online. It will also add a reference to the package.)

(No shade intended on the code of any Stephen)
To be fair, hooking anything up to Xcode’s notoriously buggy indexer sounds like a nightmare.
@nicklockwood I turned all of the AI autocomplete stuff off within a couple days of trying it. Sad to hear it's *still* not working.
@bigzaphod it has flashes of brilliance where it writes a whole function or unit test for me perfectly, but yeah overall I'd be hard pressed to say if it's a net win or not
@nicklockwood @bigzaphod having used Jetbrains IDEs, I feel autocomplete was a solved problem before AI came along and we started asking the computer to guess for us instead of looking it up in the docs for us.
@nicklockwood @GeekAndDad so, it’s the Xcode equivalent of the git man page generator?

@nicklockwood Could it be a performance thing? I.e. iterating with the compiler until it reaches a suggestion which compiles might be too much of a performance overhead?

Anyhow, for me the GitHub Copilot Xcode Extension is usually quicker to produce (often incorrect) suggestions than Xcode’s actual non-AI code completions ¯\_(ツ)_/¯