Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
Pseudo semantic highlighting
MortenMacFly:
--- Quote from: Alpha on January 17, 2013, 03:19:28 am ---however, I do not exactly understand the concept of a mutex very well; is it needed here?
--- End quote ---
A mutex is used where the tree could be accessed in parallel (i.e. from another thread), to avoid freezes. Usually accessing the token tree always requires a lock, unless it has been set from the caller function already. I'll have a look but later...
Alpha:
--- Quote from: MortenMacFly on January 17, 2013, 04:19:37 pm ---There is also the drawback, btw: I noticed really massive slow-downs when opening an editor of a large file with many references to highlight. Do you experience the same?
--- End quote ---
I have not tried opening anything extremely large yet... is the slow-down constant, or is it a pause when you switch to the tab? (I could probably increase performance by switching to a hash instead of an array to insure unique entries.)
--- Quote from: Alpha on January 17, 2013, 12:02:49 am ---This patch currently only hooks into the editor activated event, so you need to switch editors/close reopen editors (after initial parsing has finished) for colors to show up.
--- End quote ---
I forgot to mention, this second patch adds one other event: color all open editors when parsing completes.
MortenMacFly:
--- Quote from: Alpha on January 17, 2013, 04:45:07 pm ---I have not tried opening anything extremely large yet... is the slow-down constant, or is it a pause when you switch to the tab?
--- End quote ---
It seems as soon as I switch... I'll report back once I have played the second one.
Alpha:
Debug timing code attached. Which algorithm yields better performance (especially on larger files where performance actually matters) on your machine?
Keep in mind that the first run on an editor will be skewed because:
--- Code: --- if (token->m_Ancestors.empty())
tree->RecalcInheritanceChain(token);
--- End code ---
will change performance after the first run (so only pay attention to later runs on an editor).
ollydbg:
You add four stopwatches, and four type of tokens(keywords) were colourised. Can you tell me what kind of tokens for what stopwatch?
1,Variable?
2,Function?
3,Class?
4,?
I'm totally confused.
When tested, I see that only scan the current files token is NOT necessary, E.g.
--- Code: ---class MyFrame: public wxFrame
--- End code ---
You can see that "wxFrame" will not be colourised because its token belong to another source file/header.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version