Author Topic: code completion breaks after changing header file  (Read 321 times)

Offline Hyena

  • Multiple posting newcomer
  • *
  • Posts: 26
code completion breaks after changing header file
« on: Yesterday at 03:21:48 pm »
When I change a structure declaration in one of the header files, then afterwards in the C source files the code will no longer be able to complete anything. A note appears saying that parser is still parsing the files, but it never completes. The only way to fix it is by restarting codeblocks. This happens even if the change to the header file does not functionally change anything (just by adding a space to the end of an empty line and saving the header file will break code completion). The problem is with both the 20.03 and the SVN versions of codeblocks.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1724
Re: code completion breaks after changing header file
« Reply #1 on: Yesterday at 04:03:16 pm »
Are you using the legacy code completion plugin (default) or the new Clangd_client plugin?

Offline Hyena

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: code completion breaks after changing header file
« Reply #2 on: Yesterday at 04:12:46 pm »
I haven't changed that, so probably this is the legacy one indeed.

Offline Hyena

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: code completion breaks after changing header file
« Reply #3 on: Yesterday at 04:21:46 pm »
I disabled the legacy and enabled the clang one but the clang didn't work at all. Also another thing I noticed was that anonymous structs seem to be confusing the code completion. In the added screenshots only one "capacity" should appear, but instead I get multiple because other sub structures have the same variable.


Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2865
Re: code completion breaks after changing header file
« Reply #4 on: Yesterday at 07:56:21 pm »
@Hyena

This usually happens when the wrong clangd.exe is being used.
Please look at MainMenu/settings/editor/clangd_client/tab C/C++ parser and telll us the path of the clangd that you are using.


Offline Hyena

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: code completion breaks after changing header file
« Reply #5 on: Yesterday at 08:52:49 pm »
everything seems fine here. when I start the project it initially says in the bottom right corner that parsing is paused. then I toggle it by right clicking on the project name, but still autocomplete doesn't work.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2865
Re: code completion breaks after changing header file
« Reply #6 on: Today at 07:16:07 am »
@ Hyena

Please start your CodeBlocks with the /d parameter so that it shows the
Codeblocks debug tab.

Load the project giving you the problem, then after the problem occurs, right click on the "Code::Blocks debug" tab and chose "copy to contents to clipboard".

Paste that into a txt file, zip it up and append it to a message to us so we can try to get a clearer picture of the problem.

 

Offline Hyena

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: code completion breaks after changing header file
« Reply #7 on: Today at 11:31:38 am »
unfortunately I wasn't able to locate the "code::blocks debug" tab anywhere. I did attach the console output of it though.