cmake-tools.nvim
cmake-tools.nvim copied to clipboard
feat!(API): add callback(result) to lua API
In this PR I add callback(result) as the last parameter to most API calls, and:
- Make sure it is always called exactly once, be that in case of success or failure
- Fix a bug with
Resulttype: itsnewmethod was setting attributes on the class instead of the object - Fix a bug with
Typestype:SUCCESSwas1when there are places in code that assume that it is 0 - 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
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 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.