-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Handling unsaved buffers (especially with renaming) #405
Comments
It shouldn't be a problem for Jedi. It's probably a question how we implement it in jedi-vim. You can pass unsaved buffers to Jedi by not mentioning a path, just the source code. I'm not actually sure why jedi-vim would need another setting there. IMHO it should just work by default. |
Agreed. The setting would be only a workaround. So basically jedi-vim would have to consider and submit any unchanged (Python) buffers. I think this does not only affect renaming, but is a general feature, e.g. changes in an unsaved file could also show up during completion? I see two cases here: new buffers without a filename, and changed buffers. |
Isn't this already the case? I intentionally designed Jedi that way. Unsaved buffers are not taken in consideration if you're not working on them. But the one you're working on is always parsed with the changes. |
Yes, I knew - and that is nice of course! |
Hmm you're right! I never thought about it that way. I think in that case we should just abort renaming or not rename that file. IMHO this is very much an edge case and should be treated with abort or something similar. |
But if jedi-vim would be submitting/providing contents of changed buffers (instead of letting Jedi read them from disk), this wouldn't have to abort, but would just work. |
Now I get it :) We could just do it by default. Technically we would need to be aware of the fact that just calling update is not enough. We would need to run |
While working on the rename feature, I've wondered if it was (easily) possible to make it work on unsaved buffers?
It's probably limited by Jedi only being able to handle saved files by default?
It might be possible to pass in any unsaved buffers as
Script
objects directly?I've experimented with a new setting
rename_save_buffers
/save_on_rename
, which would call:update
on buffers where something was renamed.What do you think?
The text was updated successfully, but these errors were encountered: