Bug 319060

Summary: Code completion only considers header files in the current directory
Product: [Applications] kdevelop Reporter: Max Schwarz <max.schwarz>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: RESOLVED DUPLICATE    
Severity: minor    
Priority: NOR    
Version: git master   
Target Milestone: 4.3.0   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Proposed patch

Description Max Schwarz 2013-04-29 11:46:33 UTC
I love KDevelop's implementation helper which shows up on ctrl + space and tells you what methods are still left to implement. But it does not show up in my work environment, which requires us to place headers and source files in different folders (include/ and src/).

The attached patch fixes the problem by disabling the "fast" parameter of CppUtils::sourceOrHeaderCandidate() during the search in CodeCompletionContext::getImplementationHelpers(). This makes it search for matching file names in the whole project, instead of just the current directory.

I do not believe this introduces performance problems. Additionally, we have used the patch for months now without any problems.

Reproducible: Always

Steps to Reproduce:
1. Create a file include/test.h with a simple class:
class Test
{
void helloWorld();
};


2. Create a file src/test.cpp and include include/test.h
3. Invoke code completion (ctrl+space).
Actual Results:  
The implementation helper will come up empty.

Expected Results:  
The implementation helper should help me implement Test::helloWorld().
Comment 1 Max Schwarz 2013-04-29 11:47:46 UTC
Created attachment 79541 [details]
Proposed patch
Comment 2 Max Schwarz 2013-04-29 11:58:34 UTC
sorry, just noticed that this is a duplicate of #257043. I'll add my patch there.

*** This bug has been marked as a duplicate of bug 257043 ***