| Solution of ContentAssist Problem [message #331449] | 
Mon, 08 September 2008 06:59   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
The Problem was: 
Problem stmt: 
Hi Experts, 
 
 
Contents Assist does not work in eclipse 3.3 CDT. 
 
 
1.created a c++ project in Eclipse Europa 3.3 for CDT 
 
2.now added a Header file and without compiling , try to use any method  
defined in the header file by typing few characters and then ctrl+space 
 
3.we dont get any option unless you save it once which inturn also  
compiles the file. 
 
 
More information: 
There is one option in preference page =>c/c++=>check the checkBox  
captioned 
"follow unindexed files when producing the outline view". 
which is to support content assist without compilation but does not work  
accurately with europa. 
 
But, if you follow the same steps with "ECLIPSE Genymade" which uses cdt  
5.0 
version , this option work properly. 
 
 
So can anybody tell me how to resolve this. 
 
SOLUTION: 
As i have done a work around to resolve the problem , and its working in  
my case. 
In plugin org.eclipse.cdt.core there is a file TranslationUnit.java. 
So just cange some line to a function named 
 
public IASTCompletionNode getCompletionNode(IIndex index, int style, int  
offset) throws CoreException  
{ 
ICodeReaderFactory codeReaderFactory; 
if (index != null && (style & (ITranslationUnit.AST_SKIP_INDEXED_HEADERS |  
ITranslationUnit.AST_SKIP_ALL_HEADERS)) != 0) { 
ICodeReaderFactory fallbackFactory; 
if ((style & ITranslationUnit.AST_SKIP_ALL_HEADERS) != 0) { 
fallbackFactory= SavedCodeReaderFactory.getInstance(); 
==>the above needs to be added and the below need to be commented 
//fallbackFactory= NullCodeReaderFactory.getInstance(); 
}  
 
Hope it should work,let me know incase of any error you face!!!
 |  
 |  
  | 
| Re: Solution of ContentAssist Problem [message #331452 is a reply to message #331449] | 
Mon, 08 September 2008 08:42   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Bhasker wrote: 
> The Problem was: 
> Problem stmt: 
> Hi Experts, 
> 
> 
> Contents Assist does not work in eclipse 3.3 CDT. 
I suggest to post this to the eclipse.tools.cdt newsgroup. 
 
Dani 
> 
> 
> 1.created a c++ project in Eclipse Europa 3.3 for CDT 
> 
> 2.now added a Header file and without compiling , try to use any  
> method defined in the header file by typing few characters and then  
> ctrl+space 
> 
> 3.we dont get any option unless you save it once which inturn also  
> compiles the file. 
> 
> 
> More information: 
> There is one option in preference page =>c/c++=>check the checkBox  
> captioned 
> "follow unindexed files when producing the outline view". 
> which is to support content assist without compilation but does not  
> work accurately with europa. 
> 
> But, if you follow the same steps with "ECLIPSE Genymade" which uses  
> cdt 5.0 
> version , this option work properly. 
> 
> 
> So can anybody tell me how to resolve this. 
> 
> SOLUTION: 
> As i have done a work around to resolve the problem , and its working  
> in my case. 
> In plugin org.eclipse.cdt.core there is a file TranslationUnit.java. 
> So just cange some line to a function named 
> 
> public IASTCompletionNode getCompletionNode(IIndex index, int style,  
> int offset) throws CoreException { 
> ICodeReaderFactory codeReaderFactory; 
> if (index != null && (style &  
> (ITranslationUnit.AST_SKIP_INDEXED_HEADERS |  
> ITranslationUnit.AST_SKIP_ALL_HEADERS)) != 0) { 
> ICodeReaderFactory fallbackFactory; 
> if ((style & ITranslationUnit.AST_SKIP_ALL_HEADERS) != 0) { 
> fallbackFactory= SavedCodeReaderFactory.getInstance(); 
> ==>the above needs to be added and the below need to be commented 
> //fallbackFactory= NullCodeReaderFactory.getInstance(); 
> } 
> Hope it should work,let me know incase of any error you face!!!
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.02979 seconds