Recent Posts

Pages: 1 ... 5 6 7 8 9 [10]
91
Plugins development / Re: Code completion using LSP and clangd
« Last post by Pecan on January 15, 2022, 06:59:46 pm »
Hi, I try to debug this plugin, but I have always have this line hit:


I have always get the m_CodeCompletionEnabled is false, and I have no idea how to enable it.

What I did is like below:

1, I have build a normal cbp:

Code
D:\code\cb\cb_sf_git\cccrash2019\src\CodeBlocks_wx31_64.cbp

I just build it.

2, I just open the downloaded clangd_client project, and I changed some build options:

In the build option custom variables, I set the variable:  TARGET_DEVEL_DIR
as the value: D:\code\cb\cb_sf_git\cccrash2019, which is the root folder of my local C::B git/svn

3, I changed the output filename as:
Code
$(TARGET_DEVEL_DIR)\src\devel31_64\share\CodeBlocks\plugins\clangd_client.dll

which means the build target(clangd_client.dll) will be put in the same folder as the other core plugins.

4,  I set the Execution working dir as:

Code
$(TARGET_DEVEL_DIR)\src\devel31_64

Which is the folder where codeblocks.exe locates.

5,  I change the post build script as:

Code
cmd /c if not exist $(TARGET_DEVEL_DIR)\src\devel31_64\share\CodeBlocks mkdir $(TARGET_DEVEL_DIR)\src\devel31_64\share\CodeBlocks
zip -jq9 $(TARGET_DEVEL_DIR)\src\devel31_64\share\CodeBlocks\clangd_client.zip src/resources/manifest.xml src/resources/*.xrc
zip -r9  $(TARGET_DEVEL_DIR)\src\devel31_64\share\CodeBlocks\clangd_client.zip src/resources/images > nul

This means I make a clangd_client.zip, and put it in the destination devel31_64 folder.

The variable m_CodeCompletionEnabled should,in fact, be false.
Note that the line:     m_CodeCompletionEnabled = ccmcfg->ReadBool(_T("/code_completion"), false);

is asking if the old code_completion is enabled. It not asking if "/clangd_client" is enabled.
"/code_completion" must be disabled for clangd_client to run.
I'll change the comments to make that clearer.

Edit: 2022/01/15 10:30
I might be wrong about this. I'll do more checking.

The .cbp you've created look good.

Just a little more information.

Run or debug the CB you created the plugin for.
In the menu for the running debugged/run CB
Go to MainMenu=>Plugins=>Manage Plugins and tell us what the clangd_client plugin version is:


92
Contributions to C::B / Re: Code::Blocks' translation
« Last post by gd_on on January 15, 2022, 06:56:46 pm »
Quote
''All_codeblocks_All_codeblocks-fr.mo' that I renamed 'codeblocks-fr.po'
Are you sure ? The extension should stay .mo (a compiled form), not .po (a text form).

More, on launchpad (https://translations.launchpad.net/codeblocks-gd) you can download a .po file, but you can also download a .mo file which should be directly usable in Code::Blocks
93
Contributions to C::B / Re: Code::Blocks' translation
« Last post by Miguel Gimenez on January 15, 2022, 06:17:57 pm »
If you debug the devel version (compile the workspace and press F8) and press stop in the popup, the culprit will appear on screen.
94
Contributions to C::B / Re: Code::Blocks' translation
« Last post by LETARTARE on January 15, 2022, 05:40:24 pm »
Hello,
I just loaded the file 'All_codeblocks_All_codeblocks-fr.po' to test it on 'CB-12467-wx315'.
Under Win7 with "Poedit-3.0.1', I got ''All_codeblocks_All_codeblocks-fr.mo' that I renamed 'codeblocks-fr.po', then dropped in "$(APP_PATH)\share\CodeBlocks\locale\fr_FR"

At the start of "cb-12647"
  - without this file: no problem
  - with this file and choice 'French' in Settings : an argument window appears twice (see attachment)

This message is provided in "wx-3.1.5\src\common\menucmn.cpp" during the second "wxCHECK_MSG"
Code
wxMenuItem* wxMenuBase::Insert(size_t pos, wxMenuItem *item)
{
    wxCHECK_MSG( item, NULL, wxT("invalid item in wxMenu::Insert") );

    if ( pos == GetMenuItemCount() )
    {
        return DoAppend(item);
    }
    else
    {
        wxCHECK_MSG( pos < GetMenuItemCount(), NULL,
                     wxT("invalid index in wxMenu::Insert") );

        return DoInsert(pos, item);
    }

I looked for the deadlines of code, and the tracks are numerous, I found in
Quote
ProjectManagerUI::CreateMenu(wxMenuBar* menuBar)
a possibility with 'GetMenuiItemCount ()' and 'Insert(...)' corresponding to the image provided:
Quote
menu->Insert(menu->GetMenuItemCount() - 1, idMenuFileProperties, _("Properties..."));

I then deleted the translation of "Properties ..." into the * .mo file, but the result is unchanged, so it must be elsewhere ...

If you have tracks ?


95
Plugins development / Re: Code completion using LSP and clangd
« Last post by ollydbg on January 15, 2022, 02:15:44 pm »
Hi, I try to debug this plugin, but I have always have this line hit:

Code
// ----------------------------------------------------------------------------
void CodeCompletion::OnAttach()
// ----------------------------------------------------------------------------
{
    AppVersion appVersion;
    appVersion.m_AppName = "clangd_client";
    // Set current plugin version
PluginInfo* pInfo = (PluginInfo*)(Manager::Get()->GetPluginManager()->GetPluginInfo(this));
pInfo->version = appVersion.GetVersion();

    // ccmanager's config obtained from Menu=>Settings=>Editor=>Code Completion (sub panel)
    // Get the CB config item that enables CodeCompletion
    ConfigManager* ccmcfg = Manager::Get()->GetConfigManager(_T("ccmanager"));
    m_CodeCompletionEnabled = ccmcfg->ReadBool(_T("/code_completion"), false);
    if (not m_CodeCompletionEnabled)
    {
        pInfo->version = pInfo->version.BeforeFirst(' ') + " Inactive";
        return;
    }


I have always get the m_CodeCompletionEnabled is false, and I have no idea how to enable it.

What I did is like below:

1, I have build a normal cbp:

Code
D:\code\cb\cb_sf_git\cccrash2019\src\CodeBlocks_wx31_64.cbp

I just build it.

2, I just open the downloaded clangd_client project, and I changed some build options:

In the build option custom variables, I set the variable:  TARGET_DEVEL_DIR
as the value: D:\code\cb\cb_sf_git\cccrash2019, which is the root folder of my local C::B git/svn

3, I changed the output filename as:
Code
$(TARGET_DEVEL_DIR)\src\devel31_64\share\CodeBlocks\plugins\clangd_client.dll

which means the build target(clangd_client.dll) will be put in the same folder as the other core plugins.

4,  I set the Execution working dir as:

Code
$(TARGET_DEVEL_DIR)\src\devel31_64

Which is the folder where codeblocks.exe locates.

5,  I change the post build script as:

Code
cmd /c if not exist $(TARGET_DEVEL_DIR)\src\devel31_64\share\CodeBlocks mkdir $(TARGET_DEVEL_DIR)\src\devel31_64\share\CodeBlocks
zip -jq9 $(TARGET_DEVEL_DIR)\src\devel31_64\share\CodeBlocks\clangd_client.zip src/resources/manifest.xml src/resources/*.xrc
zip -r9  $(TARGET_DEVEL_DIR)\src\devel31_64\share\CodeBlocks\clangd_client.zip src/resources/images > nul

This means I make a clangd_client.zip, and put it in the destination devel31_64 folder.




96
Development / Re: event sequence question?
« Last post by Miguel Gimenez on January 15, 2022, 11:39:59 am »
I have just added the plugin.

It is isolated from the workspaces and autotools, so it must be compiled explicitly if wanted (and should be disabled when not needed).
97
Help / Re: Linux C::B Nightly r12639 variable expansion query/help
« Last post by AndrewCot on January 15, 2022, 09:51:32 am »
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

Once I have got C::B building on LM 20.3 I will need to supply a new WIKI page for setting it up for development.
98
Help / Linux C::B Nightly r12639 variable expansion query/help
« Last post by AndrewCot on January 15, 2022, 08:20:33 am »
On my Linux Mint 20.3 and Xubuntu 20.04 virtual box guests I cannot get the <Add option="`$(WX_CONFIG) --cflags`" /> to work with the Nightly r12639, it does not expand to anything (aka empty string) in the build log and therefore I cannot use the CodeBlocks_wx30-unix.cbp to build C::B without hacking the project file to manually change the $(WX_CONFIG) to wx_config. Hopefully it's just a config issues somewhere, but I cannot find it.

Do other linux devs using r12639 have any issues with <Add option="`$(WX_CONFIG) --cflags`" />  ? If you have a different C::B version do you have an issue or not? Please post you result and which SVN version so I can go back to a working version and then start bisecting until I find the issue, unless it's my setup.....

Below are details of the issue debugging output are below:

BUILD LOG SNIPPET:
Code
	-D__START__1__
        wx-config --toolkit=gtk3 --cflags
-D__START__2__
-D__START__3__
        -I/usr/lib/x86_64-linux-gnu/wx/include/base-unicode-3.0 -I/usr/include/wx-3.0  -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -pthread pkg-config gdk-wx-config --toolkit=gtk3 --cflags
    -D__START__4__
        pkg-config gdk-3.0 --cflags
    -D__START__5__
        -pthread -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
-D__START__6__
-D__WX__

UNIX PROJECT FILE SNIPPET:
Code
    <Target title="scintilla">
        <Option output="devel30/wxscintilla_cb" prefix_auto="1" extension_auto="1" />
        <Option working_dir="" />
        <Option object_output=".objs30" />
        <Option type="2" />
        <Option compiler="gcc" />
        <Compiler>
            <Add option="-D__START__1__" />
            <Add option="$(WX_CONFIG) --cflags" />
            <Add option="-D__START__2__" />
            <Add option="`$(WX_CONFIG) --cflags`" />
            <Add option="-D__START__3__" />
            <Add option="`wx-config --cflags`" />
            <Add option="pkg-config gdk-$(WX_CONFIG) --cflags" />
            <Add option="-D__START__4__" />
            <Add option="pkg-config gdk-$(PKG_CONFIG_GTK_VERSION) --cflags" />
            <Add option="-D__START__5__" />
            <Add option="`pkg-config gdk-$(PKG_CONFIG_GTK_VERSION) --cflags`" />
            <Add option="-D__START__6__" />
            <Add option="-D__WX__" />
            <Add option="-DGTK" />
            <Add option="-DLINK_LEXERS" />
            <Add option="-DSCI_LEXER" />
            <Add option="-DWXMAKINGDLL_SCI" />
            <Add directory="sdk/wxscintilla/src/scintilla/include" />
            <Add directory="sdk/wxscintilla/src/scintilla/src" />
            <Add directory="sdk/wxscintilla/src/scintilla/lexlib" />
        </Compiler>
        <ResourceCompiler>
            <Add directory="sdk/wxscintilla/include" />
        </ResourceCompiler>
    </Target>

........

    <Environment>
        <Variable name="PKG_CONFIG_GTK_VERSION" value="3.0" />
        <Variable name="WX_CFG" value="" />
        <Variable name="WX_CONFIG" value="wx-config --toolkit=gtk3" />
        <Variable name="WX_SUFFIX" value="u" />
        <Variable name="WX_VERSION" value="30" />
    </Environment>
</Build>
       

C:B Details
Name                   : Code::Blocks
Version                : svn-r12639
SDK Version            : 2.16.0
Scintilla Version      : 3.7.5
Author                 : The Code::Blocks Team
E-mail                 : info@codeblocks.org
Website                : http://www.codeblocks.org
OS                     : Linux 5.4.0-94-generic x86_64
Scaling factor         : 1.000000
Detected scaling factor: 1.000000
Display PPI            : 96x96
Display count          : 1
Display 0              : XY=[0,0]; Size=[1920,969]; Primary

wxWidgets Library (wxGTK port)
Version 3.0.5 (Unicode: wchar_t, debug level: 1),
Runtime version of toolkit used is 3.24.
Compile-time GTK+ version is 3.24.20.


C::B source : Downloaded from https://wxstuff.xaviou.fr/article/debian-repository.html .
Note: Info on https://forums.codeblocks.org/index.php/topic,24798.msg169113.html#msg169113 could be relevant.
99
Plugins development / Re: Code completion using LSP and clangd
« Last post by AndrewCot on January 15, 2022, 07:29:43 am »
The plugin download does not have the fix in it.
100
Plugins development / Re: Code completion using LSP and clangd
« Last post by Pecan on January 15, 2022, 06:53:26 am »
I see your latest commit here in rev 27

* clangd_client - Code to remove invalid utf8 chars from clangd responses; cf., client.cpp/h DoValidateUTF8data()

I will test it, thanks!

EDIT updated:

The illegal utf8 problem still exits in rev 27.   :(

Can you give me some guidance as to how you created the problem. I can't make it happen here.

What source are you using that got a utf8 invalid char?

What symbol were you trying to code complete.

What indication are you getting that there was an invalid utf8 char. A wxMessageBox or an error shown in the cb debug log?

If a message was in the CB debug log, what did it say?

Did you use the repo source or the download file ?
In plugin management, what is the version you see for clangd_client?

I don't think the download files have been updated yet.

Thanks for testing.
Pages: 1 ... 5 6 7 8 9 [10]