These are chat archives for rsense/rsense

23rd
Jun 2014
Elia Schito
@elia
Jun 23 2014 08:40
hey @edubkendo! great job! :)
Alex Coles
@myabc
Jun 23 2014 09:03
awesome :)
Eric West
@edubkendo
Jun 23 2014 09:04
been a long time coming
Elia Schito
@elia
Jun 23 2014 09:04
@edubkendo I'd like to port it to textmate2…
I also have a question
you think thor version requirement can be changed to allow for 0.19?
Eric West
@edubkendo
Jun 23 2014 09:06
that would be awesome, just let me know and I'll add the link or be happy to add you to the org to put it in the org repo, whichever works better for u
Elia Schito
@elia
Jun 23 2014 09:06
  In Gemfile:
    rsense (>= 0) ruby depends on
      thor (~> 0.18.1) ruby

    jquery-rails (>= 0) ruby depends on
      thor (0.19.1)
Eric West
@edubkendo
Jun 23 2014 09:07
ah, lemme take a look
Elia Schito
@elia
Jun 23 2014 09:07
being added to the org would be awesome (of course I have nothing done right now)
Elia Schito
@elia
Jun 23 2014 09:13
@edubkendo PR incoming,
specs pass with 0.19 (also fixed an example that was failing on my box)
Eric West
@edubkendo
Jun 23 2014 09:14
awesome! yeah, not sure now why that is in there. I considered using it at one point but then went with the json server instead
Elia Schito
@elia
Jun 23 2014 09:16
rsense/rsense#22
there we go:
  In Gemfile:
    rsense (>= 0) ruby depends on
      rsense-server (~> 0.5.6) ruby depends on
        rsense-core (~> 0.6.0) ruby depends on
          thor (~> 0.18.1) ruby

    haml-rails (>= 0) ruby depends on
      railties (>= 4.0.1) ruby depends on
        thor (0.19.1)
Eric West
@edubkendo
Jun 23 2014 09:20
pushing up the fix
Elia Schito
@elia
Jun 23 2014 09:20
cool
Eric West
@edubkendo
Jun 23 2014 09:23
so, just for a quick explanation so you don't have to find out yourself: rsense is a cli app that uses Spoon and jruby-jars gems to start a java daemon that runs rsense-server on jruby. rsense-server is the ruby guts that handles the application stuff. rsense-core is the java heart that does the type inference, with a light ruby wrapper
its a pain, but allows it to be installed as a gem into MRI
Elia Schito
@elia
Jun 23 2014 09:25
thanks, what kind of support is expected on the editor side?
Eric West
@edubkendo
Jun 23 2014 09:26
the editor just needs to send and recieve json structured like on the web site, and is expected to actually manipulate the text, and of course handle any interaction with the editor itself
I'm guessing textmate2 has an autocomplete api to tap into
Elia Schito
@elia
Jun 23 2014 09:27
will have a look at the atom adapter and see how much stuff I can reuse ;)
yes it does, alas can’t be triggered by just typing
Eric West
@edubkendo
Jun 23 2014 09:28
bummer :( . atom's native autocomplete doesn't, but autocomplete-plus does.
Elia Schito
@elia
Jun 23 2014 09:29
I already foresee yakshaving mode in which I end up trying to write a swift plugin…
lol
Eric West
@edubkendo
Jun 23 2014 09:32
I could have done the atom one quicker just using coffeescript, but eventually I plan to expose find definition , and other features, hopefully even refactoring and having all the Atom stuff wrapped already will make that a lot easier in the long run.
Elia Schito
@elia
Jun 23 2014 09:32
:+1:
Eric West
@edubkendo
Jun 23 2014 09:39
bumped everything to use the bumped thor
Elia Schito
@elia
Jun 23 2014 09:39
great
Elia Schito
@elia
Jun 23 2014 09:53
@edubkendo should the request be POST?
an example curl would help in the doc
Eric West
@edubkendo
Jun 23 2014 09:55
ah sorry yeah i'll add that tommorow yeah POST
Elia Schito
@elia
Jun 23 2014 09:58
@edubkendo ouch, the java process seem to be dying on my machine (mavericks)
Eric West
@edubkendo
Jun 23 2014 09:59
hmm running maveriicks too. what java version?
Elia Schito
@elia
Jun 23 2014 09:59
1.6
> which java
/usr/bin/java
> java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
Eric West
@edubkendo
Jun 23 2014 10:00
ah i am on 1.7.
wonder if some 1.7 specific stuff snuck in
you can run rsense-server/bin/_rsense.rb directly with jruby, and otherwise the daemon is logging to /tmp/rsense.log
Elia Schito
@elia
Jun 23 2014 10:03
pasting:
NameError: cannot link Java class org.cx4a.rsense.util.HereDocReader, probable missing dependency: org/cx4a/rsense/util/HereDocReader : Unsupported major.minor version 51.0
         for_name at org/jruby/javasupport/JavaClass.java:1250
  get_proxy_class at org/jruby/javasupport/JavaUtilities.java:34
    const_missing at file:/Users/elia/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/jruby-jars-1.7.12/lib/jruby-core-complete-1.7.12.jar!/jruby/java/java_package_module_template.rb:4
             Util at /Users/elia/.rvm/gems/ruby-2.1.2/gems/rsense-core-0.6.0/lib/rsense/util.rb:3
           Rsense at /Users/elia/.rvm/gems/ruby-2.1.2/gems/rsense-core-0.6.0/lib/rsense/util.rb:2
           (root) at /Users/elia/.rvm/gems/ruby-2.1.2/gems/rsense-core-0.6.0/lib/rsense/util.rb:1
          require at org/jruby/RubyKernel.java:1065
           (root) at /Users/elia/.rvm/gems/ruby-2.1.2/gems/rsense-core-0.6.0/lib/rsense-core.rb:1
          require at org/jruby/RubyKernel.java:1065
           (root) at /Users/elia/.rvm/gems/ruby-2.1.2/gems/rsense-core-0.6.0/lib/rsense-core.rb:13
          require at org/jruby/RubyKernel.java:1065
           (root) at /Users/elia/.rvm/gems/ruby-2.1.2/bundler/gems/rsense-server-05ee706ee403/bin/_rsense.rb:3
@edubkendo means anything to you?
Eric West
@edubkendo
Jun 23 2014 10:06
looking into it now
Eric West
@edubkendo
Jun 23 2014 10:11
definitely a jvm version thing. I dont see offhand anything that seems like special syntax in that class but I'm going to dig into it
oddly, that file hasnt been changed since m2ym originally wrote it in 2010. must be something outside the file causing issues. a compile mode thing or something
Elia Schito
@elia
Jun 23 2014 10:20
@edubkendo so, if you plan to fix it for 1.6 I’ll stick with it and be your beta tester :)
Eric West
@edubkendo
Jun 23 2014 10:21
yeah I'll figure it out. may take a bit though . I'll get a copy of 1.6 and try building there and see what needs to be fixed
Elia Schito
@elia
Jun 23 2014 10:22
awesome
Eric West
@edubkendo
Jun 23 2014 11:08
@elia ok, I just had to add some compiler flags to the rakefile . pushing up new releases now so hopefully that sorts it
one minute and i'll have them
Elia Schito
@elia
Jun 23 2014 11:10
great
Eric West
@edubkendo
Jun 23 2014 11:15
@elia ok give that a go if you can
Elia Schito
@elia
Jun 23 2014 11:16
sure
@edubkendo I did bundle update from rsense, should I checkout rsense-server and use it instead?
Eric West
@edubkendo
Jun 23 2014 11:18
i pushed new gems
new releases i mean
Elia Schito
@elia
Jun 23 2014 11:20
Errno::ENOENT: No such file or directory - /.rsense
trying after touch ~/.rsense
Eric West
@edubkendo
Jun 23 2014 11:30
any luck?
hoping that at least got the server running
Elia Schito
@elia
Jun 23 2014 12:52
yes, fighting a bit with json+mri1.8
Elia Schito
@elia
Jun 23 2014 12:58
k, switched to 2.0, but still getting ArgumentError: invalid %-encoding from the server
using this command: curl -X POST -H Accept:\ application/json --data @/tmp/rsense.json http://localhost:47367
Eric West
@edubkendo
Jun 23 2014 13:04
ah @elia is the json file your using encoded UTF-8?
Elia Schito
@elia
Jun 23 2014 13:04
I think I was missing 'Content-Type: application/json'
yep
\o/
Eric West
@edubkendo
Jun 23 2014 13:05
got completion data?
Elia Schito
@elia
Jun 23 2014 13:05
empty array for now
Eric West
@edubkendo
Jun 23 2014 13:05
well, something beats nothing for sure
Elia Schito
@elia
Jun 23 2014 13:05
should I start rsense for each project?
Eric West
@edubkendo
Jun 23 2014 13:06
no, it shouldn't be needed and might get a bit resource heavy
Elia Schito
@elia
Jun 23 2014 13:11
ok, now I see in the logs error: superclass not found: Document for an AR model
anything I can do?
Eric West
@edubkendo
Jun 23 2014 13:11
@elia I actually stopped having the Atom plugin start the server and just ask the user to start it from the command line because that was being a pain. It kept restarting too often which means rsense goes through its slow startup. I'll re-do it eventually but it isn't really hight priority, just fyi
Elia Schito
@elia
Jun 23 2014 13:13
good to know
Eric West
@edubkendo
Jun 23 2014 13:13
@elia hmm that means for some reason it didn't find in any of the places it searched, a file matching the name of Document's superclass. In this case, I'm guessing probably ActiveRecord::Base ?
Elia Schito
@elia
Jun 23 2014 13:13
yep, the same happens for a subclass of Struct.new
Eric West
@edubkendo
Jun 23 2014 13:14
it shouldn't prevent all completions though, but sounds like it is?
Elia Schito
@elia
Jun 23 2014 13:15
yep, I defined a method normailze_yadayada and try to complete "nor" a few lines below
any way to have some more verbose logging, just to check I'm passing the correct line/column
(thinking of off by 1 errors now)
Eric West
@edubkendo
Jun 23 2014 13:17
So, in the java code there is a bunch of logging stuff, with levels and I haven't had a chance to expose it from ruby. any chance you could make an issue?
Elia Schito
@elia
Jun 23 2014 13:18
I'll do
Eric West
@edubkendo
Jun 23 2014 13:20
have to leave the house now. will be back on when I get in to the office, but I have a couple errands first
Elia Schito
@elia
Jun 23 2014 13:21
np, in the meanwhile I'll push the bundle under elia/
Eric West
@edubkendo
Jun 23 2014 13:21
if you leave a message here, though, I should see it
ok cool, I'll add you to the org when I get in