Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Sep 12, 2022
1 parent 39b1367 commit 492248f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/ruby_lsp/requests/document_link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ def rails_documents
return {} unless RAILTIES_VERSION

$stderr.puts "Fetching Rails Documents..."
response = Net::HTTP.get_response(URI("#{RAILS_DOC_HOST}/v#{RAILTIES_VERSION}/js/search_index.js"))
response = Net::HTTP.get_response(URI("#{RAILS_DOC_HOST}/v7.1.1/js/search_index.js"))

# If the version's doc is not found, e.g. Rails main, it'll be redirected
# In this case, we just fetch the latest doc
if response.code == "302"
response = Net::HTTP.get_response(URI("#{RAILS_DOC_HOST}/js/search_index.js"))
end

table = {}

Expand Down

0 comments on commit 492248f

Please sign in to comment.