Class: Solargraph::LanguageServer::Message::TextDocument::FoldingRange

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

Instance Attribute Summary

Attributes inherited from Base

#filename

Attributes inherited from Base

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

Instance Method Summary collapse

Methods inherited from Base

#post_initialize

Methods included from UriHelpers

decode, encode, file_to_uri, uri_to_file

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
21
# File 'lib/solargraph/language_server/message/text_document/folding_range.rb', line 10

def process
  result = host.folding_ranges(params['textDocument']['uri']).map do |range|
    {
      startLine: range.start.line,
      startCharacter: 0,
      endLine: range.ending.line - 1,
      endCharacter: 0,
      kind: 'region'
    }
  end
  set_result result
end