123456789_123456789_123456789_123456789_123456789_

Class: TypeProf::LSP::Message::TextDocument::CodeLens

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: TypeProf::LSP::Message
Defined in: lib/typeprof/lsp/messages.rb

Constant Summary

::TypeProf::LSP::Message - Inherited

Classes, Table

Class Method Summary

Instance Method Summary

Constructor Details

This class inherits a constructor from TypeProf::LSP::Message

Instance Method Details

#run

[ GitHub ]

  
# File 'lib/typeprof/lsp/messages.rb', line 275

def run
  @params => { textDocument: { uri: } }
  text = @server.open_texts[uri]
  if !text || !@server.signature_enabled
    respond(nil)
    return
  end
  ret = []
  @server.core.code_lens(text.path) do |code_range, title|
    pos = code_range.first
    ret << {
      range: TypeProf::CodeRange.new(pos, pos.right).to_lsp,
      command: {
        title: "#: " + title,
        command: "typeprof.createPrototypeRBS",
        arguments: [uri, code_range.first.lineno, code_range.first.column, title],
      },
    }
  end
  respond(ret)
end