Code Monkey home page Code Monkey logo

rust-find's Introduction

Uses rust libsyntax to find symbol definitions
and generates  HTML view of source with links
finds struct-defs, functions, methods, fields
writes ast node def info into '.rfx' files in plaintext.

"make" to compile and run test program
"make rustsrc" to generate HTML source for the main rust source tree at $(RUST_PATH)/src
./rustfind -h to display options

./rustfind cratename.rs sourcefile.rs:line:col
   ... compiles 'cratename.rs',then shows the
   location&definition referenced by sourcefile:line:col

./rustfind -j cratename.rs -- dump spans & node definition links as JSON

./rustfind -w cratename.rs -- creates HTML view of sourcecode


roadmap
[1] a commandline tool rustfind sourcefile.rs:LINE:COLUMN: --> definition.rs:LINE:col
(to add add hoc navigation tools eg gedit external tools)
  [.1] CTAGS generation  ??
  [.1] interactive commandline tool (enter src/location/symbol-> dump location)
  [.2] possibly queries like "list all the functions that use this type, list all the impls' for this type.."
  [.3] links to Rustdoc ?

[2] JSON / or other dump
.. are there any formats IDE's read for their indexers?

[3] options to dump/pretty print more context for the definitoon
  
[4] an html hyperlinked source generator, like woboq?
   ... + popup type annotaions?
   

[5] use components for IDE integration?

Notes on sourcecode:-
--------------------
-find_ast_node contains the node scanning
-borrows code from rustdoc_ng
-there might be a fair amoount of repition with the compiler internals eg ast node wrappers,
this can be cleaned up..
-a lot here would factor out if ctxt had a node_id:span map

Other:-
-------
improved syntax highlighting rust.lang & required styles (for gtksourceview) included in scripts

more ideas

can ctags actually deal with overloaded symbols?
could we write out an intermediate that editors can read for fast jump-to-def, with some dynamic context .. 


.rfx format:
------------
libname node_id source-file-name line col length  kind [identifier]
jdef nodeid libname def_node_id

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.