python-rope / ropevim

vim mode that uses rope library to provide features like python refactorings and code-assists
GNU General Public License v2.0
245 stars 34 forks source link

Optionally force ropevim to use python3. #71

Closed bonderado closed 5 years ago

bonderado commented 5 years ago

Hello, thank you very much for this plugin, I used it extensively.

The only problem it ever gave me is that, running under Python2, it does not work when using Python3-only features. To overcome this limit I introduced a way to optionally force ropevim to use Python3 syntax via a new variable. Personally, I set the variable globally, so that even my Python2 scripts get better forward compatibility, but it can be set local to a buffer at need or automatically via autocommand if the intended version of Python can be guessed..

In the few months I used this option I did not observe problems. When renaming variables, the refactoring is applied to f-strings too.

I submit this pull request so that my approach can be examined and tested by a wider audience, possibly integrated upstream.

bonderado commented 5 years ago

I corrected a mistake in the naming of the user-defined alias for the command for python provider and added a default value to get(b:,....).

Krilivye commented 5 years ago

Hi I use this hack on every new install how can I help to help to merge it? :)

bonderado commented 5 years ago

Hi, thank you for your interest, but I think there is not much to be done in that direction: the PR has no conflict and only needs reviewing, but the project seems to be stagnating (though honestly it works quite well, so why change it?). I put this PR here mostly as a way to document my personal solution It is possible that this PR will be merged once new features an the spreading adoption of python3 will make some change necessary. For now I will just keep using my hack. Thank you again and happy (neo)vimming.

soupytwist commented 5 years ago

I don't really maintain this project, but I do (somewhat) maintain rope. The project has stagnated, but myself and @mcepl are still here.

I don't see any reason not to merge this, and I don't think @mcepl will object. Sorry for the nonresponse on this.

mcepl commented 5 years ago

No, I don't have a problem with it. However, I think this vim plugin has no future for me (and whole rope perhaps), because the future as I see it is in LSP (see https://github.com/python-rope/rope/issues/219#issuecomment-337919034 ).

bonderado commented 5 years ago

Thank you for the answer and for suggesting an alternative. I am piqued, but at the moment changing tools is low on my priority list.

I appreciate that you took the trouble of merging even though you have little interest in this right now. Have a good week.