I am using Vim 7.3 rev 63. Whenever I use the RopeRename function, Rope only finds occurences in the current file, despite the fact that the project root is right (I double-checked by closing the project and verifying the displayed path). It does not depend on the type of the refactored content (function, attribute, etc.). I did some research but have absolutely no idea where it could come from. Let me know if you need any other information.
Charles-Axel Dein <charlesaxel.d...@gmail.com> wrote:
> I am using Vim 7.3 rev 63. Whenever I use the RopeRename function, Rope > only finds occurences in the current file, despite the fact that the > project root is right (I double-checked by closing the project and > verifying the displayed path). It does not depend on the type of the > refactored content (function, attribute, etc.). I did some research but > have absolutely no idea where it could come from. Let me know if you need > any other information.
How about finding occurrences or go to definition from another
module? Do they fail as rename does?
Also is there anything special in your environment? Symbolic
links, spaces in filenames, or anything?
I'm using MacVim, there's nothing specific in my environment (except,
perhaps, that I'm using virtualenv provided by pythonbrew).
Finding occurrences raises the following error:
Rope project root folder: .Opening [.] project ...
Opening [.] project ... done
Error detected while processing function RopeFindOccurrences:
line 1:
E141: No file name for buffer 26
Traceback (most recent call last):
File "<string>", line 1, in <module>
File
"/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/decorato rs.py",
line 53, in newfunc
File
"/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/interfac e.py",
line 257, in find_occurrences
File
"/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/interfac e.py",
line 229, in _base_findit
File
"/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/interfac e.py",
line 520, in _save_buffers
File
"/Library/Python/2.7/site-packages/ropevim-0.4-py2.7.egg/ropevim.py", line
181, in save_files
vim.command('wall')
vim.error
RopeGoToDefinition returns "Cannot go to definition!".
Thanks for your help!
Charles
On Tue, Jul 17, 2012 at 7:23 PM, Ali Gholami Rudi <aligr...@gmail.com>wrote:
> Charles-Axel Dein <charlesaxel.d...@gmail.com> wrote:
> > I am using Vim 7.3 rev 63. Whenever I use the RopeRename function, Rope
> > only finds occurences in the current file, despite the fact that the
> > project root is right (I double-checked by closing the project and
> > verifying the displayed path). It does not depend on the type of the
> > refactored content (function, attribute, etc.). I did some research but
> > have absolutely no idea where it could come from. Let me know if you need
> > any other information.
> How about finding occurrences or go to definition from another
> module? Do they fail as rename does?
> Also is there anything special in your environment? Symbolic
> links, spaces in filenames, or anything?
Charles-Axel Dein <c...@d3in.org> wrote:
> I'm using MacVim, there's nothing specific in my environment (except,
> perhaps, that I'm using virtualenv provided by pythonbrew).
> Finding occurrences raises the following error:
> Rope project root folder: .Opening [.] project ...
> Opening [.] project ... done
> Error detected while processing function RopeFindOccurrences:
> line 1:
> E141: No file name for buffer 26
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> File
> "/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/decorato rs.py",
> line 53, in newfunc
> File
> "/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/interfac e.py",
> line 257, in find_occurrences
> File
> "/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/interfac e.py",
> line 229, in _base_findit
> File
> "/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/interfac e.py",
> line 520, in _save_buffers
> File
> "/Library/Python/2.7/site-packages/ropevim-0.4-py2.7.egg/ropevim.py", line
> 181, in save_files
> vim.command('wall')
> vim.error
> RopeGoToDefinition returns "Cannot go to definition!".
I see. The problem is ropevim tries to save all unsaved
buffers but fails because of a buffer with no file. How
about setting ropevim_confirm_saving and ignoring such
buffers manually? Does the problem persist?
Ok so I tried in another folder, with the django source code. There is a
single buffer opened. When I do RopeRename, I get:
Rope project root folder: .0. yes
1. no
Project not exists in ., create one?Project creation aborted
Error detected while processing function RopeRename:
line 1:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File
"/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/decorato rs.py",
line 53, in newfunc
File
"/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/interfac e.py",
line 52, in do_refactor
File
"/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/refactor .py",
line 32, in show
File
"/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/refactor .py",
line 119, in _create_refactoring
File
"/Library/Python/2.7/site-packages/rope-0.9.4-py2.7.egg/rope/refactor/renam e.py",
line 19, in __init__
self.pycore = project.pycore
AttributeError: 'NoneType' object has no attribute 'pycore'
Thanks again,
Charles
On Wed, Jul 18, 2012 at 4:18 AM, Ali Gholami Rudi <aligr...@gmail.com>wrote:
> Charles-Axel Dein <c...@d3in.org> wrote:
> > I'm using MacVim, there's nothing specific in my environment (except,
> > perhaps, that I'm using virtualenv provided by pythonbrew).
> > Finding occurrences raises the following error:
> > Rope project root folder: .Opening [.] project ...
> > Opening [.] project ... done
> > Error detected while processing function RopeFindOccurrences:
> > line 1:
> > E141: No file name for buffer 26
> > Traceback (most recent call last):
> > File "<string>", line 1, in <module>
> > File
> "/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/decorato rs.py",
> > line 53, in newfunc
> > File
> "/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/interfac e.py",
> > line 257, in find_occurrences
> > File
> "/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/interfac e.py",
> > line 229, in _base_findit
> > File
> "/Library/Python/2.7/site-packages/ropemode-0.2-py2.7.egg/ropemode/interfac e.py",
> > line 520, in _save_buffers
> > File
> > "/Library/Python/2.7/site-packages/ropevim-0.4-py2.7.egg/ropevim.py",
> line
> > 181, in save_files
> > vim.command('wall')
> > vim.error
> > RopeGoToDefinition returns "Cannot go to definition!".
> I see. The problem is ropevim tries to save all unsaved
> buffers but fails because of a buffer with no file. How
> about setting ropevim_confirm_saving and ignoring such
> buffers manually? Does the problem persist?
Charles-Axel Dein <c...@d3in.org> wrote:
> Ok so I tried in another folder, with the django source code. There is a
> single buffer opened. When I do RopeRename, I get:
> Rope project root folder: .0. yes
> 1. no
> Project not exists in ., create one?Project creation aborted
OK. Do you answer yes to this second question?
Does this patch help?
--- a/ropemode/interface.py 2012-07-21 07:32:43.171305597 +0430
+++ b/ropemode/interface.py 2012-07-21 07:32:47.001311202 +0430
@@ -86,11 +86,6 @@
self.close_project()
address = rope.base.project._realpath(os.path.join(root,
'.ropeproject'))
- if not os.path.exists(address):
- if not self.env.y_or_n('Project not exists in %s, ' \
- 'create one?' % root):
- self.env.message("Project creation aborted")
- return
progress = self.env.create_progress('Opening [%s] project' % root)
self.project = rope.base.project.Project(root)
if self.env.get('enable_autoimport'):
I applied the patch. The functions are a bit slower (which may mean that
Rope is effectively analyzing all the files), but nothing changes: it still
applies change only in the current file.
On Sat, Jul 21, 2012 at 4:53 AM, Ali Gholami Rudi <aligr...@gmail.com>wrote:
> Charles-Axel Dein <c...@d3in.org> wrote:
> > Ok so I tried in another folder, with the django source code. There is a
> > single buffer opened. When I do RopeRename, I get:
> > Rope project root folder: .0. yes
> > 1. no
> > Project not exists in ., create one?Project creation aborted
> OK. Do you answer yes to this second question?
> Does this patch help?
Charles-Axel Dein <c...@d3in.org> wrote:
> Yes, I answer yes.
> I applied the patch. The functions are a bit slower (which may mean that
> Rope is effectively analyzing all the files), but nothing changes: it still
> applies change only in the current file.
I guess there is a problem in handling Mac-style paths in
rope/base/project.py.
Ali is right about the problem, in my case anyways. I'm using Mac OSx 10.8 and Vim 7.3. The one useful piece of info that Ali left out is a solution. Here is what worked for me.
Had to modify "find_file" function (highlighted line) in ~/.vim/bundle/ropevim/ftplugin/python/libs/ropevim.py (your path, obviously, may vary): def find_file(self, filename, readonly=False, other=False, force=False): if filename != self.filename() or force: if other: vim.command('new') *vim.command("e %s" % os.path.abspath(filename))* if readonly: vim.command('set nomodifiable')
On Tuesday, July 24, 2012 9:13:13 AM UTC-5, aligrudi wrote:
> Charles-Axel Dein <c...@d3in.org <javascript:>> wrote: > > Yes, I answer yes.
> > I applied the patch. The functions are a bit slower (which may mean that > > Rope is effectively analyzing all the files), but nothing changes: it > still > > applies change only in the current file.
> I guess there is a problem in handling Mac-style paths in > rope/base/project.py.
toomanyjoes <joseph.elizo...@demandmedia.com> wrote:
> Ali is right about the problem, in my case anyways. I'm using Mac OSx 10.8 > and Vim 7.3. The one useful piece of info that Ali left out is a solution. > Here is what worked for me.
> Had to modify "find_file" function (highlighted line) in ~/.vim/bundle/ropevim/ftplugin/python/libs/ropevim.py > (your path, obviously, may vary):
> def find_file(self, filename, readonly=False, other=False, force=False):
> if filename != self.filename() or force:
> if other:
> vim.command('new')
> *vim.command("e %s" % os.path.abspath(filename))*
> if readonly:
> vim.command('set nomodifiable')
> Bing bang boom, works like a charm now.
Very interesting... So the problem was inside ropevim itself. I'm a
bit worried about the comparison between filename and self.filename()
3 lines above the changed line. Could you test to see how they differ?
I think a simple print statement like "print filename, self.filename()"
would show up as a message in vim.
On Thursday, August 30, 2012 10:16:53 PM UTC-6, aligrudi wrote:
> toomanyjoes <joseph....@demandmedia.com <javascript:>> wrote: > > Ali is right about the problem, in my case anyways. I'm using Mac OSx > 10.8 > > and Vim 7.3. The one useful piece of info that Ali left out is a > solution. > > Here is what worked for me.
> > Had to modify "find_file" function (highlighted line) in > ~/.vim/bundle/ropevim/ftplugin/python/libs/ropevim.py > > (your path, obviously, may vary): > > def find_file(self, filename, readonly=False, other=False, > force=False): > > if filename != self.filename() or force: > > if other: > > vim.command('new') > > *vim.command("e %s" % os.path.abspath(filename))* > > if readonly: > > vim.command('set nomodifiable')
> > Bing bang boom, works like a charm now.
> Very interesting... So the problem was inside ropevim itself. I'm a > bit worried about the comparison between filename and self.filename() > 3 lines above the changed line. Could you test to see how they differ? > I think a simple print statement like "print filename, self.filename()" > would show up as a message in vim.