Class: Solargraph::LanguageServer::Message::Extended::DownloadCore

Inherits:
Base
  • Object
show all
Defined in:
lib/solargraph/language_server/message/extended/download_core.rb

Overview

Update core Ruby documentation.

Instance Attribute Summary

Attributes inherited from Base

#error, #host, #id, #method, #params, #request, #result

Instance Method Summary collapse

Methods inherited from Base

#initialize, #post_initialize, #send_response, #set_error, #set_result

Constructor Details

This class inherits a constructor from Solargraph::LanguageServer::Message::Base

Instance Method Details

#processObject


10
11
12
13
14
15
16
17
18
19
20
# File 'lib/solargraph/language_server/message/extended/download_core.rb', line 10

def process
  cmd = "solargraph download-core"
  o, s = Open3.capture2(cmd)
  if s != 0
    host.show_message "An error occurred while downloading documentation.", LanguageServer::MessageTypes::ERROR
  else
    ver = o.match(/[\d]*\.[\d]*\.[\d]*/)[0]
    host.show_message "Downloaded documentation for Ruby #{ver}.", LanguageServer::MessageTypes::INFO
    # @todo YardMap should be refreshed
  end
end