class Solargraph::LanguageServer::Message::TextDocument::OnTypeFormatting

Public Instance Methods

process() click to toggle source
# File lib/solargraph/language_server/message/text_document/on_type_formatting.rb, line 8
def process
  # @todo Temporarily disabled due to conflicts with VSCode formatting on type
  # src = host.send(:library).checkout(uri_to_file(params['textDocument']['uri']))
  # fragment = src.fragment_at(params['position']['line'], params['position']['character'] - 1)
  # offset = fragment.send(:offset)
  # if fragment.string? and params['ch'] == '{' and src.code[offset - 1, 2] == '#{'
  #   set_result(
  #     [
  #       {
  #         range: {
  #           start: params['position'],
  #           end: params['position']
  #         },
  #         newText: '}'
  #       }
  #     ]
  #   )
  # else
  #   # @todo Is `nil` or `[]` more appropriate here?
  #   set_result nil
  # end
end