castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
423 stars 25 forks source link

No autocompletion for Ruby on Rails #210

Open lilspelunker opened 3 years ago

lilspelunker commented 3 years ago

Code_Y6DjS1YnMB

There isn't any autocompletion for the render function, or any Ruby on Rails feature. They do show up on ri and have a proper documentation there. My app works fine when I run rails server. The autocomplete works perfectly fine for writing Ruby normally though.

lilspelunker commented 3 years ago

I tried the steps on this guide: https://solargraph.org/guides/rails

It doesn't seem to change anything.

guledali commented 3 years ago

Oh forget about auto-completion, go to definition has never ever worked for me and even github nodawayds provide a descent code-navigation. github

pykenny commented 3 years ago

I tried the steps on this guide: https://solargraph.org/guides/rails

It doesn't seem to change anything.

Having the same issue as well. Did all the things suggeted in the document, plus modifying default .solargraph.yml settings (both solargraph_rails.rb .solargraph.yml were placed under project root):

require:
- actioncable
- actionmailer
- actionpack
- actionview
- activejob
- activemodel
- activerecord
- activestorage
- activesupport

Not certain about how much it supports, but from what's defined in solargraph_rails.rb you're supposed to get something when typing MyModel.f, where MyModel is a class that inherits ActiveRecord::Base. However, nothing happen to me even after restarting the editor + extensions.

Does RoR version (working on 4.2 now) matter for Rails support?

pykenny commented 3 years ago

Based on what @lilspelunker described, I also tried ri MyModel and nothing happen as well:

Nothing known about MyModel
pykenny commented 2 years ago

@lilspelunker , not sure if you have solved it yet, but solution mentioned here may work, at least in my case some Rails documentation appears after running solargraph clear to purge Solargraph's cache.

Still a lots of things such as attr_accessible, validataions, DB callbacks, etc. do not show their documentation after applying such solution.