Skip to content

Commit 1e86f3e

Browse files
committed
Use filter_map
1 parent 78afc89 commit 1e86f3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ruby_lsp/ruby_lsp_rails/code_lens.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ def add_jump_to_view(node)
198198
.gsub("::", "/")
199199
.downcase
200200

201-
view_uris = Dir.glob("#{@client.rails_root}/app/views/#{controller_name}/#{action_name}*").map! do |path|
201+
view_uris = Dir.glob("#{@client.rails_root}/app/views/#{controller_name}/#{action_name}*").filter_map do |path|
202202
# it's possible we could have a directory with the same name as the action, so we need to skip those
203203
next if File.directory?(path)
204204

205205
URI::Generic.from_path(path: path).to_s
206-
end.compact
206+
end
207207

208208
return if view_uris.empty?
209209

0 commit comments

Comments
 (0)