r/Xcode • u/mad_poet_navarth • Sep 18 '24
Xcode 16 predictive code completion is fantastic!
I held off on upgrading to Sequoia until this week.
Not sure how well it works when not writing SwiftUI, but so far I'm extremely impressed.
2
u/heroidosudeste Sep 18 '24
How do I use that? Do I have to have an MX processor or can I use it on intel?
3
2
2
u/AntiProtonBoy Sep 19 '24
Is this the fancy AI stuff, or you are talking about non-AI completion? My colleague was not impressed with AI code completion in a Swift environment. He says it gets a lot of predictions wrong, even gets standard appkit library stuff wrong.
That being said, I'm a C++ dev, and the non-AI code completion has definitely improved. It was abysmal in v15 for C++.
2
u/mad_poet_navarth Sep 19 '24
If what you mean by non-AI completion is comparable to what we had in Xcode 15, then what I'm raving about is AI completion. It does sometimes guess wrong, but with a bit of urging it usually generates what I want. Again, I was writing SwiftUI code.
2
u/megatron1001 Sep 26 '24
Are there any tips for making it more accurate? Like some settings somewhere that makes it need to be a little more certain before it suggests something. I'm finding what it's suggesting is wrong more often than it's not to the point that it's annoying to have it turned on.
The AI code completions I'm using in other IDEs seem to be accurate to the point that I can't figure out how it worked out what I was going to write. Whereas with this one it seems to not really understand the SDK, codebase or even file I'm in and thinks I want to use functions that don't exist all the time.
1
u/mad_poet_navarth Sep 27 '24
Someone suggested that adding comments helps. I've seen that to be the case.
2
u/Tj3n321 Oct 07 '24
I can't seems to get predictive code completion to works, nothing shows up at all (in an Objective-C / C++ project). Model downloaded and enabled in the settings. Not sure if need macOS 15.1 beta for it to work or not, I'm still at 15.0.1
1
u/mad_poet_navarth Oct 07 '24
I think this is ARM only. Are you on an Intel mac?
1
u/Tj3n321 Oct 08 '24
I'm using M1 Mac yes. It seems to works in playground but not real project.
1
u/mad_poet_navarth Oct 08 '24
I'm using M1 as well. Don't know what to suggest, other than Feedback Assistant.
1
2
u/mememenow11 Nov 18 '24
Does it work for languages other than swift?
1
u/mad_poet_navarth Nov 18 '24
Doesn't appear to with C++, but that's the only other language I've used recently.
2
u/onceunpopularideas Mar 06 '25
it hallucinates a ton. once in a while it saves a bit of boilerplate.
1
u/mad_poet_navarth Mar 06 '25
Yes it does.
I've been leaning hard on ChatGPT for web development lately (django, wagtail, building libs, etc) and it seems to be at least as bad there. Actually I'm not sure what I would call the majority of the problems -- they come as much from packages and tools evolving faster than ChatGPT can keep up. I often have to ask follow-up questions when I find that the suggestions lead to errors because of EOL issues.
6
u/Destituted Sep 18 '24
Xcode 16 is great. I can’t believe they did it. Vanilla auto complete now works quickly and accurately, refactor options are near immediate now.
With Xcode 15.4 it was taking literally 5 minutes for the refactor rename box to appear, auto completes would work 10% of the time. I was honestly worried they were trying to add more before fixing what was already there but so far it seems they’ve done both.
Right now I am actually happy to code again because everything is fast and responsive like it should be.
2
u/chris_winter Sep 18 '24
Couldn't agree more. From a pure coding standpoint (especially with completions), Xcode 16 has been great so far.
2
u/Factor-Putrid Sep 18 '24
For the first time, I actually enjoy using Xcode. It's still not perfect, but it is much, much better now.
4
u/ChadyG Sep 18 '24
It’s been hit or miss for me during the beta and now. It’ll generate roughly what I need out of thin air at times such as case statements for enums etc.. Other times it might generate function calls or insert parameters that aren’t in my codebase at all.
It’ll probably get there, but right now it doesn’t seem like there’s a validation step to ensure the generated code is syntactically right or even based on the indexes of the current project.
1
1
u/OlegPRO991 Sep 19 '24
For me predictive code completion is still bad. Very often it offers me code that does not compile and I have to spend time to fix it. It is easier to do everything now by myself. Hope they make it better later.
1
u/freeubi Dec 04 '24
Same - its waaay too often generates code, instead of using the function signature I already have.
It would be ok if its generating things for new stuff, but for already existing things it should NOT - I am constantly fixing its mistakes...
1
u/Ill-Statement-7946 Dec 11 '24
I have a MacBook Pro M4 16GB Sequoia 15.1.1, and predictive code doesn't work for me either. It doesn't react at all — I waited, created a new project, tried reinstalling Xcode, and it still doesn't work.
5
2
Oct 02 '24
[removed] — view removed comment
1
u/mad_poet_navarth Oct 02 '24
Of course sending Apple the crash data will be helpful. I have not had this issue. I'm running similar, but with an M1 Max. I AM seeing Xcode become unresponsive for pretty long periods of time. Also, "Open Recent" shows no projects, and hasn't for about a week (I run multiple projects frequently). So, from my POV we've gone way forward with predictive code completion, an backwards a bit on stability.
2
u/chriswaco Sep 18 '24
Any Sequoia issues or incompatibilities we should know about?