Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Can't prevent Eclipse from indexing files not in project(Can't prevent Eclipse from indexing files not in project)
Can't prevent Eclipse from indexing files not in project [message #1819621] Sat, 18 January 2020 15:36 Go to next message
Rich von Lehe is currently offline Rich von LeheFriend
Messages: 4
Registered: January 2020
Junior Member
I have a fairly large source tree. I created a CMake project that uses a small subset of the sources in this source tree - things work really well in QtCreator using the "CodeBlocks - Ninja generator" there. I also want to use an Eclipse-based IDE (Momentics) for QNX debugging. The problem is that after running the Eclipse CDT4 generator and importing the resulting project the indexer seems to always want to index everything in the source tree. I would have expected it to only index the files referenced by the project. I have disabled the "Index source files not included in the build" option for the Indexer.

Does anyone have any advice for me?
Re: Can't prevent Eclipse from indexing files not in project [message #1819665 is a reply to message #1819621] Mon, 20 January 2020 15:45 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
The problem is that "files in the build" are all files in the project.
Likely the only way around this is to make a project with source links to relevant files.

Another way may be to move the nonused headers to a separate folder
then mark the folder as excluded from the build.

As you may have also discovered,
disabling "Index source files not included in the build"
prevents indexing external library headers.
Re: Can't prevent Eclipse from indexing files not in project [message #1819668 is a reply to message #1819665] Mon, 20 January 2020 16:31 Go to previous messageGo to next message
Rich von Lehe is currently offline Rich von LeheFriend
Messages: 4
Registered: January 2020
Junior Member
Correct - I will likely want to have system / external library headers included in the index (i.e. STL, Qt). I'm perfectly happy to have the indexer index into those types of dependencies. However, I don't know why the indexer can't limit itself to the cpp files that are listed in my project and not scan those that aren't. It is essentially doing a scan of an entire folder tree with no consideration for the cpp files that are explicitly listed in my project.

Can you describe your suggestion a bit more (sorry for being dense here)?


"Likely the only way around this is to make a project with source links to relevant files."

Does this mean foregoing the CMake generation and hand-crafting an Eclipse project that is the equivalent of the CMake project?

[Updated on: Mon, 20 January 2020 18:40]

Report message to a moderator

Re: Can't prevent Eclipse from indexing files not in project [message #1819671 is a reply to message #1819668] Tue, 21 January 2020 00:08 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Make another project and copy or link only what you need.
IOW: make it smaller and more concise.
Yes, you probably will need to modify CMakeLists.txt as well.

[Updated on: Tue, 21 January 2020 00:24]

Report message to a moderator

Re: Can't prevent Eclipse from indexing files not in project [message #1819698 is a reply to message #1819671] Tue, 21 January 2020 15:32 Go to previous messageGo to next message
Rich von Lehe is currently offline Rich von LeheFriend
Messages: 4
Registered: January 2020
Junior Member
I'm already mentioning *only* the source files I require in the CMake project. The source tree contains more than 29,000 cpp files and my project mentions less than 1000 of them - all by name - no file globbing. I apologize if I didn't make that clear enough in the original post.

Having a separate project that must be maintained along with the CMake I think will be a non-starter.

Re: Can't prevent Eclipse from indexing files not in project [message #1819700 is a reply to message #1819698] Tue, 21 January 2020 16:45 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
1000 files is a small subset?
The Indexer isn't fast.
I have one project with 1700 files and it took days to index them.

If you can't make your project smaller
and can't wait for the Indexer to finish
then I'm afraid you're stuck.

You could disable the Indexer all together.
Re: Can't prevent Eclipse from indexing files not in project [message #1819703 is a reply to message #1819700] Tue, 21 January 2020 17:12 Go to previous message
Rich von Lehe is currently offline Rich von LeheFriend
Messages: 4
Registered: January 2020
Junior Member
Small in a relative sense - it's less than 5% of the total :-) I think the actual number is closer to 500. My point was if Eclipse were to limit itself to this set of files the indexer would complete in what I think is a reasonable time frame.

This particular repository has a long history - there are source files and even binaries from a bunch of unrelated things. I've pointed this out and suggested better partitioning, but for now it remains very large.

**Please don't take my comment below as anything other than curiosity. ** (I'm generally a fan of Eclipse mainly because it has supplanted a lot of the one-off IDEs that embedded systems vendors used to write from scratch)

I typically use QtCreator for day-to-day editing - in this project especially since Qt is one of the primary libraries we have a dependency on. It does indexing as well - or at least produces what I consider the main by-product of indexing which is being able to navigate through sources by hitting F2 on symbols. Why is QtCreator able to do this in relatively negligible time and Eclipse spends tens of minutes or more? I may not understand what Eclipse is doing - perhaps it is doing much more than QtCreator?

EDIT:
It might be OK for us to disable the indexer if the Momentics Eclipse IDE ends up only being used for debugging. The index is more important for reading and writing code than debugging IMO.

[Updated on: Tue, 21 January 2020 18:56]

Report message to a moderator

Previous Topic:whoops I did it again - where is system wide "console wrap lines " setting?
Next Topic:Launch Group - window not responding lock
Goto Forum:
  


Current Time: Thu Sep 26 18:50:02 GMT 2024

Powered by FUDForum. Page generated in 0.03643 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top