Skip to content

Commit

Permalink
Implement stubs for required protocol methods
Browse files Browse the repository at this point in the history
  • Loading branch information
netmute committed Dec 22, 2024
1 parent aec258e commit 454d9e6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,12 @@ func handleRequest(server *Server, req RPCRequest) {
handleWorkspaceSymbol(server, req)
case "textDocument/documentSymbol":
handleDocumentSymbol(server, req)
case "$/cancelRequest":
handleCancelRequest(server, req)
case "$/setTrace":
handleSetTrace(server, req)
case "$/logTrace":
handleLogTrace(server, req)
default:
// Method not found
message := fmt.Sprintf("Method not found: %s", req.Method)
Expand Down Expand Up @@ -497,6 +503,25 @@ func handleExit(_ *Server, _ RPCRequest) {
os.Exit(0)
}

// handleCancelRequest processes the '$/cancelRequest' notification
// (For canceling in-progress requests)
func handleCancelRequest(_ *Server, _ RPCRequest) {
// Not currently in use
}

// handleSetTrace() processes the '$/setTrace' notification
// (Controls trace output level)
func handleSetTrace(_ *Server, req RPCRequest) {
// Not currently in use
sendResult(req.ID, nil)
}

// handleLogTrace() processes the '$/logTrace' notification
// (For transmitting trace data)
func handleLogTrace(_ *Server, _ RPCRequest) {
// Not currently in use
}

// handleDidOpen processes the 'textDocument/didOpen' notification
func handleDidOpen(server *Server, req RPCRequest) {
var params DidOpenTextDocumentParams
Expand Down

0 comments on commit 454d9e6

Please sign in to comment.