Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

:lang rust +tree-sitter: rustic-beginning-of-function fails with void-function rust-in-str-or-cmnt

Aperta Adatta ai principianti
#80 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
emacs-lisp, rust
Ambito
tooling

Direzione di ricerca

Inizia leggendo rustic-interaction.el intorno a rustic-beginning-of-defun e rust-prog-mode.el per rust-in-str-or-cmnt. Riproduci M-x rustic-beginning-of-function con :lang rust +tree-sitter e rustic abilitato, quindi verifica che il comando raggiunga l’inizio della funzione Rust corrente senza l’errore void-function.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happened?

In a Rust buffer, calling rustic-beginning-of-function errors with:

Symbol’s function definition is void: rust-in-str-or-cmnt
Expected behavior

rustic-beginning-of-function should move to the beginning of the current Rust function without error.

Steps to reproduce
  1. Enable Rust with tree-sitter:

    :lang
    (rust +lsp +tree-sitter)
    
  2. Open a Rust buffer using rustic-mode.

  3. Call M-x rustic-beginning-of-function.

Why it seems to happen

rustic-beginning-of-function calls rustic-beginning-of-defun, which calls rust-in-str-or-cmnt:

;; rustic-interaction.el
(rust-in-str-or-cmnt)

That helper is defined by classic rust-mode in rust-prog-mode.el:

(defun rust-in-str-or-cmnt () (nth 8 (syntax-ppss)))

But with Doom's Rust tree-sitter path, rust-mode-treesitter-derive makes rust-mode derive from Emacs' built-in rust-ts-mode, so rust-prog-mode.el is not loaded. rustic still assumes the classic helper exists, so the function is void.

Local workaround

This fixes it locally:

(after! rustic-interaction
  (unless (fboundp 'rust-in-str-or-cmnt)
    (defun rust-in-str-or-cmnt () (nth 8 (syntax-ppss)))))
Possible fix

Doom could provide this compatibility shim when :lang rust +tree-sitter and rustic are used together, or avoid the rustic path that depends on classic rust-mode internals.

Versions
GNU Emacs 31.1
Doom modules commit: d57ab52a3
rustic commit: 4afbca4
rust-mode commit: 0058837
Lingua principale
Emacs Lisp
Stelle
68
Fork
42
Merge medio
4g 21h
PR unite (30g)
5

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di doomemacs/modules

Tutte le issue di doomemacs/modules

Issue simili

Altre issue su DevTools

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.