MCPcopy Create free account
hub / github.com/anomalyco/opencode / sendSelection

Function sendSelection

packages/opencode/test/cli/tui/editor-context.test.tsx:71–86  ·  view source on GitHub ↗
(socket: FakeWebSocket, filePath: string, text = "foo")

Source from the content-addressed store, hash-verified

69}
70
71function sendSelection(socket: FakeWebSocket, filePath: string, text = "foo") {
72 socket.message(
73 JSON.stringify({
74 jsonrpc: "2.0",
75 method: "selection_changed",
76 params: {
77 text,
78 filePath,
79 selection: {
80 start: { line: 1, character: 1 },
81 end: { line: 1, character: 4 },
82 },
83 },
84 }),
85 )
86}
87
88function expectedSelection(filePath: string, text = "foo") {
89 return {

Callers 1

Calls 1

messageMethod · 0.45

Tested by

no test coverage detected