MCPcopy Index your code
hub / github.com/Acode-Foundation/Acode / selectWordCommand

Function selectWordCommand

src/cm/commandRegistry.js:1379–1393  ·  view source on GitHub ↗
(view)

Source from the content-addressed store, hash-verified

1377}
1378
1379function selectWordCommand(view) {
1380 const resolvedView = resolveView(view);
1381 if (!resolvedView) return false;
1382 const { state } = resolvedView;
1383 const ranges = state.selection.ranges.map((range) => {
1384 const word = state.wordAt(range.head);
1385 if (word) return EditorSelection.range(word.from, word.to);
1386 const line = state.doc.lineAt(range.head);
1387 return EditorSelection.range(line.from, line.to);
1388 });
1389 resolvedView.dispatch({
1390 selection: EditorSelection.create(ranges, state.selection.mainIndex),
1391 });
1392 return true;
1393}
1394
1395async function openInAppBrowserCommand() {
1396 const url = await prompt("Enter url", "", "url", {

Callers

nothing calls this directly

Calls 2

resolveViewFunction · 0.85
createMethod · 0.65

Tested by

no test coverage detected