User forums > Using Code::Blocks
Enable CC on file extensions
Alpha:
Is their a setting somewhere to tell the CodeCompletion plugin to run on file extensions other than the registered C/C++ ones?
I would like to add *.java files - Java is close enough to C++ that I find CC's suggestions are able to be helpful (when I already have Code::Blocks open and do not want to launch Eclipse).
(P.S. Java lexer available.)
ollydbg:
Look at Token.cpp
--- Code: ---CCFileType CCFileTypeOf(const wxString& filename)
{
const wxString file = filename.AfterLast(wxFILE_SEP_PATH).Lower();
const int pos = file.Find(_T('.'), true);
wxString ext;
if (pos != wxNOT_FOUND)
ext = file.SubString(pos + 1, file.Len());
if ( ext.IsEmpty()
|| ext == _T("h")
|| ext == _T("hpp")
|| ext == _T("tcc")
|| ext == _T("xpm") )
{
return ccftHeader;
}
else if ( ext == _T("cpp")
|| ext == _T("c")
|| ext == _T("cxx")
|| ext == _T("cc")
|| ext == _T("c++") )
{
return ccftSource;
}
else
return ccftOther;
}
--- End code ---
So, you can add the java file extension here.
The best way is that it can have a wxTextCtrl in the CC setting dialog.
PS: I'm not sure our CC's parser can correctly parse java source files.
MortenMacFly:
--- Quote from: ollydbg on January 03, 2012, 03:38:21 am ---The best way is that it can have a wxTextCtrl in the CC setting dialog.
--- End quote ---
That's what I played around with recently. The outcome is attached... That's how it should look like (implementation is still not complete due to a lack of time).
ollydbg:
In your new design, I found in the new page(C/C++ parser adv), you have:
Keyword sets to additionally include:
But this I think is belong to "code completion" page, not the parser page.
MortenMacFly:
--- Quote from: ollydbg on January 03, 2012, 08:42:21 am ---But this I think is belong to "code completion" page, not the parser page.
--- End quote ---
True, I actually had in mind to save space... I'll change it.
Navigation
[0] Message Index
[#] Next page
Go to full version