Jump to definition
-
I'm working on a huge C++ codebase on Mac. We use Perforce Jam to build it. Therefore, Xcode s when I ask it to jump to definition, declaration, find call hierarchy etc. Jetbrains AppCode is a little better, it can find implementation for a declaration but not vice versa.
Any recommendations? Some people recommended switching to Sublime Text but I would prefer to stay in the IDE and make it more aware..
-
@marczellm Can't you set it up so both Perforce Jam and XCode are capable of building it? Then build with XCode when you need to refresh its "whatever-the-heck-they-call-Intellisense" database?
-
@blakeyrat said in Jump to definition:
whatever-the-heck-they-call-Intellisense
Everyone except Microsoft calls it autocompletion.
-
I'll try.
@blakeyrat said in Jump to definition:
build with XCode when you need to refresh its "whatever-the-heck-they-call-Intellisense" database?
FYI, Xcode does the indexing automatically and separately from the building.
-
@marczellm said in Jump to definition:
FYI, Xcode does the indexing automatically and separately from the building.
So then what's the problem? Why is the info about building with Perforce Jam relevant to the issue?
-
@blakeyrat said in Jump to definition:
@marczellm said in Jump to definition:
FYI, Xcode does the indexing automatically and separately from the building.
So then what's the problem? Why is the info about building with Perforce Jam relevant to the issue?
Come on, that's Asking For Help 101. If you don't know what's causing the problem, then you likely don't know what's relevant to the problem.
-
@blakeyrat said in Jump to definition:
@marczellm said in Jump to definition:
FYI, Xcode does the indexing automatically and separately from the building.
So then what's the problem? Why is the info about building with Perforce Jam relevant to the issue?
I don't know why, but Xcode refuses to index a project that it cannot build.
I might not be able to get Xcode to build it, because it includes, among others
- cross platform C++ code
- Windows and Mac platform dependent code
- our own in-house resource file format (for describing dialogs; with its associated compiler)
- a bunch of Python and Perl scripts
-
@marczellm said in Jump to definition:
I don't know why, but Xcode refuses to index a project that it cannot build.
I find it difficult to reconsile the above statement with this one:
@marczellm said in Jump to definition:
FYI, Xcode does the indexing automatically and separately from the building.
If it can index without a build, why does it matter whether it can do the build?
I still wager that (frankly) you're incorrect on the second point, and once you get the project to the point where XCode can build it you'll find that the Intellisense works.
-
@blakeyrat said in Jump to definition:
reconsile
-
@marczellm said in Jump to definition:
I don't know why, but Xcode refuses to index a project that it cannot build.
Wat.
-
@Tsaukpaetra said in Jump to definition:
@marczellm said in Jump to definition:
I don't know why, but Xcode refuses to index a project that it cannot build.
Wat.
It's Xcode.
…
OK, more helpful. It's almost certainly using the first stage of the compiler (which will likely be clang in some mode with Apple-specific hacks) to do the indexing. Identifying what's exactly going on in C++ is potentially fairly complex because of all the things you can potentially do with templates and operators, so that's a required step. Which means it needs to know exactly what files are part of the project, how to do any non-standard preprocessing, etc. Or that's what I'd guess anyway; I've never set a project up on Xcode so I've not tested it out enough to say what to do. (I have occasionally opened a project with it where someone else had made the project description files, which worked but it was Xcode so I didn't stay for long.)
I prefer languages where indexing even a big project is no more than a few seconds work. I have plenty of choices.
-
@blakeyrat said in Jump to definition:
If it can index without a build, why does it matter whether it can do the build?
More precisely:
Given a project that is configured to be built with the Xcode build system, Xcode can perform two actions. The user-facing name of these actions is "index" and "build". Indexing is performed automatically upon opening the project. Building is performed upon request. So to the user these are separate actions but their precondition is the same.I think it's similar to what MS has been doing with the Roslyn project where AFAIK the compiler has an API that IDEs can hook into to perform their analysis stuff. But the compiler has to know the project structure, dependencies etc. Given that those are described here by the Jamfiles and unknown to the IDE and transitively the compiler, indexing doesnt't work. Just like @dkf said.
-
@marczellm said in Jump to definition:
indexing doesnt't work
And C++ is such a hairball of a language that
youthe compiler needs a lot of information to figure out what's going on.
-
@marczellm said in Jump to definition:
We use
Perforce Jamsomething other than a build system to build itYou are doing it wrong. Go back and use a real build system. This may require finding and removing whoever decided to opt for lock-in instead.
-
@Gribnit said in Jump to definition:
You are doing it wrong. Go back and use a real build system. This may require finding and removing whoever decided to opt for lock-in instead.
Not an option. I've just started work after graduating, this is a 30+ year old company, the codebase is almost the same age and huge in size.
-
@Gribnit Also I'm interested in how you define build system and how Jam falls outside that definition.
-
@marczellm said in Jump to definition:
@Gribnit Also I'm interested in how you define build system and how Jam falls outside that definition.
Take your build system and jam it
-
@pie_flavor said in Jump to definition:
@marczellm said in Jump to definition:
@Gribnit Also I'm interested in how you define build system and how Jam falls outside that definition.
Take your build system and jam it
Build harder, faster, better, stronger?
-
@marczellm said in Jump to definition:
@Gribnit Also I'm interested in how you define build system and how Jam falls outside that definition.
Does it have a graphical interface it is primarily driven through, or can it be driven by CI?
Aw crap, I looked it up. It appears to be a real build system. I guess you could run this with CI. But why the hell does that get you IDE problems? There is something fishy here.
-
@marczellm said in Jump to definition:
@Gribnit Also I'm interested in how you define build system and how Jam falls outside that definition.
How about "still maintained"?
-
@Gribnit I don't understand how Xcode works internally, but I've been told by coworkers that in order for an IDE to be able to give completion and jump to definition support for C++ it has to know the dependency structure of the code. So if you have a huge codebase and give Xcode a command line invocation to use instead of configuring its own build system to the task, it will not be able to index the codebase. @dkf above has explained that this is quite specific to C++.
@Unperverted-Vixen It's maintained in-house.
-
I'm currently trying this:
with this:
and it's now "adding" the thousands of cpps I have to this dummy "target".
-
Every time I see this thread, I keep thinking of the "game" "Jump to Conclusions"
-