Skip to content

feat(fullscreen): Format Document, move/copy line, Go to Definition/References#90

Merged
KrisPowers merged 3 commits into
masterfrom
feat/format-document
Jul 2, 2026
Merged

feat(fullscreen): Format Document, move/copy line, Go to Definition/References#90
KrisPowers merged 3 commits into
masterfrom
feat/format-document

Conversation

@KrisPowers

@KrisPowers KrisPowers commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Implements Format Document (Shift+Alt+F): JSON formatted inline; TS/JS/CSS/Go/Rust/Python/C++ delegated to external formatters (prettier, gofmt, etc.) with a toast on error
  • Implements Move Line Up/Down (Alt+Up/Down) and Copy Line Up/Down (Shift+Alt+Up/Down) in the GPU editor
  • Implements Go to Definition (F12) and Go to References (Shift+F12) via ripgrep, closes Editor: Go to Definition and Go to References are no-ops #69
    • F12: searches project for declaration patterns; single result navigates directly, multiple show a results panel
    • Shift+F12: lists all word-boundary occurrences in a results panel
    • Empty results display a "No definition/references found" notice

Test plan

  • Open a TypeScript file, press Shift+Alt+F; confirm it formats and reloads cleanly
  • Try formatting JSON; confirm it pretty-prints in place
  • Try formatting a file with no known formatter; confirm toast appears
  • Alt+Up/Down on a line; confirm line moves
  • Shift+Alt+Up/Down; confirm line is duplicated above/below
  • Place cursor on a function name and press F12; confirm navigation or results panel
  • Place cursor on a symbol and press Shift+F12; confirm all usages appear
  • Press F12 on whitespace; confirm no crash and panel stays hidden

…rmatters

Hooks up the previously no-op Format Document command to real formatters:
- TS/JS/TSX/JSX/CSS/HTML/MD: prettier --write
- Rust: rustfmt
- Go: gofmt -w
- Python: black
- C/C++/H: clang-format -i
- JSON: in-memory JSON.stringify(JSON.parse(...), null, 2)

If no formatter is mapped for the language, shows a brief toast. If the
formatter binary is missing or errors, the first line of its output is shown.
Cursor position is preserved (clamped to the new line count) after formatting.

Closes #68
…Shift+F12)

Ripgrep-based first pass. F12 on a symbol searches the project for declaration
patterns (function/class/const/let/var/etc.); single match navigates directly,
multiple matches show a results panel. Shift+F12 lists all word-boundary
occurrences. Empty results show a "No definition found" notice.

- cpp/src/search.cpp: run_rg helper, definition_impl (pcre2 keyword pattern),
  references_impl (--word-regexp), search.definition + search.references IPC handlers
- GpuEditor.tsx: getWordAtCursor() on handle, onGoToDefinition/onGoToReferences
  props, F12/Shift+F12 key handler
- FullscreenIDE.tsx: gotoResults state, navigateToResult, handleGoToDefinition,
  handleGoToReferences, trigger wired up, results panel UI

Closes #69
@KrisPowers KrisPowers changed the title feat(editor): Format Document (Shift+Alt+F) via external formatters feat(fullscreen): Format Document, move/copy line, Go to Definition/References Jun 30, 2026
@KrisPowers KrisPowers merged commit bdd0175 into master Jul 2, 2026
30 of 32 checks passed
@KrisPowers KrisPowers deleted the feat/format-document branch July 2, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor: Go to Definition and Go to References are no-ops

1 participant