spectacles / CodeComplice

CodeIntel for Sublime Text 2 / 3
Other
167 stars 18 forks source link

Ruby autocompletion don't work #25

Closed xskif closed 9 years ago

xskif commented 9 years ago

There is no autocompletion at all.

When i typing 1. i want to see all methods like abs, abs2, ago, etc... But i need to trigger this manually.

Autcomopletetion work if i start typing first letters of method e.g. Time.n, but tooltip also offers me none Time object methods or functions, like this:

    Time.namespace :say_controller do

    end

Time don't have namespace method at all. It's a cross-language bug of plugin.

Also, when i typing chaining method calls, completion dosen't work, even manual, e.g. i have expression 1.hour.from_now, i'm expect some completion when i type 1.hour.f(hour is a method, not property)

xskif commented 9 years ago

Just trying to manually trigger completion right after dot, and this shows me only Time methods.

xskif commented 9 years ago

Funny. SublimeCodeIntel works well. =) But only with Time.. 1. don't work.

spectacles commented 9 years ago

hey, I added a fix which will make the popupTrigger work again! I just tested and it's working for me in both cases Time. and 1. .

1.hour.from_now is a Rails function and cannot work from Ruby alone. CodeComplice offers the Komodo "Rails" catalog which is for version 1.1.6 (2006).

I found this 2007 thread on Komodo's page, nothing seems to have changed from there: http://community.activestate.com/forum-topic/configuring-komodo-ruby-rails-and-code-completion

Thanx for reporting!

spectacles commented 9 years ago

I also added a hack which (for the first time in history) makes it possible to actually use the "rails" catalog in SublimeText. You can now activate it by simply adding this to your configs:

"codeintel_language_settings":
{
     "Ruby": {
...
          "codeintel_selected_catalogs": ["rails"],
...
     }
},
xskif commented 9 years ago

Thank you. I need to configure ~/.codintel/config to specify rails catalog on codeintel_selected_catalogs?

spectacles commented 9 years ago

The file you are mentioning is neither used by CodeComplice nor by the current version of SCI. You can define your settings in your user settings of CC or in your sublime-project settings. Please study the read me file for more details!

xskif commented 9 years ago

Ok, i need to specify full path to the rails bin, or just "rails" ?

wizza-smile commented 9 years ago

hey @xskif, I added two more commits for Ruby. Could you please download and give feedback, things should work better now!

These are my complete settings for Ruby:

            "Ruby":
            {
                "Ruby": "/usr/bin/ruby",
                "codeintel_selected_catalogs": ["rails"]
            }

all the best!

xskif commented 9 years ago

@wizza-smile , thank you. I will try it ASAP. It would be great, if i can download it by package control.

xskif commented 9 years ago

These are my complete settings for Ruby:

i'm install ruby and rails by RVM. My Ruby bin path is: /home/skif/.rvm/rubies/ruby-2.1.5/bin/ruby And rails path is: /home/skif/.rvm/gems/ruby-2.1.5/bin/rails

Is that change something?

xskif commented 9 years ago

Just downloaded and checked new version. Time.now - is ok. 1.hour.from_now - didn't work autocompletion for from_now method.

spectacles commented 9 years ago

Same here! The link I posted above stated that Komodo cannot resolve function calls. If you can convince me that Komodo Edit offers a completion that CodeComplice does not, I will look into it again.

xskif commented 9 years ago

@spectacles , ok. So, tell me why i need to config "codeintel_selected_catalogs": ["rails"]? I don't understand that.

spectacles commented 9 years ago

with rails catalog enabled you will get additional completions like these:

http://de.tinypic.com/r/eq8j9z/8

xskif commented 9 years ago

@spectacles , got it, but i have index updating every time when i write ActiveRecord:: Because of that i should waiting a while(10-20 seconds) before tooltip show me suggestions

spectacles commented 9 years ago

okay, please open a new issue!