Four small fixes: bun.lock JSONC highlighting, TS 7 tsconfigs, Ctrl+H docs, Rust LSP command name - #2946
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
#2921 —
bun.lockopened 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), sobun.lockis now in thejsoncfilenames list in the default language configs (crates/fresh-editor/src/config.rs). Verified interactively in tmux against a debug build: openingbun.locknow 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.shwas already fixed (69d3575), but two generated tsconfigs still hardcoded"moduleResolution": "node"(node10), which TypeScript 7 removed — a TS 7 tsserver reading them fails witherror TS5108. BothINIT_TSCONFIG(src/init_script.rs) andTSCONFIG_CONTENT(src/services/plugins/plugin_dev_workspace.rs) now use"moduleResolution": "bundler", matching the checked-inplugins/tsconfig.jsonandcheck-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.mdnow says Ctrl+R with a note on why Ctrl+H is avoided;docs/configuration/keyboard.mddrops 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.mdtold users to run "Switch Rust Analyzer Mode"; the command registered byplugins/rust-lsp.tsis "Rust LSP: Configure Mode".Tests
config::tests::test_default_languages_map_jsonc_filenames— mapsbun.lock/tsconfig.json/devcontainer.jsonthroughdetect_language()against the default language configs. Verified it fails without the config change (bun.lock→None) and passes with it.generated_tsconfig_does_not_use_removed_module_resolutionin bothinit_script.rsandplugin_dev_workspace.rs— assert the generated tsconfig usesbundler. Verified both fail without the change and pass with it.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).bun.lockrenders with JSONC highlighting and the correct status-bar filetype.🤖 Generated with Claude Code
https://claude.ai/code/session_01D6SkGXXTcJsytTjF1TBf8Y
Generated by Claude Code