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

Function format

src/lib/commands.js:580–589  ·  view source on GitHub ↗
(selectIfNull)

Source from the content-addressed store, hash-verified

578 }
579 },
580 async format(selectIfNull) {
581 const { editor } = editorManager;
582 const pos = editor.getCursorPosition();
583
584 const didFormat = await acode.format(selectIfNull);
585 if (didFormat) {
586 // Restore cursor position after formatting (pos.row is now 1-based)
587 editor.gotoLine(pos.row, pos.column);
588 }
589 },
590 async eol() {
591 const eol = await select(strings["new line mode"], ["unix", "windows"], {
592 default: editorManager.activeFile.eol,

Callers

nothing calls this directly

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected