Skip to content

Commit 229d72b

Browse files
authored
Adjust Rails docs logging (#338)
1 parent f768913 commit 229d72b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/ruby_lsp/ruby_lsp_rails/support/rails_document_client.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,22 @@ def generate_rails_document_urls(name)
6666
private def build_search_index
6767
return unless RAILTIES_VERSION
6868

69-
$stderr.puts("Fetching Rails Documents...")
69+
$stderr.puts("Fetching search index for Rails documentation")
7070

7171
response = Net::HTTP.get_response(URI("#{RAILS_DOC_HOST}/v#{RAILTIES_VERSION}/js/search_index.js"))
7272

7373
body = case response
7474
when Net::HTTPSuccess
75+
$stderr.puts("Finished fetching search index for Rails documentation")
7576
response.body
7677
when Net::HTTPRedirection
7778
# If the version's doc is not found, e.g. Rails main, it'll be redirected
7879
# In this case, we just fetch the latest doc
7980
response = Net::HTTP.get_response(URI("#{RAILS_DOC_HOST}/js/search_index.js"))
80-
response.body if response.is_a?(Net::HTTPSuccess)
81+
if response.is_a?(Net::HTTPSuccess)
82+
$stderr.puts("Finished fetching search index for Rails documentation")
83+
response.body
84+
end
8185
else
8286
$stderr.puts("Response failed: #{response.inspect}")
8387
nil

0 commit comments

Comments
 (0)