Author Topic: Code completion issues : Nightly build 13231  (Read 6004 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code completion issues : Nightly build 13231
« Reply #15 on: April 06, 2023, 02:47:44 am »
Hi,
I dont double click on .cbp file.
I always use cblauncher directly.
I use cblauncher everyday too.
OK. Maybe it is a bug.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline draughlin

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Code completion issues : Nightly build 13231
« Reply #16 on: April 06, 2023, 03:53:56 am »
Hi Olly!
I tried again with a fresh install of svn 13231 (fourth time) with cblauncher.exe, and this time all went as it should. I could not reproduce the problems I had before. I managed to swap between "code completion" plugin and "clangd_client" plugin several times without issue. Perhaps I had a corruption in settings (default.conf under local AppData folder that cblauncher uses.) I have about ten different compilers and cross compilers installed. So I am at a loss to explain it to my satisfaction.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code completion issues : Nightly build 13231
« Reply #17 on: April 06, 2023, 04:16:06 am »
Hi Olly!
I tried again with a fresh install of svn 13231 (fourth time) with cblauncher.exe, and this time all went as it should. I could not reproduce the problems I had before. I managed to swap between "code completion" plugin and "clangd_client" plugin several times without issue. Perhaps I had a corruption in settings (default.conf under local AppData folder that cblauncher uses.) I have about ten different compilers and cross compilers installed. So I am at a loss to explain it to my satisfaction.

I have just read/debug some of the config file reading like:

Code
wxString CfgMgrBldr::FindConfigFile(const wxString& filename)
{

    wxString u(ConfigManager::GetUserDataFolder() + wxFILE_SEP_PATH + filename);
    wxString exePath(::DetermineExecutablePath());
    wxString e(exePath + wxFILE_SEP_PATH + filename);

    if (!ConfigManager::has_alternate_user_data_path && ::wxFileExists(e))
    {
        ConfigManager::SetUserDataFolder(exePath);
        return e;
    }
    if (::wxFileExists(u))
    {
        return u;
    }
    return wxEmptyString;
}

I can't see the error in the code. I'm grad that it works OK now in your PC.

I think you can use different files when you have different settings, for example:

Code
CbLauncher.exe -p myclangd

In the above command, a file named myclangd.conf will be created which contains its own user setting, not the default.conf.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline draughlin

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Code completion issues : Nightly build 13231
« Reply #18 on: April 06, 2023, 04:25:24 am »
Thanks Olly!
Will try that.