-
Notifications
You must be signed in to change notification settings - Fork 147
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
feat: Add insert replace support for completions #583
feat: Add insert replace support for completions #583
Conversation
I had some issues with committing locally,
Probably because I am using Node v14.18.3, and in the logs I can see node v16.16.0 Is that Ok? |
Will repeat myself for the record: I'm a bit concerned about doing that as it will add a ton of extra bytes to the response which can already be in megabytes... On the other hand, if it's just the correct thing to do, we might have to... |
It's OK but you still have to fix the CI errors so you might as well just switch to Node 16. :) |
LSP spec to the rescue :)
|
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
Re-guarding the new spec |
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
… feat/insert-replace-support
Thanks! |
Been running with it for a while and I'm a bit annoyed by the new behavior (this is without corresponding LSP changes). For a code like: return path.reso|scriptArgs[0] || './.lokalise'; where return path.resolve[0] || './.lokalise'; I'm not sure if I'm not used to it or it's just annoying... |
Maybe the default should be insert - item.textEdit = lsp.TextEdit.replace(replacementRange, insertText);
+ item.textEdit = lsp.TextEdit.replace(insertRange, insertText); |
I don't know, that would be also a behavior change and potentially breaking. It's just that previously this happened only in specific cases while now it happens (almost?) every time. Alternatively we could only respect/use |
Yes, that is the best way to keep the prev behavior. |
This PR adds insert replace support.