Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
Patch: function arguments added to autocomplete tooltip
p2rkw:
--- Quote ---Currently, all the c/c++ style comments were skipped in the Tokenizer. What I think is: add some kind of comment parser which is independent from the normal c/c++ parser. Use the comment parser to find the comments "around" the Token. Because we have the file/line information in each Token, when we try to show the documents of a specific Token, we can let the comment parser to parse the code snippet around the Token position, and show the comments.
As a conclusion, the comment parser only runs when it needed. Smiley
--- End quote ---
I don't know how to write parser from scratch. This might be lot of work. And lot of file readings may kill performance.
So, I'm going add new token types for /**, /*!, ///, //!, //!<, and store raw documentation comment in Token's object.
I hope that I can modify existing parser a bit? :)
edit: This can be done even without adding new tokens (strings in ParserConsts namespace). I can detect doc comment inside Tokenizer::SkipComments, cache it, and assign to new token in ParserThread::DoAddToken. Is this acceptable hack?
p2rkw:
How actually it's looks like:
http://i.imgur.com/tNVsm.png
http://i.imgur.com/mfIrg.png
I used EmbendedHtmlPanel from defaultmimehandler plugin. How can I use this class without including it's source file?
Alpha:
Slightly unrelated, but I thought I would mention that if one can get the Scintilla lexers to run invisibly (for files not currently open), a relatively simple language independent comment parser can be created with cbStyledTextCtrl::IsComment().
ollydbg:
@p2rkw
I think store comments in Token class will make the Token object bigger. so it(tokentree) will eat more memory. I think Alpha' idea is good.
dmoore:
--- Quote from: ollydbg on December 09, 2012, 07:47:01 am ---@p2rkw
I think store comments in Token class will make the Token object bigger. so it(tokentree) will eat more memory. I think Alpha' idea is good.
--- End quote ---
But i would think using the CC parser is necessary to figure out which comments are doc strings and what CC object they correspond to? Maybe don't need the doc strings in memory, just line/file reference.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version