Rust 2019: Technical Debt, Continued Productivity, and Stability

9 Likes

In particular, the lack of a useful ctags replacement for Rust is a bit of a pain-point.

Could you elaborate on this point a bit? I think you can use ctags with rust, by providing the right regexes? Alternatively, RLS has "worksapceSymbol" request which is basically ctags?

If there's really something missing here, I think it will be relatively easy to write something together on top of Rust-analyzer: it already has functionality to index the current project and crates-io deps and do a fuzzy-search on the index. This is currently exposed via the LSP protocol, but we can totally imagine a CLI interface for this.

Yes, you can use the regex-based mode, but the difference in quality/helpfulness is pretty noticable. You get way more useful semantic info with supported languages like C/C++ and Python. Perhaps a few examples might help.

I use the vim-tagbar pluggin, which uses ctags. Here is what I get with Python:

Notice that we have classes and methods, imports, and even some privacy information.

Here is what I get for C++:

Notice that we have

  • nesting of types within namespaces
  • privacy info
  • grouping of fields, methods, typedefs, etc
  • type info

Here is what I get with Rust:

2018-12-12-114502_324x422_scrot

  • No type, privacy, or namespacing info
  • No nesting of definitions. For example notice that deref is not listed under impl Deref for E820Info. If there were multiple implementations of Deref in this file, they would all be listed one after the other under functions.
  • The types and constant section also list associated items (e.g. Target is the associated type of Deref.
  • Two of the constants are actually not const. Rather, they are extern static.

This view does not help me understand the layout of the code in this file at all. It also doesn't give a concise view of what fields, methods, etc each type or trait has. It doesn't have any notion of privacy or namespacing.

4 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.