MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / getWordAtCursor

Function getWordAtCursor

src/cm/lsp/references.ts:91–99  ·  view source on GitHub ↗
(view: EditorView)

Source from the content-addressed store, hash-verified

89}
90
91function getWordAtCursor(view: EditorView): string {
92 const { state } = view;
93 const pos = state.selection.main.head;
94 const word = state.wordAt(pos);
95 if (word) {
96 return state.doc.sliceString(word.from, word.to);
97 }
98 return "";
99}
100
101async function fetchReferences(
102 view: EditorView,

Callers 2

fetchReferencesFunction · 0.85
findAllReferencesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected