Recent Posts

Pages: 1 2 3 [4] 5 6 7 8 9 10
31
Using Code::Blocks / Re: Can't add X11 to search directory
« Last post by sodev on January 17, 2022, 09:22:59 pm »
On the other hand, whoever is building the flatpak could simply update the permissions to allow access to the host filesystem, depending on security requirements read-only to (almost) everything and write-access only to the home directory.
32
Using Code::Blocks / Re: Can't add X11 to search directory
« Last post by AzureZero on January 17, 2022, 08:14:17 pm »
Yeah I found that out after the terminal didn't see Codeblocks as a program.

Thanks for helping me through this as I would not of expected it to be an issue of the software centre choosing a flatpak installation which has issues.

It might be a good idea to pin that Flatpak installs will likely have issues, and that installation should be done via the terminal and not the software centre as the software centre may only install flatpak versions when a non-flatpak version is available via the terminal.
It should also help lessen the chance of this problem coming up again and causing two or more people to bang their head against a coding wall. Well one sign of the issue for checking is if headers in the usr/include folder can't be found, it likely is a flatpak installation issue.

Maybe a pinned FAQ of problems could help folks find some of the rare problems and it's solution.
33
Contributions to C::B / Re: Code::Blocks' translation
« Last post by LETARTARE on January 17, 2022, 04:37:27 pm »
Thanks for your tests.

In doubt I recompiled 'wx-315' and the size of the result was different from the old one, even though I used the same source and the same compiler and the same build script ??
With this recompiled version, no more problem with your translation files compiled by 'Poedit'.

Thanks for the translations.
34
Help / [SOLVED] Squirrel Build Script Syntax Error: expected 'IDENTIFIER'
« Last post by The_GTA on January 17, 2022, 04:18:37 pm »
Dear CB community, I have compiled the most recent Code::Blocks nightly revision 12655 on Ubuntu 20.04 using wxWidgets 3.1.5, GTK 3. When I try to run any of my Code::Blocks Squirrel build scripts I receive the following error:



Quote
Invalid build script: script
First seen in: project
Error:
  expected 'IDENTIFIER'

Content of the script:
Code
function SetBuildOptions(base)
{

}

What do I have to do to fix it? Please help me!
35
Help / Re: Linux C::B Nightly r12639 variable expansion query/help
« Last post by sodev on January 17, 2022, 03:23:20 pm »
It was my setup. To fix it I had to do the following:
    curl -O http://archive.ubuntu.com/ubuntu/pool/universe/w/wxwidgets3.0/libwxgtk3.0-gtk3-dev_3.0.5.1+dfsg-2_amd64.deb
    dpkg -i libwxgtk3.0-gtk3-dev_3.0.5.1+dfsg-2_amd64.deb

This is not the way how to install packages from repositories, you better add the required repositories to your configuration and download the package through apt. Manually installing like this is asking for trouble.
36
Plugins development / Re: Code completion using LSP and clangd
« Last post by ollydbg on January 17, 2022, 02:56:17 pm »
I see there are many pch files in the folder such as:

C:\Users\[myusername]\AppData\Local\Temp\preamble-c7460b.pch

I think those files is created by clangd, and are there any way to automatically delete them when exit C::B?

EDIT:

clangd writes too much disk : CPP-19402

This discussion looks like the pch can keep in "memory". :)

Here is the patch to fix this pch file issue:

Code
 clangd_client/src/LSPclient/src/client.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/clangd_client/src/LSPclient/src/client.cpp b/clangd_client/src/LSPclient/src/client.cpp
index 88f5f8f..f6b5eb9 100644
--- a/clangd_client/src/LSPclient/src/client.cpp
+++ b/clangd_client/src/LSPclient/src/client.cpp
@@ -266,6 +266,10 @@ ProcessLanguageClient::ProcessLanguageClient(const cbProject* pProject, const ch
 
     command += " --limit-results=20";              // Limit the number of results returned by clangd. 0 means no limit (default=100)
 
+    // clangd writes too much disk : CPP-19402 https://youtrack.jetbrains.com/issue/CPP-19402
+    // "-pch-storage=memory"
+    command += " -pch-storage=memory";
+
     if (wxDirExists(clangResourceDir))
         command += " --resource-dir=" + clangResourceDir;  // Directory for system includes
 
37
Plugins development / Re: Code completion using LSP and clangd
« Last post by ollydbg on January 17, 2022, 01:14:47 pm »
I see some error message comes from this function call, but I'm not sure why, this happens when I'm editing source file in the C::B editor.

Code
int ProcessLanguageClient::ReadLSPinputLength()
// ----------------------------------------------------------------------------
{
    // this function is driven by readJson() via the thread in transport::loop()
    // and the incoming data is locked.
    // thread was started in constructor and called from readJason() after locking the buffer

    // "Content-Length: <digits>\r\n\r\n"

    if (Has_LSPServerProcess() and m_std_LSP_IncomingStr.length())
    {
        // search for LSP header
        size_t hdrPosn = m_std_LSP_IncomingStr.find("Content-Length: ");
        if (hdrPosn == std::string::npos)
            return wxNOT_FOUND;
        else //have incoming text
        {
            if (hdrPosn != 0)   // verify LSP header is at beginning of buffer
            {
                // Error: header is not at beginning of buffer. Try to fix it.
                // usually caused by clangd invalid utf8 sequence
                wxString msg(wxString::Format("ERROR:%s(): buffLength (%d): Position of content header %d.\n",
                             __FUNCTION__, int(m_std_LSP_IncomingStr.length()), int(hdrPosn)) );
                msg += "Buffer contents written to client log.";
                #if defined(cb_DEBUG)
                    wxSafeShowMessage("Input Buffer error",msg);
                #endif
                msg += "LSP_IncomingStrBuf:\n" + m_std_LSP_IncomingStr + "\n";
                writeClientLog(msg);
                // adjust the data buf to get clangd header at buff beginning
                m_std_LSP_IncomingStr = m_std_LSP_IncomingStr.substr(hdrPosn);
            }

I just enabled the log file, and see the log message(in C:\Users\[myusername]\AppData\Local\Temp\CBclangd_client-1332.log

And the content of the log file are:

Code
19:45:09.758 ERROR:ReadLSPinputLength(): buffLength (549): Position of content header 112.
Buffer contents written to client log.LSP_IncomingStrBuf:
":{"newText":"wxConvAuto($0)","range":{"end":{"character":16,"line":94},"start":{"character":12,"line":94}}}}]}}Content-Length: 414



{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"category":"Parse Issue","code":"expected_unqualified_id","codeActions":[],"message":"Expected unqualified-id","range":{"end":{"character":14,"line":97},"start":{"character":12,"line":97}},"relatedInformation":[],"severity":1,"source":"clang"}],"uri":"file:///F:/test/Config.cpp","version":1}}
38
Plugins development / Re: Code completion using LSP and clangd
« Last post by ollydbg on January 17, 2022, 12:32:16 pm »
I see there are many pch files in the folder such as:

C:\Users\[myusername]\AppData\Local\Temp\preamble-c7460b.pch

I think those files is created by clangd, and are there any way to automatically delete them when exit C::B?

EDIT:

clangd writes too much disk : CPP-19402

This discussion looks like the pch can keep in "memory". :)
39
Development / Re: event sequence question?
« Last post by AndrewCot on January 17, 2022, 10:32:01 am »
I was looking at the header guard and the other plugins by same author last night and they were not included because they can cause bad side affects if not used/configured correctly. As such these are probably not the best to use as a template.

Headerguard info:    URL info: https://wiki.codeblocks.org/index.php/Header_Guard_plugin    Problem:  The Header Guard plugin is included in Code::Blocks' source code (src/plugins/headerguard/), however, it is not built by default to prevent unexpected behavior.
It would probably be better to do one f the following:1) Create the cbplugin via the project file and leave it up toe the dev to manually install it2) Create the plugin in the devel directory but mod the profess so it does not copy the files to the output directory so it does not get released, but can be used when running he C::B as a debugee.3) Do both options 1 and 2
I am inclined to think option 3 would benefit the developers the most.
40
Development / Re: event sequence question?
« Last post by Miguel Gimenez on January 17, 2022, 09:40:24 am »
I read somewhere that this plugin should be treated like the headerguard, i.e. a core plugin not added to the main project. I think this is the better solution, this way you can install it if needed but it will never go in the nightly/release.
Pages: 1 2 3 [4] 5 6 7 8 9 10