File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
lib/ruby_lsp/ruby_lsp_rails
dummy/app/views/users/index Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -199,8 +199,12 @@ def add_jump_to_view(node)
199
199
. downcase
200
200
201
201
view_uris = Dir . glob ( "#{ @client . rails_root } /app/views/#{ controller_name } /#{ action_name } *" ) . map! do |path |
202
+ # it's possible we could have a directory with the same name as the action, so we need to skip those
203
+ # next if FileTest.directory?(path)
204
+
202
205
URI ::Generic . from_path ( path : path ) . to_s
203
- end
206
+ end . compact
207
+
204
208
return if view_uris . empty?
205
209
206
210
@response_builder << create_code_lens (
Original file line number Diff line number Diff line change @@ -360,6 +360,7 @@ def index
360
360
view_lens = response [ 1 ]
361
361
362
362
assert_equal ( "Jump to view" , view_lens . command . title )
363
+ # NOTE: The `views/users` directory contains a directory named `index` which should not be returned.
363
364
assert_equal (
364
365
[ [
365
366
URI ::Generic . from_path ( path : "#{ dummy_root } /app/views/users/index.html.erb" ) . to_s ,
You can’t perform that action at this time.
0 commit comments