vscode-solargraph icon indicating copy to clipboard operation
vscode-solargraph copied to clipboard

No autocompletion for Ruby on Rails

Open lilspelunker opened this issue 4 years ago • 5 comments

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 avatar Feb 22 '21 14:02 lilspelunker

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

It doesn't seem to change anything.

lilspelunker avatar Feb 22 '21 14:02 lilspelunker

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

guledali avatar Mar 19 '21 15:03 guledali

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 avatar Aug 02 '21 02:08 pykenny

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

Nothing known about MyModel

pykenny avatar Aug 02 '21 02:08 pykenny

@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.

pykenny avatar Nov 12 '21 05:11 pykenny