Author Topic: Show diagnostics on clicking error/warning marker  (Read 11970 times)

Offline christo

  • Multiple posting newcomer
  • *
  • Posts: 32
Show diagnostics on clicking error/warning marker
« 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.

Offline christo

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Show diagnostics on clicking error/warning marker
« Reply #1 on: March 29, 2024, 06:09:08 am »
Patch with support for "Apply fix" as well.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2808
Re: Show diagnostics on clicking error/warning marker
« Reply #2 on: March 30, 2024, 07:57:21 pm »
Patch with support for "Apply fix" as well.

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?


« Last Edit: March 30, 2024, 08:00:51 pm by Pecan »

Offline christo

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Show diagnostics on clicking error/warning marker
« Reply #3 on: March 31, 2024, 06:35:01 am »

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.

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.
Secondly. Is this code introducing locks which can halt the main GUI thread?
It shouldn't as the mutex is to protect the map operations, and they are pretty quick.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2808
Re: Show diagnostics on clicking error/warning marker
« Reply #4 on: April 05, 2024, 07:47:53 pm »
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.

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.
« Last Edit: April 05, 2024, 08:01:22 pm by Pecan »

Offline christo

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Show diagnostics on clicking error/warning marker
« Reply #5 on: April 06, 2024, 05:37:37 am »
@Pecan Thank you for spending time to get the patch in. Availability of the feature is more important than the implementation. I too think it is always better to do it in a way you are comfortable with as you are the plugin developer. Thank you once again for this plugin as this helps to increase developer productivity.  :)