as you might have noticed the issues list got shorter lately. I have implemented some improvements (hopefully) in the handling of errors and the interaction of the Vim and the Clojure part. Also the installation was (hopefully) simplified. From the user perspective the actual handling shouldn't have changed much.
Anyone who dares to test, please consider the following stress testing:
* Install just the vim part w/o any specific configuration (besides the usual filetype stuff) => Static things should work.
* Activate the nailgun part and test with all kinds of mistakes, missing client, non-executable client, incorrect classpath => should handle errors gracefully with some (not necessarily good) message
* clojure.test users: c.t introduces *test-out* which sucks. If clojure.test is loaded before the nailgun server is started there might be problems. If anyone encounters problems here, I'd like to know about it.
And besides that: do other crazy stuff.
However note, that you have to use the bundled nailgun server, since I had to modify it slightly.
If everything works, we are on route to 2.2.0. :)
You can find the required files here:
http://kotka.de/snapshots/vimclojure-2.2.0-SNAPSHOT.zip
http://kotka.de/snapshots/vimclojure-2.2.0-SNAPSHOT.jar
Sincerely
Meikel
On Sun, Jul 4, 2010 at 06:18, Meikel Brandmeyer <m...@kotka.de> wrote:
> You can find the required files here:
>
> http://kotka.de/snapshots/vimclojure-2.2.0-SNAPSHOT.zip
> http://kotka.de/snapshots/vimclojure-2.2.0-SNAPSHOT.jar
I notice the .zip file is missing the 'ng' executable (the nailgun
client). Is this intentional?
The error message I got when launching vim was very instructive though
:) it was immediately obvious what the problem was.
Thanks,
Mike
Am 04.07.2010 um 06:35 schrieb Mike Mazur:
> I notice the .zip file is missing the 'ng' executable (the nailgun
> client). Is this intentional?
This is intentional. The zip should just go vanilla into .vim as for any other vim plugin. I can't do more for a newbie's ease of installation experience. The client was always an annoyance for that. Since it won't change with every release there will be a separate zip file, which you have to install once only. People already using VimClojure don't have to care. They can use their previous client.
Sincerely
Meikel
Hi Meikel,
I'm seeing this error when opening any .clj file:
Could not determine the Namespace of the file.
Reason:
Couldn't execute Nail!
java.lang.IllegalArgumentException: No matching field found:
getInputStream for class
com.martiansoftware.nailgun.ThreadLocalInputStream
Unabridged error dump here: http://gist.github.com/463546
I'm not really sure what to try to get it to work, do you know what's
causing it to fail?
- Lee
I'm noticing that the key mappings aren't working. My workflow is as follows:
1. run nailgun server via ${vimclojure-dir}/bin/ng-server from project
dir which contains .clojure file
2. open clojure source file which is on $CLASSPATH
3. try to open REPL with \sr or \sR
I notice a delay when vim is opening, which indicates that the file is
being "imported" by the nailgun server. However, when I use any key
mappings, nothing happens. No error message, no REPL.
Leaving the nailgun server running, then quitting vim & opening the
file again sometimes leads to this error:
; Use \p to close this buffer!
Could not determine the Namespace of the file.
This might have different reasons. Please check, that the ng server
is running with the correct classpath and that the file does not contain
syntax errors. The interactive features will not be enabled, ie. the
keybindings will not be mapped.
Reason:
Couldn't execute Nail!
{"value" : "tweetsight.core", "stdout" : "", "stderr" : ""}
Naturally, \p doesn't close the window. I usually need to quit vim &
re-open the file multiple times before the error pops up.
If I use the previous pre-release version[1] everything works as expected.
Thanks,
Mike
[1] http://groups.google.com/group/vimclojure/browse_thread/thread/d15b0174d2a1e51
Am 04.07.2010 um 18:12 schrieb Mike Mazur:
> Reason:
> Couldn't execute Nail!
> {"value" : "tweetsight.core", "stdout" : "", "stderr" : ""}
This is rather strange, because you get the right answer. I'll have to check that.
Sincerely
Meikel
Am 04.07.2010 um 18:08 schrieb Lee Hinman:
> java.lang.IllegalArgumentException: No matching field found:
> getInputStream for class
> com.martiansoftware.nailgun.ThreadLocalInputStream
Did you use the nailgun server from the jar file? I had to patch it to work around things bypassing *out* and *err*. I tried to monkey patch nailgun, but Java was smarter than I hoped. So I had to intrusively modify nailgun itself.
Sincerely
Meikel
Not that I can think of. I wiped my ~/.vimrc file and put in just
what's necessary for vimclojure to work:
$ cat ~/.vimrc
call pathogen#runtime_append_all_bundles()
filetype off
filetype plugin indent on
let vimclojure#WantNailgun = 1
let vimclojure#NailgunClient = "/home/mike/.vim/bundle/vimclojure/ng"
Still the problem persists. However if I use the old version of
vimclojure-2.2.0-SNAPSHOT.zip (as I mentioned earlier), everything
works great.
Note I use pathogen, but there's only one bundle with the contents of
vimclojure-2.2.0-SNAPSHOT.zip:
$ ll ~/.vim/bundle
total 4
drwxr-xr-x 9 mike mike 4096 2010-07-05 00:01 vimclojure
I'm using vim as shipped in Ubuntu 10.04:
$ vim --version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr 16 2010 13:27:36)
Included patches: 1-330
Thanks,
Mike
On Mon, Jul 5, 2010 at 03:52, Meikel Brandmeyer <m...@kotka.de> wrote:
I started looking into the differences in autoload/vimclojure.vim and
ftplugin/clojure.vim between this release candidate and the previous
one. What seems to be missing are calls to vimclojure#MakePlug in the
new version of ftplugin/clojure.vim. For example, in the older release
candidate, the following two commands are called to set up \sr:
call vimclojure#MakePlug("n", "StartRepl", 'vimclojure#Repl.New("user")')
call vimclojure#MapPlug("n", "sr", "StartRepl")
but in the new release candidate you have only
call vimclojure#MapCommandPlug("n", "sr", "StartRepl")
When looking at the mappings with :map, I only see this entry in the
newest release candidate:
n \sR @<Plug>ClojureStartLocalRepl
where the old release candidate had two entries:
n \sR @<Plug>ClojureStartLocalRepl
n <Plug>ClojureStartLocalRepl * :call
vimclojure#Repl.New(b:vimclojure_namespace)<CR>
When I start vim after adding the following line to my ftplugin/clojure.vim:
call vimclojure#MakePlug("n", "StartRepl", 'vimclojure#Repl.New', '"user"')
Then the shortcut \sr does launch a REPL. However, when I type
something like (doc find) and hit enter, all I see is
<Plug>ClojureReplEnterHook -- which hints that there's no plug for
ClojureReplEnterHook?
I'm curious how this works for you without any plugs defined?
Thanks,
Mike
Yep, I used the bin/ng-server script that was contained in the .zip file.
- Lee
On Mon, Jul 5, 2010 at 15:11, Lee Hinman <l...@writequit.org> wrote:
> On Sun, Jul 4, 2010 at 12:41 PM, Meikel Brandmeyer <m...@kotka.de> wrote:
>> Hi,
>>
>> Am 04.07.2010 um 18:08 schrieb Lee Hinman:
>>
>>> java.lang.IllegalArgumentException: No matching field found:
>>> getInputStream for class
>>> com.martiansoftware.nailgun.ThreadLocalInputStream
>>
>> Did you use the nailgun server from the jar file? I had to patch it to work around things bypassing *out* and *err*. I tried to monkey patch nailgun, but Java was smarter than I hoped. So I had to intrusively modify nailgun itself.
>>
> Yep, I used the bin/ng-server script that was contained in the .zip file.
I'm pretty sure Meikel is referring to the nailgun server inside
vimclojure-2.2.0-SNAPSHOT.jar. Make sure you are running this nailgun
server, not one you got elsewhere.
Mike
On Mon, Jul 5, 2010 at 17:04, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> On Jul 5, 4:25 am, Mike Mazur <mma...@gmail.com> wrote:
>
>> I'm curious how this works for you without any plugs defined?
>
> Dang! I'm so stupid. *bangheadagainstwallbangbangbang*
>
> Of course it works for me because the plugs are in place. Why? Because
> I also use pathogen and have a link to my dev working directory there.
> [...]
No worries, it happens :) That's what your beta testers are for!
> I will fix things and update the snapshot when I'm back at home this
> evening. In case you are impatient to try the new, shiny and glorious
> version, you can get the plugin/clojure.vim from the hg repo.
I grabbed the plugins/clojure.vim file from bitbucket and all seems to
be working fine. I'll keep hacking away at it & report back if
anything breaks.
Thanks,
Mike
Yep, replaced my old vimclojure jar with the new 2.2.0 snapshot.
- Lee
Am 05.07.2010 um 16:55 schrieb Lee Hinman:
> Yep, replaced my old vimclojure jar with the new 2.2.0 snapshot.
Hmm... Ominous. Are you sure there is no other version of nailgun somewhere on the classpath?
Sincerely
Meikel
Am 05.07.2010 um 11:04 schrieb Meikel Brandmeyer:
> I will fix things and update the snapshot when I'm back at home this
> evening.
Here we go. Another round of snapshots in sync with 5cb39ed5bb0d:
btw: if someone can help with the Windows crap... any help is appreciated.
http://bitbucket.org/kotarak/vimclojure/issue/53/windows-quoting-take-38201
Sincerely
Meikel
Looks like that was it, after A/Bing my jar directories, looks like
jruby's jar contains a nailgun server, removing it fixed the problem.
Thanks for the help troubleshooting.
Is there any possibility of maybe changing your particular nailgun's
classpath to be different than the original nailgun server, that way
the ng-server script could use your custom nailgun without interfering
with any other nailgun? I was doing some Clojure/JRuby interop work
and it'd be nice not to have to worry about collisions.
Anyway, I'll get to testing the new release now, thanks for all the
hard work on VimClojure :)
- Lee
On Tue, Jul 6, 2010 at 06:03, Meikel Brandmeyer <m...@kotka.de> wrote:
> Here we go. Another round of snapshots in sync with 5cb39ed5bb0d:
>
> http://kotka.de/snapshots/vimclojure-2.2.0-SNAPSHOT.zip
> http://kotka.de/snapshots/vimclojure-2.2.0-SNAPSHOT.jar
I'm giving this version a spin and I'm getting quite frequent errors
when sending stuff out to nailgun. These errors seem random; when the
same form is evaluated, sometimes it results in an error, other times
everything is fine.
The error is only in Vim though. The code is evaluated correctly and
returns the expected results.
Let's consider an example from some Twitter API experiments I'm doing
using clojure-twitter[1]. I have a function (run-twitter-function)
which takes two arguments, a map with credentials and the name of the
clojure-twitter function to execute.
One of the functions is a straightforward query to discover how many
API requests I have remaining. Executing it at the REPL inside Vim
looks something like this:
tweetsight.core=> (run-twitter-function *twitter-credentials*
twitter/rate-limit-status)
{:remaining_hits 0, :reset_time "Thu Jul 08 05:58:26 +0000 2010",
:hourly_limit 350, :reset_time_in_seconds 1278568706}
tweetsight.core=> [ ]
This time execution was successful. A new prompt was printed below the
return value and the cursor is indicated by [ ]. At this point I can
hit C-up and execute the previous function again. The third time I
execute this code, I get the following error popping up at the bottom
of the Vim window:
Error detected while processing function 90..vimclojure#ExecuteNailWithInput:
line 19:
E605: Exception not caught: Couldn't execute Nail!^@{"value" :
"tweetsight.core", "stdout" : "", "stderr" : ""}
Error detected while processing function 90:
line 30:
E171: Missing :endif
Press ENTER or type command to continue
After pressing ENTER, my cursor is in the REPL window in Vim, but I am
no longer in INSERT mode:
tweetsight.core=> (run-twitter-function *twitter-credentials*
twitter/rate-limit-status[)]
{:remaining_hits 0, :reset_time "Thu Jul 08 05:58:26 +0000 2010",
:hourly_limit 350, :reset_time_in_seconds 1278568706}
Again the cursor is indicated with [ ], this time it's sitting at the
end of the code I executed, the same place it was when I pressed enter
to send this code off. The correct result is printed below. In order
to proceed, I will delete the result (with dd), then enter insert mode
and just execute the function again, or remove it and execute a
different function.
I'm curious about the error message that is printed. It has some line
numbers (19, 30), where are these line numbers from? I looked inside
autoload/vimclojure.vim which defines vimclojure#ExecuteNailWithInput,
but lines 19 and 30 are in highlighting functions, so I'm not sure.
This happens quite frequently, on any code. Hopefully the description
above is sufficiently detailed to give you some insights into what's
happening. If you need more details, please ask :)
Thanks!
Mike
[1] http://github.com/mikem/clojure-twitter/ a fork of
http://github.com/mattrepl/clojure-twitter/
Am 10.07.2010 um 18:10 schrieb MarkSwanson:
> I've done this and I get:
> Couldn't execute Nail! (227)
>
> I get this a lot. I just retry reloading my clojure file over and over
> until it works.
> 227 is a weird error. 227-128 is signal 99. ??
Hmm.. Could you try something rather eccentric? Please use something different as "client". Eg. /bin/echo. Does the same problem occur?
Sincerely
Meikel
I just grabbed the latest version with your changes and will give it a
spin. Will report after using it for a while.
Thanks!
Mike
I encountered the following error when executing ",close":
Error detected while processing function
90..87..vimclojure#ExecuteNail..vimclojure#ExecuteNailWithInput:
line 19:
E605: Exception not caught: Couldn't execute Nail! (227)^@{"value" :
0, "stdout" : "", "stderr" : ""}
Error detected while processing function 90..87:
line 2:
E171: Missing :endif
Error detected while processing function 90:
line 9:
E171: Missing :endif
Press ENTER or type command to continue
And another one when trying to call count on an unbound var:
tweetsight.core=> (count ts)
#<CompilerException java.lang.IllegalStateException: Var
tweetsight.core/ts is unbound. (REPL:5)>
Error detected while processing function 90..vimclojure#ExecuteNailWithInput:
line 19:
E605: Exception not caught: Couldn't execute Nail! (227)^@{"value" :
"tweetsight.core", "stdout" : "", "stderr" : ""}
Error detected while processing function 90:
line 30:
E171: Missing :endif
Press ENTER or type command to continue
Only those two failures happened to me today, I think that brings the
frequency down from before.
Thanks,
Mike