Skip to content

Four small fixes: bun.lock JSONC highlighting, TS 7 tsconfigs, Ctrl+H docs, Rust LSP command name - #2946

Merged
sinelaw merged 4 commits into
masterfrom
claude/fix-quickies
Aug 10, 2026
Merged

Four small fixes: bun.lock JSONC highlighting, TS 7 tsconfigs, Ctrl+H docs, Rust LSP command name#2946
sinelaw merged 4 commits into
masterfrom
claude/fix-quickies

Conversation

@sinelaw

@sinelaw sinelaw commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Four small, independent fixes — one commit each.

Fixes #2921
Fixes #2872
Fixes #2109
Refs #2598 (fixes only the documentation mismatch noted in that issue; the Reduced Memory mode behavior itself is untouched)

Motivation & changes

#2921bun.lock opened with no JSON highlighting. No default language claimed the filename, so it fell through to plain Text. Bun's text lockfile is JSONC (trailing commas), so bun.lock is now in the jsonc filenames list in the default language configs (crates/fresh-editor/src/config.rs). Verified interactively in tmux against a debug build: opening bun.lock now shows "JSON with Comments" in the status bar with distinct per-token colors (keys/numbers/punctuation) instead of Text with plain foreground.

#2872 — TS5108 with TypeScript 7. check-types.sh was already fixed (69d3575), but two generated tsconfigs still hardcoded "moduleResolution": "node" (node10), which TypeScript 7 removed — a TS 7 tsserver reading them fails with error TS5108. Both INIT_TSCONFIG (src/init_script.rs) and TSCONFIG_CONTENT (src/services/plugins/plugin_dev_workspace.rs) now use "moduleResolution": "bundler", matching the checked-in plugins/tsconfig.json and check-types.sh, so tsserver and the type-check script agree.

#2109 — docs claimed Ctrl+H opens find-and-replace. The actual binding is deliberate: terminals transmit Ctrl+H as 0x08/Backspace, so Fresh maps it to delete-word-backward and puts replace on Ctrl+R — a user following the docs would silently delete a word. docs/blog/editing/index.md now says Ctrl+R with a note on why Ctrl+H is avoided; docs/configuration/keyboard.md drops the bogus "Show Keybindings (Ctrl+H)" (the palette command is "Show Keyboard Shortcuts" and has no default key binding) and the ASCII-control-character caveat paragraph now lists Ctrl+H = Backspace and explains the binding choice.

#2598 (docs line only) — wrong palette command name. docs/features/lsp.md told users to run "Switch Rust Analyzer Mode"; the command registered by plugins/rust-lsp.ts is "Rust LSP: Configure Mode".

Tests

  • New: config::tests::test_default_languages_map_jsonc_filenames — maps bun.lock / tsconfig.json / devcontainer.json through detect_language() against the default language configs. Verified it fails without the config change (bun.lockNone) and passes with it.
  • New: generated_tsconfig_does_not_use_removed_module_resolution in both init_script.rs and plugin_dev_workspace.rs — assert the generated tsconfig uses bundler. Verified both fail without the change and pass with it.
  • Ran: cargo test -p fresh-editor --lib (the three tests above, plus the full lib test binary compiled), cargo fmt --check, cargo clippy -p fresh-editor (only pre-existing warnings in untouched files).
  • Manual: tmux session against a debug build — bun.lock renders with JSONC highlighting and the correct status-bar filetype.

🤖 Generated with Claude Code

https://claude.ai/code/session_01D6SkGXXTcJsytTjF1TBf8Y


Generated by Claude Code

claude added 4 commits August 10, 2026 12:12
…pace collision

The keybinding docs predate the deliberate decision to keep replace on
Ctrl+R: most terminals transmit Ctrl+H as 0x08 (Backspace), so Fresh
treats Ctrl+H as Ctrl+Backspace (delete previous word) in every keymap.
A user following the blog post would press Ctrl+H expecting find-and-
replace and silently delete a word instead.

- docs/blog/editing/index.md: Ctrl+H -> Ctrl+R for find-and-replace,
  with a note on why Ctrl+H is avoided.
- docs/configuration/keyboard.md: the palette command is 'Show Keyboard
  Shortcuts' and has no default key binding, so drop the bogus
  '(Ctrl+H)'; extend the ASCII-control-character caveat list with
  Ctrl+H = Backspace and explain the resulting binding choice.

Fixes #2109

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D6SkGXXTcJsytTjF1TBf8Y
docs/features/lsp.md told users to run 'Switch Rust Analyzer Mode', but
no such palette command exists — searching the palette for the
documented name finds nothing. The actual command registered by
plugins/rust-lsp.ts is 'Rust LSP: Configure Mode'.

Refs #2598 (fixes only the doc mismatch noted there; the Reduced Memory
mode behavior itself is unchanged)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D6SkGXXTcJsytTjF1TBf8Y
Bun's text lockfile is JSONC (it has trailing commas), but no default
language config claimed the filename, so opening bun.lock fell through
to plain Text with no syntax highlighting. Add bun.lock to the jsonc
filenames list so it routes to the JSONC grammar like the other
well-known JSONC filenames (tsconfig.json, devcontainer.json, ...).

Adds a regression test that maps well-known JSONC filenames through
detect_language() against the default language configs; it fails
without this change (bun.lock detects as None) and passes with it.

Fixes #2921

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D6SkGXXTcJsytTjF1TBf8Y
TypeScript 7 removed the old 'node' (node10) moduleResolution mode:
tsc/tsserver now fail with TS5108 when they read a config that still
uses it. Commit 69d3575 already fixed check-types.sh, but the two
tsconfigs Fresh generates — the init.ts workspace (INIT_TSCONFIG in
init_script.rs) and the plugin-dev LSP workspace (TSCONFIG_CONTENT in
plugin_dev_workspace.rs) — still hardcoded moduleResolution 'node', so
a TS 7 typescript-language-server reading them raised the same TS5108.

Switch both to 'bundler', matching the checked-in plugins/tsconfig.json
and check-types.sh so tsserver and the type-check script agree.

Adds tests asserting the generated tsconfig content uses 'bundler';
they fail without this change and pass with it.

Fixes #2872

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D6SkGXXTcJsytTjF1TBf8Y
@sinelaw
sinelaw merged commit 66f17e0 into master Aug 10, 2026
9 of 10 checks passed
@sinelaw
sinelaw deleted the claude/fix-quickies branch August 10, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants