cmake-tools.nvim icon indicating copy to clipboard operation
cmake-tools.nvim copied to clipboard

feat!(API): add callback(result) to lua API

Open alfaix opened this issue 1 year ago • 1 comments

In this PR I add callback(result) as the last parameter to most API calls, and:

  1. Make sure it is always called exactly once, be that in case of success or failure
  2. Fix a bug with Result type: its new method was setting attributes on the class instead of the object
  3. Fix a bug with Types type: SUCCESS was 1 when there are places in code that assume that it is 0
  4. Add a couple of error messages

I tested this locally - to an extent, let me know if there is some kind of proper procedure to know it's working.

RESOLVES: #245

alfaix avatar Jun 27 '24 18:06 alfaix

LGTM. This is indeed improve the API quality, thanks for your work! I think you should also document it somewhere. Maybe create a API file in the docs folder.

Civitasv avatar Jun 28 '24 01:06 Civitasv

@Civitasv Does the API could be integrated with cmake-tools.nvim to help us to locate the gtest binaries? Currently, it is quite convenient to select a binary from neotest. It would be great if any snippets exist, thanks.

tan-wei avatar Feb 25 '25 01:02 tan-wei