Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Show diagnostics on clicking error/warning marker

(1/2) > >>

christo:
It is much helpful to show diagnostic message when clicking on error/warning marker instead of scrolling through the LSP messages tab. Attaching patch for that, it shows the message in a message box.

christo:
Patch with support for "Apply fix" as well.

Pecan:

--- Quote from: christo on March 29, 2024, 06:09:08 am ---Patch with support for "Apply fix" as well.

--- End quote ---

Is there any way to convert this patch so that it does not use std::move. My experience with std::move has been one crash after another.

For the time being, until I can figure out why my coding with std::move causes crashes, I do not want to apply any code containing it.

Secondly. Is this code introducing locks which can halt the main GUI thread?


christo:

--- Quote from: Pecan on March 30, 2024, 07:57:21 pm ---
Is there any way to convert this patch so that it does not use std::move. My experience with std::move has been one crash after another.

For the time being, until I can figure out why my coding with std::move causes crashes, I do not want to apply any code containing it.


--- End quote ---
std::move causes crash only if the move constructors are not proper. If the class contains pointers, move constructor should handle the pointers in logically correct way. For eg. if the class has a pointer which is deleted in the destructor if not null, then the move constructor should make the pointer of the moved from object to null.

--- Quote from: Pecan on March 30, 2024, 07:57:21 pm ---Secondly. Is this code introducing locks which can halt the main GUI thread?

--- End quote ---
It shouldn't as the mutex is to protect the map operations, and they are pretty quick.

Pecan:

--- Quote from: christo on January 06, 2024, 11:35:51 am ---It is much helpful to show diagnostic message when clicking on error/warning marker instead of scrolling through the LSP messages tab. Attaching patch for that, it shows the message in a message box.

--- End quote ---

Patch applied with mods on Head r13497.
Mods:
1) Simplify some code.
2) Add "Show fix if available" to the margin popup menu.
3) Change Diagnostic messageBox display from Left-Mouse click to Alt-Left-Mouse click on margin marker to avoid conflict with break points margin marker.

A note: The Christo patch use of the Alt-Left-Mouse click on the warning/error margin marker to directly display/apply the diagnostic/fix message box is a really nice touch. Thanks Christo. 

@Christo
If the code simplifications make you queasy; first, cover the keyboard.  :)
I'm the kind of geezer that opts for simple minded reliability over admittedly admirable sophisticated coding. I come from an assembly/C history where KISS coding was the rule.

Navigation

[0] Message Index

[#] Next page

Go to full version