dan-t / rusty-tags

Create ctags/etags for a cargo project
Other
405 stars 32 forks source link

Async functions support #78

Closed k-bx closed 3 years ago

k-bx commented 3 years ago

Unless I'm not using it right, rusty-tags for me does not create tags for async functions, which make up most of the functions I write :) So I thought why not at least create an issue on this.

Invoking via rusty-tags -s ./proj emacs

dan-t commented 3 years ago

If you're using 'exuberant-ctags', then you can try extending the regex in the function 'ctags_command' in the file 'types.rs'

In the case of 'universal-ctags', the parsing of the tool itself has to be extended.

k-bx commented 3 years ago

I've added the change like this:

                   .arg("--regex-Rust=/^[ \\t]*(#\\[[^\\]]\\][ \\t]*)*(pub[ \\t]+)?(extern[ \\t]+)?(\"[^\"]+\"[ \\t]+)?(unsafe[ \\t]+)?(async[ \\t]+)?fn[ \\t]+([a-zA-Z0-9_]+)/\\6/f,functions,function definitions/")                                                   

and can see relevant blocks in TAGS file now. For example:

/home/kb/.../model.rs,88
pub async fn put_user_log_rec(async7,258
pub async fn get_user_log_recs(async30,865

Couldn't figure out what exactly is wrong, unfortunately. Help appreciated!

k-bx commented 3 years ago

All right, I think it had something to do with my etags-select, switching to helm helped.