Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Alpha on March 06, 2012, 11:18:54 pm

Title: CC with keywords
Post by: Alpha on March 06, 2012, 11:18:54 pm
I know in previous versions, CC was able to provide suggestions for non-C-like languages via keyword sets.  However, revision 7862 (CC: applied patch by Darius Markauskas (darmar) to allow foreign CC plugin to take over (basically CC skips file types other than C / C++ now)) seems to have revoked this behavior.  Is there a workaround/option I could use to get this functionality back?
Title: Re: CC with keywords
Post by: ollydbg on March 07, 2012, 06:36:59 am
In the CC option dialog->c/c++ parser(adv) panel, there are some entry that you can specify your own file format support by CC.

Which means, if you custom file is a.abc, you can add "abc" there(no double quote).
Title: Re: CC with keywords
Post by: Alpha on March 07, 2012, 10:47:31 pm
I had looked at that option, however, it has the side effect of additionally trying to parse the files (instead of only supplying keywords from the lexer).
My personal preference in this situation would be to return to CC's prior behavior of keyword suggestion for unsupported file types, adding a blacklist (instead of the current whitelist) which the user - or other plugins - could modify as needed.  (This setting would be separate from the one you mentioned, which tells CC what types of files to parse.)
Title: Re: CC with keywords
Post by: ollydbg on March 12, 2012, 03:37:09 am
I had looked at that option, however, it has the side effect of additionally trying to parse the files (instead of only supplying keywords from the lexer).
Yes, adding the "abc" to that option will let our CC parser to parse them.

Quote
My personal preference in this situation would be to return to CC's prior behavior of keyword suggestion for unsupported file types, adding a blacklist (instead of the current whitelist) which the user - or other plugins - could modify as needed.  (This setting would be separate from the one you mentioned, which tells CC what types of files to parse.)
I'm not fully understand this idea?
Currently, we have a whitelist in our CC option dialog. But what does "blacklist" used for? You mean the files in blacklist can give some "predefined suggestion texts"? event sent to blacklist files will be handled from other plugins?
Title: Re: CC with keywords
Post by: MortenMacFly on March 12, 2012, 10:47:13 am
CC will not parse files to offer the keywords from lexers (lexers are a scintilla thing). I am aware of the drawback described here and I have already discussed with darmar about what we could do best to re-enable that option.

@ollydbg:
The things is: It was the fallback solution in CodeCompletion::CodeComplete(), starting here:
Code
                EditorColourSet* theme = ed->GetColourSet();
                if (theme)

However, that this fired for non-C/C++ files was nice, but technically wrong. So we have to do it properly. The way it was will not return as it was wrong.
Title: Re: CC with keywords
Post by: MortenMacFly on April 07, 2012, 02:08:23 pm
Works again in trunk now and is compatible with the concept of several CC plugins. Credits go to Darius, thanks a lot. :D
Title: Re: CC with keywords
Post by: Alpha on April 07, 2012, 03:47:53 pm
Thank you Darius!

(Hmm, it appears the trunk was just merged; I had better prepare myself for increased awesomeness upon rebuild.)