Class: Solargraph::LanguageServer::Message::Extended::DocumentGems

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

Overview

Update YARD documentation for installed gems. If the ‘rebuild` parameter is true, rebuild existing yardocs.

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



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/solargraph/language_server/message/extended/document_gems.rb', line 13

def process
  cmd = "yard gems"
  cmd += " --rebuild" if params['rebuild']
  o, s = Open3.capture2(cmd)
  if s != 0
    host.show_message "An error occurred while building gem documentation.", LanguageServer::MessageTypes::ERROR
    set_result({
      status: 'err'
    })
  else
    set_result({
      status: 'ok'
    })
  end
end