jacktasia/dumb-jump

Unable to find definition in files with non-standard extension

matteo-l opened this issue · 2 comments

When working with files that have a non-standard extension,e.g. arduino files opened in c++-mode, no definition or declaration is found. Setting dumb-jump-debug to t I see that the search is done with the command
ag --nocolor --nogroup --cc --cpp
Even if I add '(:language "c++" :ext "ino" :agtype nil :rgtype nil) to dumb-jump-language-file-exts the command does not change.
Currently I add an hard link with the standard extension to make it work.

Emacs version 27.1
dumb-jump version 20201205.1625

dumb-jump will try to defer the language to search with by either the major mode or file extension. Since you're using c++-mode, it's assuming it's c++. The easiest solution for you would probably be to use arduino-mode https://melpa.org/#/arduino-mode when editing arduino files then your custom addition to dumb-jump-language-file-exts would work as expected.

I already tried arduino-mode but switched to c++-mode some time ago. I created a derived mode my-arduino from c++-mode and duplicated the rules for c++-mode and now works flawlessly. Thank you