Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

[Solved] Distracting SymbolBrowser Behaviour

<< < (3/6) > >>

Pecan:
@ tigerbeard
I've managed to re-create the "first test" problem on linux, but not on windows. That would point a finger at a possible problem in wxWidgets (or the way we use it).

I'm using Mint 21.x and wxWidget 3.0 .
On windows 11 I'm using wxWidget 3.2.4

Tell us what wxWidgets version you're using on linux.
And what linux version you're using.
Thanks

Please also see: https://sourceforge.net/p/codeblocks/tickets #1444


--- Quote from: Pecan on January 09, 2024, 08:28:10 pm ---LCC will not be updated to support modern compilers.

--- End quote ---

--- Quote from: tigerbeard ---You mean like LLVM or does that include newer gcc versions?

--- End quote ---
I mean that LCC will not be updated to support any compiler.
At least when it comes to parsing new features for any compilers using  C++11, C++17, C++20, additions etc.
There is not enough CB resources (esp. team resources) to add new C++?? features to LCC.

clangd takes care of that for us. There are also many clangd extensions that we haven't even explored yet. such as suggested fixes while the user is editing (codeActions) and code snippet suggestions while editing.

tigerbeard:

--- Quote from: Pecan on January 10, 2024, 08:20:11 pm ---Tell us what wxWidgets version you're using on linux.
Please also see: https://sourceforge.net/p/codeblocks/tickets #1444

--- End quote ---
Have added the info to the ticket.


--- Quote from: Pecan on January 10, 2024, 08:20:11 pm ---clangd takes care of that for us. There are also many clangd extensions that we haven't even explored yet. such as suggested fixes while the user is editing (codeActions) and code snippet suggestions while editing.

--- End quote ---
Cool, thanks that good to know.

tigerbeard:
Solved by a code fix for next nightly by @pecan, thanks a lot!

And there is an information for the issue from Test1: (Symbol Tree when switching between projects):

* When changing projects in the "Project" tab you must open any code file from the new project before switching to the "Symbols" tab.  I that is done the symbold browser tree will be re-parsed with the correct project. It needs at least one open file from the project.

I will mark the thread closed

Pecan:

--- Quote from: tigerbeard on January 12, 2024, 12:44:36 pm ---Solved by a code fix for next nightly by @pecan, thanks a lot!

And there is an information for the issue from Test1: (Symbol Tree when switching between projects):

* When changing projects in the "Project" tab you must open any code file from the new project before switching to the "Symbols" tab.  I that is done the symbold browser tree will be re-parsed with the correct project. It needs at least one open file from the project.

I will mark the thread closed

--- End quote ---

I'd like to add one important distinction:
We should have used the word activate rather than open.

We do not need to open a file every time we switch to a project in codecompletion plugin, but we do need at least one file of the project open in an editor and activated. Code completion follows the currently activated editor to update the Symbols browser.

To activate an editor, just move the mouse inside that editor (if focus follows mouse) or click inside the editor or it's tab.

Thanks to tigerbeard for his patience, fix and testing.

Pecan:
Request for comment:

Here is the code that creates the root of the ClassBrowser tree. From a separate thread it sends a thread function's local pointer to the main GUI thread which create the root node for the ClassBrowser symbols tree

--- Code: ---void ClassBrowserBuilderThread::FillGUITree(bool top)
{
    CCTree* localTree = top ? m_CCTreeTop : m_CCTreeBottom;

    ... ... ... ... ... code snipped out ... ... ... ...
   
    CCTreeItem* sourceRoot = localTree->GetRootItem();
    if (sourceRoot)
    {
        m_Parent->CallAfter(&ClassBrowser::TreeOperation, ClassBrowser::OpAddRoot, sourceRoot);
        AddItemChildrenToGuiTree(localTree, sourceRoot, true);
        m_Parent->CallAfter(&ClassBrowser::TreeOperation, top ? ClassBrowser::OpExpandRoot : ClassBrowser::OpExpandAll, nullptr);
    }

    ... ... ... ... ... code snipped out  ... .. .. ... .. .. .. ..
}

--- End code ---

1) The variable "sourceRoot" is a local pointer which will be deleted at the end of the function.
2) Even if only the value of "sourceRoot" mattered in the CallAfter() statement "localTree" is also a variable soon to be deleted. (I'm not sure that really matters);
3) The data referenced by the "souceRoot" value (pointer) is subject to change and deletion without the Main GUI threads knowledge.
4) I've verified that the data seen by the GUI can be garbage even though it was perfectly valid when sent from the threads CallAfter() statement.
5) Placing a "wxMilliSleep(128)" after the CallAfter() statement resolved all crashes which, to me indicates a race condition.
6) Note that a CallAfter() simply places the request at the end of the GUI's event queue. No telling when it'll get executed.

What looks to me like "it should work", is, on occasion, causing garbage at the GUI end and crashing CB.

Your thoughts please. I'm not an expert on CallAfter().
Thanks in advance.

 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version