diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-16 03:55:49 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-16 03:55:49 -0500 |
| commit | ad3b7617b984630723fcde7f34c866f6b4265999 (patch) | |
| tree | b224d76520d6c97a0cd87978f115e5ee0cd384f2 /modules/dev-fkeys.el | |
| parent | 67c624ae0acb4dbfb0e9e8bf5dea08033fdd5787 (diff) | |
| download | dotemacs-ad3b7617b984630723fcde7f34c866f6b4265999.tar.gz dotemacs-ad3b7617b984630723fcde7f34c866f6b4265999.zip | |
refactor(prog): six programming-track hygiene fixes from re-review
- prog-lsp.el: rename `cj/lsp--remove-eldoc-provider' →
`cj/lsp--remove-eldoc-provider-global' and call it once from the
lsp-mode `:config' block instead of attaching it per-buffer via
`lsp-managed-mode-hook'. The previous per-buffer remove with the
buffer-local flag raced lsp-mode's own population of the local
hook; removing the provider from the global default before any LSP
buffer attaches makes the absence stick. Two existing tests
updated to the new contract (remove-from-default + idempotent
re-run).
- prog-webdev.el / prog-python.el: warn at load time when
`prettier' or `pyright' is missing on PATH via
`cj/executable-find-or-warn'. Both modules now `(require
'system-lib)' to expose the helper. Missing dependencies surface
up front instead of mid-edit at first format/LSP attach.
- keyboard-compat.el: document existing idempotence. The hook
install uses a named function so `add-hook' deduplicates, and the
hook body only calls `define-key' (latest binding wins, same
value) -- adding a comment so future readers don't re-question.
- dev-fkeys.el: add a `typescript' clause to
`cj/--f6-test-runner-cmd-for'. F6 now runs `npx --no-install
vitest <path>' when vitest is on PATH, otherwise `npx --no-install
jest <path>'. Updates the matching test from "returns nil" to
cover both code paths; the impl-level test now asserts the routed
command instead of expecting a user-error.
- flycheck-config.el: build the LanguageTool wrapper path with
`(expand-file-name "scripts/languagetool-flycheck"
user-emacs-directory)' instead of a hardcoded `~/.emacs.d/...'.
Survives a non-standard `user-emacs-directory'.
- latex-config.el: replace the hardcoded Zathura viewer with
`cj/--latex-select-pdf-viewer', which walks
`cj/--latex-pdf-viewer-candidates' (zathura → evince → okular →
SumatraPDF → xdg-open) and falls back to "PDF Tools" when nothing
is on PATH. Each entry maps an executable to the matching
TeX-view-program-list name so AUCTeX's defaults handle the
actual viewer invocation.
Diffstat (limited to 'modules/dev-fkeys.el')
| -rw-r--r-- | modules/dev-fkeys.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/dev-fkeys.el b/modules/dev-fkeys.el index 170e70b96..3b0a818ca 100644 --- a/modules/dev-fkeys.el +++ b/modules/dev-fkeys.el @@ -370,6 +370,15 @@ TypeScript / JavaScript and unknown languages return nil." (if (string-empty-p rel-dir) "./" (format "./%s" rel-dir))))) + ('typescript + ;; Prefer vitest when present on PATH, fall back to jest otherwise. + ;; Both runners take a path argument and accept relative paths. + (let ((runner (or (and (executable-find "vitest") "vitest") + (and (executable-find "jest") "jest") + "jest"))) ; reasonable default for stack traces + (format "npx --no-install %s %s" + runner + (cj/shell-quote-argument-readable rel-path)))) (_ nil))) ;; ---------- F6 current-file orchestrator ---------- |
