I've found some ruby runtime errors jump me to a non-existent file
Sam Roberts
sroberts at uniserve.com
Sun Mar 26 18:29:50 EST 2006
The latest vim-ruby is working well for me, good work you all.
One persistent problem. Mostly, errors take me to the source, but
occaisonally I get a blank buffer, with what appears to be the name of
the file that has the error in the mode line. It depends on the type of
error, but I just reproduced it.
The error is a yield in a method that wasn't passed a block, and the
output, shown from a terminal:
% make
ruby -w -I lib test_vcard.rb -n test_modify
Loaded suite test_vcard
Started
E
Finished in 0.007522 seconds.
1) Error:
test_modify(TestVcard):
LocalJumpError: no block given
./lib/vpim/maker/vcard.rb:92:in `add_name'
test_vcard.rb:687:in `test_modify'
./lib/vpim/maker/vcard.rb:49:in `make'
./lib/vpim/maker/vcard.rb:37:in `make2'
test_vcard.rb:686:in `test_modify'
1 tests, 1 assertions, 0 failures, 1 errors
make: *** [do] Error 1
When I run the unit tests from vim (with :make), then the error file
name is " ./lib/vpim/maker/vcard.rb", it includes the leading white
space!
Thats a valid filename of course, its just not the name of the file with
the error. vim doesn't find the directory " .", so it can't open the
file, and I'm left staring puzzledly at a blank buffer.
Cheers,
Sam
In case this is a problem with my local install:
My ~/.vim after installing vim-ruby, I didn't change any of these:
/Users/sam/.vim/compiler/eruby.vim
/Users/sam/.vim/compiler/ruby.vim
/Users/sam/.vim/compiler/rubyunit.vim
/Users/sam/.vim/doc/matchit.txt
/Users/sam/.vim/doc/tags
/Users/sam/.vim/foo.rb
/Users/sam/.vim/ftdetect/ruby.vim
/Users/sam/.vim/ftplugin/eruby.vim
/Users/sam/.vim/ftplugin/ruby.vim
/Users/sam/.vim/indent/eruby.vim
/Users/sam/.vim/indent/ruby.vim
/Users/sam/.vim/plugin/matchit.vim
/Users/sam/.vim/rubyunit.vim
/Users/sam/.vim/syntax/eruby.vim
/Users/sam/.vim/syntax/ruby.vim
---- my .vimrc ----
" ~/.vimrc
" Existing files are overwritten. This is safe, because it's a slow-maturing
" project, so new files are better than old ones. However, if you had edited the
" files, you will have lost your changes. Better make your changes in, for
" instance:
"
" ~/.vim/after/ftplugin/ruby.vim ~
"
" This file will be loaded _after_ the regular config files are loaded, so your
" customisations will definitely take effect.
" See the Exuberant ctags mailing list, where Elliott Hughes (who wrote this)
" posted a [patch] for this. His editor, [Edit], uses Exuberant ctags to show
" a tree of classes and methods where what you're editing is highlighted, and
" you can click elsewhere to jump to that method, so he needed better Ruby
" support.
"
" It's not perfect (it doesn't use the real Ruby yacc parser), but it's pretty
" good.
filetype on
filetype indent on
filetype plugin on
""" Whitespace
set shiftwidth=2
set softtabstop=2
set tabstop=8
set expandtab
set nowrap
set autoindent
set textwidth=0
""" History
set nobackup
set viminfo='20,\"50
set history=50
""" UI
"set ignorecase " Do case insensitive matching
set autowrite " Automatically save before commands like :next and :make
set backspace=indent,eol,start " more powerful backspacing FIXME - does what?
set incsearch " Incremental search
set nohlsearch
set ruler " show the cursor position all the time
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set noeb
set vb t_vb=
" FIXME - does what?
" compiler ruby
" FIXME - I want the list when I do TAB, how do I do that?
" Suffixes that get lower priority when doing tab completion for filenames.
" These are files we are not likely to want to edit or read.
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
""" Colors
" Configure these terminals to be color.
if &term =~ "xterm-debian" || &term =~ "xterm-xfree86" || &term =~ "xterm"
set t_Co=16
set t_Sf=[3%dm
set t_Sb=[4%dm
endif
syntax on
hi clear Identifier
""" Miscellaneous
" "set errorformat=%f:%l:\ %m,%Dgmake[%*\\d]:\ Entering\ directory\ `%f',%Dgmake[%*\\d]:\ Leaving\ directory\ `%f'
"
"
"
" let s:cpo_save = &cpo
" set cpo-=C
"
" " setlocal errorformat=\%Etest%[%^\ ]%#(%[%^\ ]%#)\ [%f:%l]:,
" " \%Z%m%\\%.,
" " \%C%m%\\%.,
" " \%-GLoaded%.%#,
" " \%-GStarted%.%#,
" " \%-G%[EF%.]%.%#,
" " \%-GFinished\ in%.%#,
" " \%-G\ %\\+%\\d%\\+)\ Failure:,
" " \%-G\ %\\+%\\d%\\+)\ Error:
"
" let &cpo = s:cpo_save
" unlet s:cpo_save
More information about the vim-ruby-devel
mailing list