Open guledali opened 5 years ago
Is this just a matter of adding **.html.erb to the .solargraph.yml ?
Unfortunately, it's a lot more complicated. First, the extension would need to be modified to include .erb files in server queries. Then there are some internal issues that need to be resolved:
I might have a workable solution for the parser issue. The rest are much more difficult, and they're necessary to get accurate results for things like autocomplete.
Instead of full auto-completion can we expect the go-to definition to work in Rails views? I'm using a helper method in a view and for some reason, the go-to definition doesn't work for helper methods in the views.
@shanlalit my two-cents workaround, for the moment, is to resort to ctags to navigate from erb and slim files. You could go as far as remapping your LSP navigation commands when inside those files, so you could use the same keys instead of <C-]>
. It requires maintaining a tags file, and it might be an hassle depending on your project, but it's still better than nothing.
I would also appreciate just the go-to definition from Rails views. The parser could potentially ignore most of the file, since any ruby code should be to the right of a -
or =
.
# slim
div = foo_helper(bar)
Is it just like that ? It's not possible to use solargraph in html.erb files ? Model, nor template or partial go to definitions are not working.
Is it expected ? Just to be sure, i have spend too much time trying to make it work :)
Nothing happens in a
.erb
file, is there no support forerb
files at all?Or maybe I'm doing something wrong, I feel like this plugin should be covering the template files as well. Particularly something as basic as an
erb
file.Then there is a lot of rails method that I'm not getting intellisense & type definition for like
validates
in activemodel,before_action
in controllers and same goes forredirect_to
method even the assertions for mini-testing.Again a lot stuff missing, I do see intellisense for my own created methods which nice but not enough when you are using a framework like rails.