Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for rust-ts-mode to cargo-process--get-current-test #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Taketsuru
Copy link

Emacs 29 has a new mode rust-ts-mode.
Currently, cargo-process--get-current-test doesn't work in that mode.
This change adds support for the mode to the command.

(t (user-error "%s needs either rust-mode or rustic-mode"
((fboundp 'treesit-beginning-of-defun)
(treesit-beginning-of-defun))
(t (user-error "%s needs either rust-mode, rustic-mode, or rust-ts-mode"
this-command))))
(beginning-of-line)
(search-forward "fn ")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of this, would it be more robust (and more elegant) to find the function name with something like this:

 (re-search-forward "fn\\s +\\(.*\\_>\\)") 
 (match-string 1)

Additionally, the defun does not return the current test, it returns the name of the current function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean instead of the (search-forward "fn ") part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants