Recent Posts

Pages: 1 2 3 4 [5] 6 7 8 9 10
41
Nightly builds / The 01 October 2022 build (12932) is out.
« Last post by killerbot on October 01, 2022, 05:05:21 pm »
We switched to wx 3.2.1 (on 01 October 2022) --> download the new wx dll's see link below

Get quick announcements through the RSS feed http://www.codeblocks.org/nightly/CodeBlock_RSS.xml

Before you use a nightly make sure you understand how it works.

A link to the unicode windows wxWidget dll(s) for Code::Blocks : https://sourceforge.net/projects/codeblocks/files/Binaries/Nightlies/Prerequisites/wxmsw32u_gcc_cb_wx321_2D_gcc810-mingw64.7z
A link to Mingw64 dll's needed by Code::Blocks : http://sourceforge.net/projects/codeblocks/files/Binaries/Nightlies/Prerequisites/Mingw64dlls8.1.0.7z


The 01 October 2022 build is out.
  - Windows :
   http://sourceforge.net/projects/codeblocks/files/Binaries/Nightlies/2022/CB_20221001_rev12932_win64.7z
  - Linux :
   none

The current SDK version is : 2.22.0

Resolved Fixed:

  • wxSmith: Fix blurry tool icons in HiDPI on wxWidgets >= 3.1.6
  • Debugger: Fix pane's button sizes with HiDPI for wxWidgets >= 3.1.6.
  • CodeCompletion: Remove all project's parsers (ticket #1316, thanks Christo).
  • Reduce start time using SVG for message pane icon.
  • ThreadSearch: Fix HiDPI with wxWidgets >= 3.1.6.

Regressions/Confirmed/Annoying/Common bugs:


    42
    General (but related to Code::Blocks) / Re: Welcome Newcomers - PLEASE READ!!!
    « Last post by fba1974 on October 01, 2022, 12:59:06 pm »
    I am new, I am here.
    43
    Development / Re: Crash when using with SVG files
    « Last post by AndrewCot on October 01, 2022, 10:46:51 am »
    Straight up: I am not happy with the process used and the way the SVN changes have been made.
    Going forward:
     Can a new interface be added so that the changes in the vast majority of code calls one function/class and this class/function has the smarts to either use the existing PNG or the new SVG files. This has the advantage on only modifying the existing code:
    • Once
    • Allows for the removal of the PNG support without changing the C::B source files
    • updates as needed without modifying the existing C::B code after the initial change.
    • Existing C::B code does not have any #if..#else..#endif block
    44
    Development / Crash when using with SVG files
    « Last post by Miguel Gimenez on October 01, 2022, 09:40:21 am »
    I am adapting the code to HiDPI after wx3.1.6 using wxBitmapBundle (see ticket #1297 for details), and I have discovered that wxBitmapBundle::FromSVG() method produces random crashes because the underlying library (nanoSVG) is buggy:
      - first crash is in nsvg_Parse(). This only happens on non-english locales, is fixed in nanoSVG trunk but not in wxWidgets, and a workaround is locale switching before calling FromSVG().
      - second crash is in nsvg__addEdge(). AFAIK this is not fixed and there is no workaround.

    Because of this, I will temporarily remove calls to wxBitmapBundle::FromSVG() along this weekend.
    45
    Plugins development / Re: Code completion using LSP and clangd
    « Last post by ollydbg on October 01, 2022, 01:47:51 am »
    Since i have seen quite some string encoding related issues in this thread and many try-and-error attempts to solve them, i want to add my two cents to these issues.

    Never do this:
    Code
    wxString contentsValue = contents.at("value").get<std::string>();

    This converts the std::string into a wxString using the currently set C++ locale. A locale set in CodeBlocks. But this std::string does not come from CodeBlocks. Also, std::string has, at least on Windows, no support for UTF-8. However, this doesn't stop anyone from putting UTF-8 into such a string. As long as you don't use methods that depend on the locale, this is fine. The code snippet above does depend on the locale.

    Now these two lines:
    Code
    std::string contentsValueStdString = contents.at("value").get<std::string>();
    wxString contentsValue(contentsValueStdString.c_str(), wxConvUTF8);

    These lines manually convert the std::string to a wxString by telling the wxString object that the std::string does contain UTF-8. Since the user post says this does fix the issue, apparently there is UTF-8 inside that std::string.

    I suggest you figure out what encoding Clang does use and then check your code if you rely anywhere else on such automatic conversions. Also, wxWidgets offers the build option wxNO_UNSAFE_WXSTRING_CONV to disable such implicit conversions, but i am not sure if this does also work for std::string, they mention only C-Strings.

    Hi, sodev, thanks for the advice.

    If I remember correctly, the clangd_client use the UTF-8 format for it's input source. Normally I use UTF-8 for my source code, but my system(Windows) locale is not UTF-8.

    I see that clangd's document: Protocol extensions UTF-8 offsets

    It said it can support UTF-8.
    46
    Plugins development / Re: Code completion using LSP and clangd
    « Last post by sodev on September 30, 2022, 08:22:14 pm »
    Since i have seen quite some string encoding related issues in this thread and many try-and-error attempts to solve them, i want to add my two cents to these issues.

    Never do this:
    Code
    wxString contentsValue = contents.at("value").get<std::string>();

    This converts the std::string into a wxString using the currently set C++ locale. A locale set in CodeBlocks. But this std::string does not come from CodeBlocks. Also, std::string has, at least on Windows, no support for UTF-8. However, this doesn't stop anyone from putting UTF-8 into such a string. As long as you don't use methods that depend on the locale, this is fine. The code snippet above does depend on the locale.

    Now these two lines:
    Code
    std::string contentsValueStdString = contents.at("value").get<std::string>();
    wxString contentsValue(contentsValueStdString.c_str(), wxConvUTF8);

    These lines manually convert the std::string to a wxString by telling the wxString object that the std::string does contain UTF-8. Since the user post says this does fix the issue, apparently there is UTF-8 inside that std::string.

    I suggest you figure out what encoding Clang does use and then check your code if you rely anywhere else on such automatic conversions. Also, wxWidgets offers the build option wxNO_UNSAFE_WXSTRING_CONV to disable such implicit conversions, but i am not sure if this does also work for std::string, they mention only C-Strings.
    47
    Using Code::Blocks / Re: Codebocks for windows
    « Last post by sergvnovg on September 30, 2022, 10:21:14 am »
    Understood.
    A third party software product modifies system variables.
    I launch CbLauncher. Everything is working.
    Thanks!
    48
    Plugins development / Re: Code completion using LSP and clangd
    « Last post by ollydbg on September 30, 2022, 09:14:17 am »
    OK, I think I have fixed this issue by using such patch:

    Code
    From 8523dd2bd9a58d1780c3d2efe9459f7e5fccfb41 Mon Sep 17 00:00:00 2001
    From: hide<hide@hide.hide>
    Date: Fri, 30 Sep 2022 15:11:28 +0800
    Subject: fix the wrong tip code when Chinese comment is used


    diff --git a/clangd_client/src/codecompletion/parser/parser.cpp b/clangd_client/src/codecompletion/parser/parser.cpp
    index 2b9c5ea..3ddde25 100644
    --- a/clangd_client/src/codecompletion/parser/parser.cpp
    +++ b/clangd_client/src/codecompletion/parser/parser.cpp
    @@ -2546,7 +2546,8 @@ void Parser::OnLSP_HoverResponse(wxCommandEvent& event, std::vector<ClgdCCToken>
             if (not valueItemsCount) return;
     
             json contents = pJson->at("result").at("contents");
    -        wxString contentsValue = contents.at("value").get<std::string>();
    +        std::string contentsValueStdString = contents.at("value").get<std::string>();
    +        wxString contentsValue(contentsValueStdString.c_str(), wxConvUTF8);
     
             // Example Hover contents: L"instance-method HelloWxWorldFrame::OnAbout\n\nType: void\nParameters:\n- wxCommandEvent & event\n\n// In HelloWxWorldFrame\nprivate: void HelloWxWorldFrame::OnAbout(wxCommandEvent &event)"
             // get string array of hover info separated at /n chars.
    @@ -2670,7 +2671,8 @@ void Parser::OnLSP_SignatureHelpResponse(wxCommandEvent& event, std::vector<cbCo
             json signatures = pJson->at("result").at("signatures");
             for (size_t labelndx=0; labelndx<signatureCount && labelndx<10; ++labelndx)
             {
    -                wxString labelValue = signatures[labelndx].at("label").get<std::string>();
    +                std::string labelValueStdString = signatures[labelndx].at("label").get<std::string>();
    +                wxString labelValue(labelValueStdString.c_str(), wxConvUTF8);
                     v_SignatureTokens.push_back(cbCodeCompletionPlugin::CCCallTip(labelValue));
             }
     


    I'm not sure the second hunk is needed, but the first hunk is the true fix.
    49
    Plugins development / Re: Code completion using LSP and clangd
    « Last post by ollydbg on September 30, 2022, 08:25:07 am »
    I'm not quite understand the code, when I read the source code of clangd_client, I see this:

    Code
            size_t resultCount = pJson->at("result").size();
            if (not resultCount) return;

            // Nothing for ShowCalltip is ever in the signature array //(ph 2021/11/1)
            // Show Tootip vs ShowCalltip is so damn confusing !!!
            // **debugging**std::string dumpit = pJson->dump();

            size_t signatureCount = pJson->at("result").at("signatures").size();
            if (not signatureCount) return;

            json signatures = pJson->at("result").at("signatures");
            for (size_t labelndx=0; labelndx<signatureCount && labelndx<10; ++labelndx)
            {
                    wxString labelValue = signatures[labelndx].at("label").get<std::string>();
                    v_SignatureTokens.push_back(cbCodeCompletionPlugin::CCCallTip(labelValue));
            }

    I'm not sure, but it looks like:

    Code
    wxString labelValue = signatures[labelndx].at("label").get<std::string>();

    get<std::string>() should return a std::string.

    Do we need to convert it to wxString?
    50
    Plugins development / Re: Code completion using LSP and clangd
    « Last post by ollydbg on September 30, 2022, 07:21:58 am »

    What is the variable(s) or name(s) that cause the issue. So that I can try to catch it in the debugger.

    Can you give me some code that causes the issue.
    So far, I have not been able to re-create the problem.

    See a minimal code below:

    Code
    #include <iostream>
    #include <fstream>

    using namespace std;

    // this file is not used any more?
    // std::ofstream txtFile;                                 ///< txt信息
    std::ofstream m_TcpFile;                                  ///< TCP接收的数据

    int main()
    {
        cout << "Hello world!" << endl;
        return 0;
    }


    My guess is that it is an encoding/decoding error?

    Here is the screen shot in attachment.


    EDIT

    It looks like the comment after the variable definition cause this issue:

    Code
    ///< TCP接收的数据

    If I remove this comment, the tooltip showns correctly.


    The minimal sample can be simplified to:

    Code
    int m_TcpFile;  ///< TCP接收的数据

    int main()
    {
        return 0;
    }

    Pages: 1 2 3 4 [5] 6 7 8 9 10