-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for additionalTextEdits #61
Comments
Thanks for suggestion! I am honestly quite surprised that any people decided to use 'mini.completion' instead of other solutions. Suppose, that is a pleasant surprise, after all :) I am not sure, if this will be a small addition to codebase. The 'mini.completion' module is already too complicated and "big" for my taste. But we now have at least some testing coverage for that module, so I am more comfortable with experimenting with new features. I'll look into it. |
@brennop , I think I managed to come up with a reasonable solution, but not sure because I couldn't find any hands-on example of |
Thanks for trying to implement it. I tried with tsserver and clangd, but none of them worked. I've tried with the snippet provided here but no luck still. |
Ok, I finally got time to get back at this. I found out that Could you, please, try again? This time:
|
@echasnovski I was looking for the same functionallity as @brennop but couldn't get the implementation to work with typescript. Using your above demonstration I got it to work with pyright, which is awesome, but typescript seems to ignore it. I've created 2 files to setup a testing environment.
Now if you would add another file, eg: index.ts and start typing Hope this helps. |
That is certainly a great help: both 'pyright' confirmation and Typescript example. Thanks! I managed to reach the I am not sure how to deal with inconsistency between languages. Maybe |
So it seems like |
I just pushed in @brennop, @SebasAren, could you, please, try this out? Especially with something other than |
Thank you for the quick replies! I will be able to test this in the morning.
I think the waiting time is quite fair and I believe other completion plugins I have used had that same delay. But I'll let you know tomorrow if it works. Will also try some different lsp's.
|
It now auto-imports from typescript! It also didn't break the pyright imports. Seems to be working perfectly. Thank you! |
That is great news! I'll wait a little bit in case other issues pop up (they shouldn't, but they always might). And also confirmation from some other LSP server (not already tested 'pyright' or 'typescript-language-server') would be nice (of course, if you already are using one). |
Just tried it it out using volar, which is the Vue lsp. This worked as well. It uses typescript to resolve these imports I believe, so that was to be expected. |
I decided to push this code to Thanks to both of you for suggestions and testing! |
Contributing guidelines
Module(s)
mini.completion
Description
Some lsp provide a
additionalTextEdits
on completion items containing useful edits like auto-imports.nvim-cmp has support for
additionalTextEdits
, it would be cool if mini.completion had too.The text was updated successfully, but these errors were encountered: