Repository: dan-t/rusty-tags (language: rust)

Issue:
Async functions support
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`


Discussion / hints:
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.
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!


Fix patch:
diff --git a/src/types.rs b/src/types.rs
index 52eee89..4a087c2 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -525,7 +525,7 @@ impl TagsSpec {
                 cmd.arg("--languages=Rust")
                    .arg("--langdef=Rust")
                    .arg("--langmap=Rust:.rs")
-                   .arg("--regex-Rust=/^[ \\t]*(#\\[[^\\]]\\][ \\t]*)*(pub[ \\t]+)?(extern[ \\t]+)?(\"[^\"]+\"[ \\t]+)?(unsafe[ \\t]+)?fn[ \\t]+([a-zA-Z0-9_]+)/\\6/f,functions,function definitions/")
+                   .arg("--regex-Rust=/^[ \\t]*(#\\[[^\\]]\\][ \\t]*)*(pub[ \\t]+)?(extern[ \\t]+)?(\"[^\"]+\"[ \\t]+)?(unsafe[ \\t]+)?(async[ \\t]+)?fn[ \\t]+([a-zA-Z0-9_]+)/\\7/f,functions,function definitions/")
                    .arg("--regex-Rust=/^[ \\t]*(pub[ \\t]+)?type[ \\t]+([a-zA-Z0-9_]+)/\\2/T,types,type definitions/")
                    .arg("--regex-Rust=/^[ \\t]*(pub[ \\t]+)?enum[ \\t]+([a-zA-Z0-9_]+)/\\2/g,enum,enumeration names/")
                    .arg("--regex-Rust=/^[ \\t]*(pub[ \\t]+)?struct[ \\t]+([a-zA-Z0-9_]+)/\\2/s,structure names/")


Test patch: