The Format Document command appears in the Edit menu and Shift+Alt+F is listed as its shortcut, but pressing it does nothing. The handler in FullscreenIDE.tsx is explicitly a no-op with a comment acknowledging it has no equivalent yet.
What needs to happen
The most practical path here is to call external formatters based on the file language, similar to how most editors handle this:
- TypeScript / TSX / JS: call
prettier or eslint --fix if available in the project - Rust: call
rustfmt - Go: call
gofmt - Python: call
black or autopep8 - C / C++: call
clang-format - JSON: can be done in-house with JSON.stringify(JSON.parse(...), null, 2) since we already parse JSON
The formatter should be invoked via the C++ backend (similar to how shell commands work), the formatted text piped back, and the editor buffer replaced with the result. If no formatter is found for the language, show a small notification rather than silently doing nothing.
Files likely involved
app/frontend/src/fullscreen/FullscreenIDE.tsx -- the menu command handlerapp/frontend/src/components/GpuEditor.tsx -- would need a "replace all content" APIcpp/src/ -- new formatter invocation logic- A language-to-formatter map
Acceptance criteria
- Shift+Alt+F on a JS/TS file runs prettier if it exists and replaces the buffer
- On a Rust file, runs rustfmt
- On a file with no known formatter, shows a small "No formatter available for [language]" toast
- Cursor position is preserved where possible after formatting
The Format Document command appears in the Edit menu and Shift+Alt+F is listed as its shortcut, but pressing it does nothing. The handler in FullscreenIDE.tsx is explicitly a no-op with a comment acknowledging it has no equivalent yet.
What needs to happen
The most practical path here is to call external formatters based on the file language, similar to how most editors handle this:
prettieroreslint --fixif available in the projectrustfmtgofmtblackorautopep8clang-formatThe formatter should be invoked via the C++ backend (similar to how shell commands work), the formatted text piped back, and the editor buffer replaced with the result. If no formatter is found for the language, show a small notification rather than silently doing nothing.
Files likely involved
app/frontend/src/fullscreen/FullscreenIDE.tsx-- the menu command handlerapp/frontend/src/components/GpuEditor.tsx-- would need a "replace all content" APIcpp/src/-- new formatter invocation logicAcceptance criteria