Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
CC plugin interface redesign
Alpha:
--- Quote from: oBFusCATed on July 04, 2013, 07:28:51 pm ---Have I said something about swapping. :)
--- End quote ---
Of course you did.
--- Quote from: oBFusCATed on July 03, 2013, 04:06:14 pm ---3. The UI should be unified, but it should be filled by the CC plugin. Because if you leave it to plugins
then will have clang symbol browser, symbol browser, fortran symbol browser, python symbol browser, etc, etc,
and we should swap everything.
--- End quote ---
:D
--- Quote from: oBFusCATed on July 04, 2013, 07:28:51 pm ---Probably start from here: http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide
--- End quote ---
Thanks; I have read through most of that now.
@devs: I can work with either git or on a branch in the main svn repository; what would be most useful to you?
--- Quote from: Josh @ Dreamland on July 05, 2013, 06:36:38 pm ---Hi there; I hope no one minds an "outsider" weighing in. :)
--- End quote ---
In the design stage, my opinion is: the more thoughts, the better.
--- Quote from: oBFusCATed on July 04, 2013, 10:08:43 pm ---Another task I have in mind is one very simple keyword-like cc plugin that works for unsupported files (php, python, lua, etc).
--- End quote ---
--- Quote from: Folco on July 05, 2013, 06:31:56 pm ---You think to a cc based on the xml files of Scintilla lexers ?
--- End quote ---
Currently CC has a fallback of providing suggestions from the keyword sets in the lexers for non-C/C++. After the sdk is modified, I would like to extract this code into a simple keyword-CC plugin. Keyword-CC could also tokenize the active file, and store terms for autocompletion when the word length is longer than, for example, 5 characters.
--- Quote from: oBFusCATed on July 05, 2013, 06:48:43 pm ---If we have to have plugins for the plugins, then something is wrong. :)
--- End quote ---
Agreed, but some day when another attempt is made a semantic highlighting, we will have to revisit this problem. (Semantic highlight would need the knowledge of the parser, but should be a separate plugin from CC.)
I will try to post some code later today or tomorrow with a candidate new plugin interface. (Apologies; my programming is going slowly due to personal life issues.)
oBFusCATed:
--- Quote from: Alpha on July 05, 2013, 10:34:14 pm ---Of course you did.
--- End quote ---
I meant something totally different here, I think.
--- Quote from: Alpha on July 05, 2013, 10:34:14 pm ---Agreed, but some day when another attempt is made a semantic highlighting, we will have to revisit this problem. (Semantic highlight would need the knowledge of the parser, but should be a separate plugin from CC.)
--- End quote ---
I'd implement it in the SDK or in the Main app, again.
Alpha:
--- Quote from: oBFusCATed on July 05, 2013, 10:49:14 pm ---
--- Quote from: Alpha on July 05, 2013, 10:34:14 pm ---Of course you did.
--- End quote ---
I meant something totally different here, I think.
--- End quote ---
*facepalm* ... I was joking; look back at your original post, I modified the quote.
Alpha:
--- Code: ---class PLUGIN_EXPORT cbCodeCompletionPlugin : public cbPlugin
{
public:
struct FunctionRange
{
FunctionRange(const wxString& nm, int startLn, int endLn) : name(nm), startLine(startLn), endLine(endLn) {}
wxString name;
int startLine;
int endLine;
};
struct ScopeRange
{
ScopeRange(const wxString& nm) : name(nm) {}
wxString name;
std::vector<FunctionRange> functions;
};
typedef std::vector<ScopeRange> ScopeRangesVec;
cbCodeCompletionPlugin();
virtual void CodeComplete(int tokenStartPos, int index, const wxString& token) = 0;
virtual wxArrayString GetAutocompList(int& tokenStartPos, bool isAutoLaunch) = 0;
virtual wxArrayString GetAutoLaunchStrings() = 0;
virtual wxString GetAutocompDoc(int index, const wxString& token) = 0;
virtual wxString GetDocAt(int pos) = 0;
virtual wxArrayString GetCallTips(int pos) = 0;
virtual wxArrayString GetToolTips(int pos) = 0;
virtual wxString GetFullSymbolAt(int pos) = 0;
virtual ScopeRangesVec GetScopes() = 0;
virtual bool IsProviderFor(cbEditor* ed) = 0;
};
--- End code ---
Thoughts?
golgepapaz:
care to elaborate further? what is function range? scope range?
What does GetScopes(), GetFullSymbolAt() do ? What is index?
Some traits classes should be added. Instead of just using simple
string arrays. Don't you want to know what kind of a completion it is
(function, variable,type, macro etc..). What context is it in? (member access,
function scope, translation unit level,file level etc.)
Since no filename is mentioned I am thinking one supposed to use
active editor right? This should be more generic and pass the filename
or better yet buffer as well
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version