Author Topic: Code completion using LSP and clangd  (Read 201346 times)

Offline blauzahn

  • Almost regular
  • **
  • Posts: 173
Re: Code completion using LSP and clangd
« Reply #435 on: May 14, 2024, 09:26:51 pm »
meaningful workflow during editing/debugging should be the guide to visual appearance.

@ollydbg: What is your take on this? For how long do both markers compete for the spot in your projects? Do either markers last that long that it really matters?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5930
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code completion using LSP and clangd
« Reply #436 on: May 15, 2024, 12:03:28 am »
meaningful workflow during editing/debugging should be the guide to visual appearance.

@ollydbg: What is your take on this? For how long do both markers compete for the spot in your projects? Do either markers last that long that it really matters?

I prefer Pecan's method "I can change it to a small right pointing arrow that fits inside any other marker".

I use C::B for my daily work, and some of the clangd_client warnings come from third part library's source code, so those warnings will last for a long time.

Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2784
Re: Code completion using LSP and clangd
« Reply #437 on: May 15, 2024, 06:10:46 pm »

I prefer Pecan's method "I can change it to a small right pointing arrow that fits inside any other marker".

Commit HEAD 13521:
Clangd_client warning margin marker changed to a small right pointing arrow.
« Last Edit: May 16, 2024, 02:31:21 am by Pecan »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5930
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code completion using LSP and clangd
« Reply #438 on: May 16, 2024, 02:45:26 pm »

I prefer Pecan's method "I can change it to a small right pointing arrow that fits inside any other marker".

Commit HEAD 13521:
Clangd_client warning margin marker changed to a small right pointing arrow.

Hi, thanks.

I just tried this latest revision.

There is still one issue, clangd error and breakpoint happens in the same line. Still they have the same size. One is circle, and the other is a square.

I can't reproduce a clangd warning easily.  :(

see below image shot:

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2784
Re: Code completion using LSP and clangd
« Reply #439 on: May 16, 2024, 08:27:55 pm »
Hi, thanks.
I just tried this latest revision.

There is still one issue, clangd error and breakpoint happens in the same line. Still they have the same size. One is circle, and the other is a square.

I can't reproduce a clangd warning easily.  :(

see below image shot:

Same with legacy CC . It's always been that way.
I'd have to change legacy CC use of cbEditor to do anything about that.
I'd prefer not changing legacy CC if I can avoid it.

For me, an obvious code  error (red square) should be corrected before debugging occurs. When the error is corrected, the debugger breakpoint circle appears.

Also you can always use the "Debugging windows" icon (top line main menu, left of info icon) to see your breakpoints listed.

I really do not know how to solves this situation without changing the legacy CC interface (cbeditor) for current users.
Legacy CC is used way more than clangd_client.

Suggestions accepted.
« Last Edit: May 17, 2024, 05:20:19 pm by Pecan »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5930
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code completion using LSP and clangd
« Reply #440 on: May 18, 2024, 11:52:07 pm »
Quote
I really do not know how to solves this situation without changing the legacy CC interface (cbeditor) for current users.
Legacy CC is used way more than clangd_client.

Hi, pecan, thanks for the work.

I see it is hard to solve this issue. If I remember correctly, the legecy code completion plugin does not use any markers. So, the issue is that the sdk(cb editor) need to supply more options for the markers.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.