MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / HandleRequest

Method HandleRequest

pkg/lsp/handler.go:141–168  ·  view source on GitHub ↗

HandleRequest processes an LSP request and returns a result

(method string, params json.RawMessage)

Source from the content-addressed store, hash-verified

139
140// HandleRequest processes an LSP request and returns a result
141func (h *Handler) HandleRequest(method string, params json.RawMessage) (interface{}, error) {
142 switch method {
143 case "initialize":
144 return h.handleInitialize(params)
145 case "shutdown":
146 return h.handleShutdown()
147 case "textDocument/hover":
148 return h.handleHover(params)
149 case "textDocument/completion":
150 return h.handleCompletion(params)
151 case "textDocument/formatting":
152 return h.handleFormatting(params)
153 case "textDocument/documentSymbol":
154 return h.handleDocumentSymbol(params)
155 case "textDocument/signatureHelp":
156 return h.handleSignatureHelp(params)
157 case "textDocument/codeAction":
158 return h.handleCodeAction(params)
159 case "textDocument/semanticTokens/full":
160 var semParams SemanticTokensParams
161 if err := json.Unmarshal(params, &semParams); err != nil {
162 return nil, err
163 }
164 return h.handleSemanticTokensFull(semParams)
165 default:
166 return nil, fmt.Errorf("method not found: %s", method)
167 }
168}
169
170// HandleNotification processes an LSP notification
171func (h *Handler) HandleNotification(method string, params json.RawMessage) {

Callers 15

handleMessageMethod · 0.80
TestHandler_InitializeFunction · 0.80
TestHandler_ShutdownFunction · 0.80
TestHandler_CompletionFunction · 0.80
TestHandler_HoverFunction · 0.80
TestHandler_FormattingFunction · 0.80
TestSnippetCompletionsFunction · 0.80
TestIncrementalSyncFunction · 0.80
BenchmarkHandler_HoverFunction · 0.80

Calls 10

handleInitializeMethod · 0.95
handleShutdownMethod · 0.95
handleHoverMethod · 0.95
handleCompletionMethod · 0.95
handleFormattingMethod · 0.95
handleDocumentSymbolMethod · 0.95
handleSignatureHelpMethod · 0.95
handleCodeActionMethod · 0.95
ErrorfMethod · 0.65

Tested by 15

TestHandler_InitializeFunction · 0.64
TestHandler_ShutdownFunction · 0.64
TestHandler_CompletionFunction · 0.64
TestHandler_HoverFunction · 0.64
TestHandler_FormattingFunction · 0.64
TestSnippetCompletionsFunction · 0.64
TestIncrementalSyncFunction · 0.64
BenchmarkHandler_HoverFunction · 0.64