User forums > Nightly builds

The 28 May2022 build (12818) is out.

<< < (2/2)

20k:
Hello! I thought I'd give the clangd code completion a go, its amazing to see it finally starting to work its way into codeblocks. It seems to largely work, except for some reason in the floating box suggestion window, it always shows GImGuiFreeTypeAllocatorUserData for the type (Edit: This seems to be a race condition, it'll pick one type and then stick with it - from different files at random)

https://i.imgur.com/hRwqxxk.png

Its definitely a little slower than the old parser, but the old parser was very much starting to struggle with modern C++ concepts (and to some degree, trying to parse modern C++ correctly is a losing battle anyway), so working fully clang autocomplete would be a definite upgrade

I also encountered a bug when upgrading from a previous nightly (12516), previously I'd set up my own msys2 compiler, and this seemed to cause the compiler plugin to crash because of duplicate compiler IDs. Setting up the msys mingw64 built in compiler and saving everything then restarting seemed to fix it. Thought I'd put that here in case anyone else runs into the same issue

Thanks!

Edit 2:

Pressing enter on a file which the code completion has been requested to treat as a source file (in this case, a .cl file) pops up an error repeatedly saying that it hasn't been parsed yet. This is just for inserting a newline

Pecan:

--- Quote from: 20k on May 30, 2022, 10:21:20 pm ---Hello! I thought I'd give the clangd code completion a go, its amazing to see it finally starting to work its way into codeblocks. It seems to largely work, except for some reason in the floating box suggestion window, it always shows GImGuiFreeTypeAllocatorUserData for the type (Edit: This seems to be a race condition, it'll pick one type and then stick with it - from different files at random)

https://i.imgur.com/hRwqxxk.png

--- End quote ---
Can you give me the exact steps to try and recreate this bug?


--- Quote from: 20k on May 30, 2022, 10:21:20 pm ---Pressing enter on a file which the code completion has been requested to treat as a source file (in this case, a .cl file) pops up an error repeatedly saying that it hasn't been parsed yet. This is just for inserting a newline

--- End quote ---

What is a .cl file (I found about a dozen definitions) and what do you mean by "code completion has been requested to teat as a source file" ?
How do I recreate this situation?

20k:

--- Quote from: Pecan on May 31, 2022, 06:08:32 pm ---
What is a .cl file (I found about a dozen definitions) and what do you mean by "code completion has been requested to teat as a source file" ?
How do I recreate this situation?


--- End quote ---

For the latter bug

1. Under settings -> editor -> clangd_client -> C/C++ parser (adv.), add ,cl to "file extensions to parse as source files". This is an OpenCL source file, but this bug repros without this being important

2. Make a new project (in my case, file new project, console application, C++, named test)

3. file -> new file -> empty file -> call it test.cl and create it in the current directory. I added it to debug and release

4. Navigate to new file, click, and hit enter to insert a newline. "Editors file is not yet parsed." pops up every time enter is pressed

My codeblocks config should be relatively standard other than that, but if this doesn't work I'll try and provide more detailed information. Clangd is set to C:\msys64\mingw64\bin\clangd.exe, and this is the clangd provided by msys2's mingw-w64-x86_64-clang-tools-extra package for the mingw64 distribution


--- Quote from: Pecan on May 31, 2022, 06:08:32 pm ---
Can you give me the exact steps to try and recreate this bug?


--- End quote ---

This is for a big project so less straightforward. So, with step 1 from the above bug report also applied (ie adding .cl files to the list of extensions)

1. Check out the repo https://github.com/20k/numerical_sim recursively with submodules, on the branch 'codeblocksrepro'. I use tortoisegit so I don't have a cli command here for you, but there its just right click git clone -> URL: git@github.com:20k/numerical_sim.git and tick recursive, with the branch set to codeblocksrepro

2. Open it up in codeblocks via clicking numerical_sim.cbp

3. Under sources, navigate to mesh_manager.cpp

4. Line 67 reads buf.matter_term = std::get<5>(values[kk]);

5. Make a newline after line 67, and type "buf."

6. It then displays a message (incorrectly) referring to cpu_mesh, and the init function https://i.imgur.com/blm3jww.png

7. Delete your addition, and restart codeblocks, repeating steps 2-6

8. Get a different message https://i.imgur.com/ngeHlmM.png

This project hasn't been tweaked at all to parse better under clang - so parse errors don't surprise me particularly, but the non determinism seems like there's a race condition happening somewhere. The list of members is correct indicating that its at least mostly correctly parsed, it just the extracted type that's incorrect

Scrolling through the different members of .buf in the popup does not change the message that's displayed, and between this and the non determinism it makes me suspect a bug in the code completion itself rather than a simple parse failure

I just checked the LSP diagnostics for mesh_manager.cpp and that doesn't output any errors, just uninteresting C++ stylistic warnings, so that file at least seems to be parsing mostly correctly

The code completion is set to use only 1 thread, and I tested messing with this number to see if it affects the result. It does not. All the testing I did just now is with the concurrently parsing thread count set to 1

Thanks!

Navigation

[0] Message Index

[*] Previous page

Go to full version