Closed 3246251196 closed 6 years ago
I should mention that there is no need to add a public killing function since irony-server-kill already exists.
It's a bit sad we need such workarounds...but anyway.
I would rename the function irony-parse-buffer-async
.
And it would make sense for the function to take the callback argument.
Then you are free to give a noop lambda in your config.
@Sarcasm I believe I have satisfied your request. The only thing I worry about is the user getting frustrated about needing to add a callback function. I think the user would find it easier to just call the function. I am wondering if there is anything like default argument values (as in C++) for lisp? So, we could default to an empty no-op lambda if no argument is provided. It would be trivial, I would guess: just make the `callback' an optional argument and check whether it has a value when inside the function, if it does not then provide the no-op lambda.
How do you feel about this? Or, is the latest version (a93a97b) good enough?
Thank you.
EDIT: I also now wonder if this function should not be interactive...
If you want callback to be an optional argument, you can do &optional callback
in the parameter list.
Then, at the time of use, you can do:
(or callback #'ignore)
Conveniently, ignore
is a function that takes any number of arguments, and do nothing.
I don't think the function should be interactive, it will just clutter the list of interactive function provided when typing Mx irony-|
.
@Sarcasm Thank you, I have applied the changes.
Merged, thank you.
There have been a number of people who have come across a situation where restarting the server would be useful.
For instance, after a while the completion results can return trash and I have never looked into why this is yet!
Anyway, at work I restart irony-server every 120s. I needed to create a function to allow this to happen and I think other people would find it useful if creating emacs timers.