MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / selectionChangeHandler

Function selectionChangeHandler

source code/hooks/useIdeSelection.ts:93–111  ·  view source on GitHub ↗
(data: SelectionData)

Source from the content-addressed store, hash-verified

91
92 // Handler function for selection changes
93 const selectionChangeHandler = (data: SelectionData) => {
94 if (data.selection?.start && data.selection?.end) {
95 const { start, end } = data.selection
96 let lineCount = end.line - start.line + 1
97 // If on the first character of the line, do not count the line
98 // as being selected.
99 if (end.character === 0) {
100 lineCount--
101 }
102 const selection = {
103 lineCount,
104 lineStart: start.line,
105 text: data.text,
106 filePath: data.filePath,
107 }
108
109 onSelect(selection)
110 }
111 }
112
113 // Register notification handler for selection_changed events
114 ideClient.client.setNotificationHandler(

Callers 1

useIdeSelectionFunction · 0.85

Calls 1

onSelectFunction · 0.50

Tested by

no test coverage detected