-
-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(extras): Insert repeat node when duplicated keys occur #665
Conversation
Nice so far 👍 |
Hmmm, isn't it better to stick with |
Oh, yeah that's what I also had in mind, I only think we should wrap the access to
Not really, but I'd like the extras to not rely on any internals of luasnip, only public API. |
I added the function, can you have another look? |
Yup 👍 Aside from that, just docs are left, and some tests for the new functionality. |
I am not familiar with it, but I will take a look. |
so, i am getting to mocking the nodes, but i am not sure how to actually do it since it requires the node definition to be global and I am not sure how to proceed with that. |
Oh, I think it's enought to only mock the functions we actually need (so just For actual tests of the functionality, I'd say we can test it in a real setting, I feel like that's easiest to write tests for too (use |
but the problem i have here is not knowing how to pass a mock object to the local FakeNode = {}
function fake_node() end at the beginning of works(“”, “{a}{a}”, “{a = fake_node()}”, “”, “{repeat_duplicates = true}”) I know that it shouldn’t work but for the reason of the test case being wrong, here the test case fails due to |
Ahhh, you can run code in the tested neovim-instance via |
I added a test, it is messy but I want to see if the direction is correct first. Also, it is a bit weird since tests like this won't tell if there |
That test looks good👍👍
Yeah, it's unfortunate that the current tests for just the interpolation rely on this function handling objects other than nodes :/ |
I generalize the |
The previous code works because I have a bug in the mock table btw |
Turn of repeat-insertion for those tests? That should be fine as long as we check it elsewhere |
I am not sure what you mean by turning off repeat-insert here |
Ah, |
oh, ok |
I took the liberty of implementing my idea of handling the existing tests (figured explaining would take longer than quickly handling it myself 😅) WDYT? |
I was trying to make it as general as possible since I am not sure how you want it, but this is simpler in my opinion. So, I should move on to create the integration test, right? |
Ah, I might've been a bit misleading then, I only wanted to re-use those tests (but they're also more readable now, with the explicit argument-names, so that's nice :D) Umm yeah, integration tests sound good👍👍 |
Oh great idea to forward |
yeah, it was annoying having to run the whole test set everytime |
I added 2 tests, 1 one for |
Ah, |
that’s not really the problem, the problem is the repeating text doesn’t appear at all in the actual portion of the screen 😅 |
|
Ahhh xD |
eh, how do you do a jump in this case 😅? |
Oh, manually, binding some keys to jump is not necessary: |
I think it is done now, could you have another look? |
Nice nice nice, this is it, great work!! :D |
sure |
can you have a look again? |
welp, looks like either github action's internet is down or neovim-ppa is down |
off and on again did it 👍 |
hmmm, it seems like i messed up the commits, i will fix it |
Ah my bad, I just noticed that |
everything should be good now, could you have another look? |
Ohh right, just |
…ously occured node instead of a copy of it don't have implementation rely on tests/handle tests specially. adapt existing tests. Provide objects on which `get_jump_index` can be called, as opposed to flat numbers.
looks like everything is in order |
I agree 👍👍 |
not a problem, thank you very much for the plugin |
This is awesome. Thanks |
Experimental implementation for #465