Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Code completion using LSP and clangd
Pecan:
--- Quote from: MaxGaspa on April 16, 2024, 12:02:56 pm ---Hi,
I'm writing to submit a (passible) bug report of the Code Completion plugin (LSP and Clangd).
When I load a project the plugin starts to parse all the project's files. I observe the log of parsing in the Code::Blocks panel of the Logs window. In the meantime I open a file, Application.cpp for example, and I select "Application:" to use the plugin (see image attached)...but...as soon as a new file is parsed the selection disappears....so I can't use the code completion till the full parsing of the projects. As soon as a new file parsing is completed the selection becomes blank.
Is this behavior expected?
Windows 10 , latest nightly , latest Mys2 clang 18.1.3-1
--- End quote ---
Thanks for the video. It cleared up (in my head) what box you were trying to point out.
That box is called the Clangd_client (or CodeCompletion) toolbar.
It is only active when an editor has been activated. It shows the classes and the functions that the editors cursor is positioned within. I.e., the cursor must have clicked in an
editor at least once (activate) to fill in the choice boxes.
The left hand side (the one you were clicking in) displays the classes in an active editor file, and the right hand choice box shows all functions within the class.
You can cause the editor to position on a class/function by clicking in the left hand choice box to choose the class, then click in the right choice box and choosing what function to position to.
What's happening in your video is that you never activated the editor by clicking into it. So the choice boxes were never populated.
Regards
MaxGaspa:
--- Quote from: Pecan on April 17, 2024, 07:09:19 pm ---
It is only active when an editor has been activated. It shows the classes and the functions that the editors cursor is positioned within. I.e., the cursor must have clicked in an
editor at least once (activate) to fill in the choice boxes.
What's happening in your video is that you never activated the editor by clicking into it. So the choice boxes were never populated.
--- End quote ---
Thank you for your answer but....
...it seems that the issue is still the same even if I'm clicking the editor.
Hereafter another video in which it should be very clear that I'm activating (clicking) the editor but the "left choice" still disapperar.
If I'm so quick (very quick) to select something in the "right choice" before the "left choice" is blanked .... then the "left choice" is no longer disappearing. But it's difficult...I need to be very quick. Basically I need to wait for the parsing completion before using the plugin.
https://drive.google.com/file/d/1ntVkrxRg9YccNJBByNuHaBKE-SgX3Xwn/view?usp=sharing
Pecan:
--- Quote from: MaxGaspa on April 17, 2024, 11:28:29 pm ---
--- Quote from: Pecan on April 17, 2024, 07:09:19 pm ---
It is only active when an editor has been activated. It shows the classes and the functions that the editors cursor is positioned within. I.e., the cursor must have clicked in an
editor at least once (activate) to fill in the choice boxes.
What's happening in your video is that you never activated the editor by clicking into it. So the choice boxes were never populated.
--- End quote ---
Thank you for your answer but....
...it seems that the issue is still the same even if I'm clicking the editor.
Hereafter another video in which it should be very clear that I'm activating (clicking) the editor but the "left choice" still disapperar.
If I'm so quick (very quick) to select something in the "right choice" before the "left choice" is blanked .... then the "left choice" is no longer disappearing. But it's difficult...I need to be very quick. Basically I need to wait for the parsing completion before using the plugin.
https://drive.google.com/file/d/1ntVkrxRg9YccNJBByNuHaBKE-SgX3Xwn/view?usp=sharing
--- End quote ---
I cannot reproduce this. So would you start CB with the -d or /d parameter so that the Code::Blocks Debug log is produced.
Before you load your project be sure that the "CodeBlocks Debut" log tab is focused.
Do as you have done to cause the bug, then right-click the Code::Blocks Debug tab and choose copy "contents to clipboard", Paste it into a message here between code tags (the # icon above a forum reply box).
Thanks for your patience with this.
It's really peculiar.
BTW: after the new file is parsed and clicked into, can you even perform a Mainmenu/Search/goto function, (Ctrl-Shift-G for me.)
It tells me if if the bug is in the plugin interface to the editor code or the toobar code.
Pecan:
--- Quote from: MaxGaspa on April 17, 2024, 11:28:29 pm ---
--- Quote from: Pecan on April 17, 2024, 07:09:19 pm ---
It is only active when an editor has been activated. It shows the classes and the functions that the editors cursor is positioned within. I.e., the cursor must have clicked in an
editor at least once (activate) to fill in the choice boxes.
What's happening in your video is that you never activated the editor by clicking into it. So the choice boxes were never populated.
--- End quote ---
Thank you for your answer but....
...it seems that the issue is still the same even if I'm clicking the editor.
Hereafter another video in which it should be very clear that I'm activating (clicking) the editor but the "left choice" still disapperar.
If I'm so quick (very quick) to select something in the "right choice" before the "left choice" is blanked .... then the "left choice" is no longer disappearing. But it's difficult...I need to be very quick. Basically I need to wait for the parsing completion before using the plugin.
https://drive.google.com/file/d/1ntVkrxRg9YccNJBByNuHaBKE-SgX3Xwn/view?usp=sharing
--- End quote ---
I just watched the video again.
I see that you're not clicking either inside a class or a function.
Do this, after the clicked file has parsed, click inside a function, not at the top of an editor file.
Tell me if you still get the bug.
If you get the bug, send me the Code::Blocks Debug log as specified in the previous messgage.
Thanks
kakas:
hey @Pecan
sorry to bother you again but I have encounter an unusual behavior.
I was trying to use a large single file libraryhttps://github.com/mackron/miniaudio.
It has a single headerfile: miniaudio.h <--- 62k lines
when I try to open the header file or search for declaration through the main.c, whole code blocks freezes for solid 1-2 mins, weanwhile the mouse gradually becomes unresponsive until it's completely frozen and the screen turns black. Throws an error that Clangd_Cliet has stopped at the end.
I not sure if it's because my laptop isn't powerful enough. because the plugin usually worked smooth with other large libraries.
Apart from this single instance the plugin works fine and it has been very helpful.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version