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 (http://developer.berlios.de/patch/?func=detailpatch&patch_id=3246&group_id=5358) available.)
Look at Token.cpp
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;
}
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.
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.
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).
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.
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.
True, I actually had in mind to save space... I'll change it.
Implemented in trunk.
Quote from: ollydbg on January 03, 2012, 03:38:21 AM
PS: I'm not sure our CC's parser can correctly parse java source files.
You are right that it cannot really understand it, but for simple/quick matters in which it is not worth my time to open a different program, CC works well enough to be useful.
Quote from: MortenMacFly on January 03, 2012, 10:49:38 AM
Implemented in trunk.
Thank you, I will be sure to try it.
A related question: is there any structure in place that I can use to create "on demand" code completion (similar to being able to select the lexer with
Edit->Highlight mode)?
I just realized I forgot to tag the category when I submitted the Java lexer patch.
Is there a way I can add it to the appropriate category? (I am relatively new to BerliOS, so I am unsure if I am simply missing the button.)
I've set the category to Lexer, is this the correct one?
Probably only developers can change the 'advanced' settings of patches, bugs and features.
Quote from: oBFusCATed on January 04, 2012, 02:03:57 AM
I've set the category to Lexer, is this the correct one?
Yes, that is the one; thank you. (You have saved me from being bugged at seeing something out of place :).)
Quote from: oBFusCATed on January 04, 2012, 02:03:57 AM
Probably only developers can change the 'advanced' settings of patches, bugs and features.
OK.
Quote from: Alpha on January 03, 2012, 11:45:38 PM
is there any structure in place that I can use to create "on demand" code completion (similar to being able to select the lexer with Edit->Highlight mode)?
No. And I think it wouldn't really make sense. However, If you change the CC options, usually the project(s) is(are re-scanned.
Quote from: MortenMacFly on January 03, 2012, 09:12:02 AM
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.
True, I actually had in mind to save space... I'll change it.
One question:
How did you move items from one panel to another.
You just select one, then ctrl+X(cut), then ctrl+V(paste) to another panel?
As we can't not multiply select many items, so even cut/paste every items in "Keyword sets to additionally include" are quite annoying. :)
Quote from: ollydbg on January 08, 2012, 06:44:59 AM
As we can't not multiply select many items, so even cut/paste every items in "Keyword sets to additionally include" are quite annoying. :)
No, sure not. You can copy/paste by container, so e.g. by wxStaticBoxSizer.