Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328300

Summary: [CDT][context] Mylyn automatically add all Includes in the context of the task
Product: z_Archived Reporter: Andrey Kourskov <_druid>
Component: MylynAssignee: Shawn Minto <shawn.minto>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: angvoz.dev, sam.davis, shawn.minto, steffen.pingel
Version: unspecified   
Target Milestone: 3.4.3   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot
none
mylyn/context/zip
none
Patch
none
mylyn/context/zip
none
patch for head none

Description Andrey Kourskov CLA 2010-10-20 18:08:12 EDT
Created attachment 181344 [details]
Screenshot

After upgrade Eclipse to Helios SR1, Mylyn CDT plugin automatically add all Includes in the context of the task.
Thus Project Explorer always filled with unnecessary and unused include directories.
This problem was not in previous versions(Eclipse Galileo and Helios(not SR1)).

I can't remove these directories from context. Resource filter also do not help.

Maybe it's related to the fixed bug:
[cdt][outline] All methods are hidden when Group Methods is checked
https://bugs.eclipse.org/bugs/show_bug.cgi?id=322058


-------------
Eclipse IDE for C/C++ Developers
Version: Helios Service Release 1
Build id: 20100917-0705
Comment 1 Steffen Pingel CLA 2010-10-20 18:28:55 EDT
Thanks for the bug report. Do you have a sample project that you could attach and steps to reproduce the problem?
Comment 2 Andrey Kourskov CLA 2010-10-20 19:34:33 EDT
(In reply to comment #1)
> Thanks for the bug report. Do you have a sample project that you could attach
> and steps to reproduce the problem?

Steps to reproduce
1) File -> New -> C++ Project
2) Project name = HelloWorld
3) Project type = Executable HelloWorld C++ Project
4) Finish
5) TaskList -> NewTask (Local)
6) Save task
6) Activate task
7) Open HelloWorld.cpp in created C++ project
8) Open context of the created task or open Project Explorer(Focus on active task should be enable)
Comment 3 Andrey Kourskov CLA 2011-01-27 19:18:08 EST
Is it possible to fix this bug in Helios SR2?
Comment 4 Steffen Pingel CLA 2011-01-27 23:57:01 EST
Thanks for the detailed steps. I have put it on for 3.5 so that it doesn't get lost. We'll try to look at it for 3.4.3 (SR2) but I can't promise anything.
Comment 5 Sam Davis CLA 2011-01-28 20:08:10 EST
I am able to reproduce this. Note that includes can be added to the context in SR1 but could not previously. This bug may be a side effect of that.
Comment 6 Sam Davis CLA 2011-01-28 21:27:09 EST
This may be a CDT bug. The problem seems to be that some of elements have the same handle identifier (for me it's "=MinGW"). For me these are the elements below:

C:/MinGW/lib/gcc/mingw32/4.5.2/include/c++/backward
C:/MinGW/lib/gcc/mingw32/4.5.2/include/c++/mingw32/bits
C:/MinGW/include/ddk
C:/MinGW/lib/gcc/mingw32/4.5.2/include/c++

This causes canFilter to return false. If we could detect which elements didn't have a proper handle identifier we could just ignore them. That would fix this bug but might prevent includes from showing up in the context when they should.
Comment 7 Sam Davis CLA 2011-01-28 21:27:12 EST
Created attachment 187896 [details]
mylyn/context/zip
Comment 8 Sam Davis CLA 2011-02-04 13:56:39 EST
I have filed a bug against CDT:

336387: IncludeReferences have the same handle identifier as the project
https://bugs.eclipse.org/bugs/show_bug.cgi?id=336387
Comment 9 Shawn Minto CLA 2011-02-04 14:06:26 EST
Created attachment 188351 [details]
Patch

Here is a patch that should fix this problem.  The IncludeReference's that are now shown under the project have the same handle identifier as the project.  This means that once the project is a part of the context, all of these IncludeReferences are shown in focused mode.  The fix that I did is to ensure that if the element is not a project that its handle is not the same as the project.  This means that if there is another breakage like this in CDT or a fix is implemented that the focused mode will work correctly.

The CDT bug that was created from this investigation:

336387: IncludeReferences have the same handle identifier as the project
https://bugs.eclipse.org/bugs/show_bug.cgi?id=336387
Comment 10 Shawn Minto CLA 2011-02-04 14:06:28 EST
Created attachment 188352 [details]
mylyn/context/zip
Comment 11 Shawn Minto CLA 2011-02-04 14:09:21 EST
Note that we need to setup tests to make sure that we are happy with this.
Comment 12 Steffen Pingel CLA 2011-02-04 14:59:23 EST
Created attachment 188361 [details]
patch for head
Comment 13 Steffen Pingel CLA 2011-02-04 18:35:17 EST
Thanks for fixing this Shawn! I have applied the patch to the e_3_6_m_3_4_x branch and head. A 3.4.3.v20110204-0608 build is now available from http://download.eclipse.org/tools/mylyn/update/maintenance.

This fix will be in next week's Helios SR2 RC3 build.