class Solargraph::LanguageServer::Message::TextDocument::TypeDefinition
Public Instance Methods
Source
# File lib/solargraph/language_server/message/text_document/type_definition.rb, line 5 def process @line = params['position']['line'] @column = params['position']['character'] set_result(code_location || []) end
Private Instance Methods
Source
# File lib/solargraph/language_server/message/text_document/type_definition.rb, line 14 def code_location suggestions = host.type_definitions_at(params['textDocument']['uri'], @line, @column) return nil if suggestions.empty? suggestions.reject { |pin| pin.best_location.nil? || pin.best_location.filename.nil? }.map do |pin| { uri: file_to_uri(pin.best_location.filename), range: pin.best_location.range.to_hash } end end
@return [Array<Hash>, nil]