123456789_123456789_123456789_123456789_123456789_

Class: TypeProf::LSP::Message::Initialize

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: TypeProf::LSP::Message
Defined in: lib/typeprof/lsp.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.rb', line 415

def run
  @server.root_uri = @params[:rootUri]
  pwd = Dir.pwd
  @params[:workspaceFolders]&.each do |folder|
    folder => { uri:, }
    if pwd == URI(uri).path
      @server.root_uri = uri
    end
  end

  respond(
    capabilities: {
      textDocumentSync: {
        openClose: true,
        change: 2, # Incremental
      },
      completionProvider: {
        triggerCharacters: ["."],
      },
      signatureHelpProvider: {
        triggerCharacters: ["(", ","],
      },
      #codeActionProvider: {
      #  codeActionKinds: ["quickfix", "refactor"],
      #  resolveProvider: false,
      #},
      codeLensProvider: {
        resolveProvider: true,
      },
      executeCommandProvider: {
        commands: [
          "typeprof.createPrototypeRBS",
          "typeprof.enableSignature",
          "typeprof.disableSignature",
        ],
      },
      definitionProvider: true,
      typeDefinitionProvider: true,
      referencesProvider: true,
    },
    serverInfo: {
      name: "typeprof",
      version: "0.0.0",
    },
  )

  puts "TypeProf for IDE is started successfully"
end