JUCE 6 + Xcode autocomplete question

I have just started dipping my toes with JUCE and the wonderfull Audio Programmer tutorials on Youtube.

For the most part I can follow along, but I am getting a bit jealous about how he does command click (jump to definition) while autocompleting to look things up.
The tutorials are made with JUCE 5, and I am using JUCE 6. I have read the change about not including the header, but prefixing juce:: before every method, and I think this is why I don’t have the same “jump to…” command available as in the tutorials. But as a beginner, this would certainly be mighty handy to have available.

I know I can look up stuff in the API documentation, but at the moment this is all a bit overwhelming.

Is the lack of autocomplete something that I am doing wrong, and is it easy to rectify (a setting in Xcode perhaps) ?

The “Jump to Definition” seems to work fine for me on Xcode 11.6 with JUCE 6.
I can do it with Cmd + Right-Click.
Notice that to do it also with Cmd + Left-Click there’s a preference required to be set (Preferences…/Navigation/Command-click on Code:).

Have a look on < Xcode auto-completion? >.

Hi nicolasdanet, thanks for your reply.

I notice that I’m not explaining it very good.

I meant this:
Looking at this YouTube tutorial, around 32:41
he types:
slider1.setSliderStyle(juce::Slider::SliderStyle newStyle)
and he can command click on the word “SliderStyle” to look up what is available

With JUCE 6 however (or something I have done wrong), I get this line of code:
slider1.setSliderStyle(SliderStyle newStyle)
and I can click no where.

I first need to delete the code inside the parenthesis, and replace it with juce::Slider::SliderStyle, and after all this, I can command click, but why is my code autocompleting the wrong code to begin with ?

The problem I am facing is that all of this is so new to me, I have no clue which methods exist and which parameters are available for each method.
If my Xcode is not giving me at least a correct hint, I will never find what I am looking for… the way my Xcode is autocompleting the methods seems useless and confusing, so I must be doing something wrong ?

It might be as simple as start typing juce::SliderStyle…?
The biggest change was to change juce:: namespace to opt-in instead of opt-out…

indeed it is just as simple as typing juce::Slider::…

but I am wondering why the autocomplete in the tutorials does it immediatly and correctly:
slider1.setSliderStyle(juce::Slider::SliderStyle newStyle)

and I get this from Xcode:
slider1.setSliderStyle(SliderStyle newStyle)
… which I first need to modify before I can command click anything

apologies for the newbie question…

On my computer it (almost) works! I can Cmd+Click on SliderStyle to jump to the enum as in the video. No need to use any “juce::” prefix. It can be rather very long the first time (about 10 seconds). Note that until last weeks i didn’t use auto-completion ; I can not say what is normal or not. And frankly it is sometimes so slooooow (or simply broken) that it is not usable at all. I switched it off after few days.

i never had usable completion in xcode until the xcode 12 betas - now it somehow magically works?

Thank you all for chiming in…
It’s nice to know that it’s not something I am doing wrong… but just Xcode acting funky.

1 Like

most of the time it works, but it is reeeaaaallllyyy sloooooow…

fwiw, I’ve just set up VS Code intellisense, and it seems to perform much better with respect to code hinting.