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

Inherits:
TypeProf::LSP::Message show all
Defined in:
lib/typeprof/lsp/messages.rb

Constant Summary collapse

METHOD =

request (required)

"initialize"

Constants inherited from TypeProf::LSP::Message

Classes, Table

Instance Method Summary collapse

Methods inherited from TypeProf::LSP::Message

build_table, find, inherited, #initialize, #log, #notify, #respond, #respond_error

Constructor Details

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

Instance Method Details

#runObject



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/typeprof/lsp/messages.rb', line 57

def run
  folders = @params[:workspaceFolders].map do |folder|
    folder => { uri:, }
    @server.uri_to_path(uri)
  end

  @server.add_workspaces(folders)

  respond(
    capabilities: {
      textDocumentSync: {
        openClose: true,
        change: 2, # Incremental
      },
      hoverProvider: true,
      definitionProvider: true,
      typeDefinitionProvider: true,
      completionProvider: {
        triggerCharacters: [".", ":"],
      },
      #signatureHelpProvider: {
      #  triggerCharacters: ["(", ","],
      #},
      codeLensProvider: {
        resolveProvider: false,
      },
      renameProvider: {
        prepareProvider: false,
      },
      executeCommandProvider: {
        commands: [
          "typeprof.createPrototypeRBS",
          "typeprof.enableSignature",
          "typeprof.disableSignature",
        ],
      },
      #typeDefinitionProvider: true,
      referencesProvider: true,
    },
    serverInfo: {
      name: "typeprof",
      version: TypeProf::VERSION,
    },
  )

  log "TypeProf for IDE is started successfully"
end