(mini.test) Add child.lua_func() method#437
Conversation
e640259 to
76107f3
Compare
|
That is interesting! Thanks for the PR! If I understand correctly, the usual use case is to define function in current process (mostly to get syntax highlighting), copy it to child, execute, and return value? Are there any other use cases I am missing here? |
I don't think so. It's basically the same as Also I removed backticks from |
|
Other plus for a function it that you can use arguments anywhere. With |
My main issue with this is that during test writing author can write function outside of string and only move it there before execution. Although iterating on writing that function is certainly easier with this PR's function. So it is good to have, but not strictly necessary, which is more of a "helpers" territory than 'mini.test' itself. I'll think about it.
Not really sure I understand this.
Not really sure about this either. My main concern with annotations right now is about help generation. If EmmyLua doesn't support surrounding for returned object name, than I'd probably keep those backticks. |
OK, I'll remove it, because it's not relevant to current feature. Annotation of
It's not really important, but was I meant was, e.g.: child.lua_func(function(a, b)
func1(a)
func2(b)
end, 1, 2)Here I can use arguments |
76107f3 to
a5f4c37
Compare
Yeah, that's nice to have. I'll take some time thinking about it. Probably at least until the next release of 'mini.nvim' which is planned some time in end of August (usually prefer adding new features at the start of new development cycle). |
|
Thanks again for the contribution! Sorry for taking so long to react, was trying to finish things with 'mini.pick' as quickly as possible. I've merged this in a separate branch to make a few finishing touches and then back to Edit: This should be a part of |
I like
mini.test, but I don't particularly like to write lua code as strings, because it looses syntax highlighting/code completion/type checking etc. I started to use this little function and I think it works pretty well. I thought that I can contribute it here.