Skip to content

klutzy/typo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

typo is a small utility which generates tags and type tables. It is intended to be used via typo.vim.

Typo

typo [OPTIONS] [INPUT]

Options:
    --cfg SPEC
    -L PATH
    --sysroot PATH
    --node-id-map PATH
    --type-map PATH
  • INPUT must be root of crate. (typo tries to compile the file!)
  • Usually --sysroot should be set, where rustc is at $SYSROOT/bin.

NodeId Map

NodeId map is generated if --node-id-map PATH is passed.

typo generates list of (filename, start_pos, end_pos, node_id). It will be used with other maps.

TypeMap

Type map is generated if both --node-id-map PATH and --type-map PATH are passed.

typo Generates list of (node_id, type). With NodeId map, it is possible to find type of expression from filename and cursor position.

Tags

typo-tags [OPTIONS] [INPUT]

Options:
    --cfg SPEC
    -L PATH
    --tags PATH
    --append-tags

Unlike Rust's default ctags.rust, typo parses Rust source code thus it can generate better table.

Major sales points include:

  • Recognizes mod other; and jumps to others.rs.
  • Recognizes struct fields and enum variants.
  • Recognizes macro-generated items.

typo overwrites tags as default. --tags-append overrides the behavior.

TODOs

Currently the following features are planned:

  • Multiple crate support
  • Rename support (variable name, type, etc.)

About

tags / type table for Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages