Skip to content
This repository has been archived by the owner on Nov 14, 2021. It is now read-only.
dobkeratops edited this page Sep 17, 2013 · 28 revisions

overview-of-codebase

ideas-for-rust-ide

brainstorm

Commandline use

rustfind crate_root.rs [-x where_to_find_library_source/rfx] // emit html (&rfx) .. eg generate these in the root of rust source tree, then generate in current project dir

rustfind -r crate_root.rs
// just create a .rfx ast/jump def file //(need for showing defs between crates)

you'd have to copy the .css into all dirs , someone told me to decouple style from content, whats the neatest way do deal with that..

IDE component ??

could this be extended to make a component for integrating rust support to an ide..

'interactive mode' was intended to be a step in this direction,eg something that can be fired up by an editor plugin currently this responds to queries of :: with the location of the definition. If you dont specify 'sourcefile', it uses the last sourcefile mentioned. TODO if you dont specify column-number, lookup all useful defs' on that line?

TODO

  • modify its protocol to match an existing tool for a different language (eg emacs clang autocomplete?) look at vi youcompleteme?

  • query type information of symbols

  • find definition by name, and return all possible definitons with their containing scope

  • query methods/member variables suppported by a type

  • autocomplete, like the clang plugins .. possibly supporting the same protocol as the emacs clang plugin?

RFX Files - AST dump / cross-crate metadata

(see "crosscratemap.rs" the '.rfx' is related to the CrossCrateMaps' in the source)

Allow crates to reference eachothers definitions, 'rustfind' spits out a .rfx file holding ast node &definition information; when compiling html for a given crate, it reads in any availalbe .rfx files for the library crates it references, and uses those to figure out correct jump-to-def info This is seemingly needed because the crate metadata doesnt (to my knowledge) include source information.. just whats needed to figure out correct function calls and generic function expansions

its possible the rust toolchain has this data somewhere for debugging? but at the time it wasn't conviniently accessible to me

RFX Format:-

[1]lines of:-

node cratename NodeID ParentNodeId SourceFileName Line Column SpanLength NodeKind [ident]

[2] lines of:-

jdef NodeID DefinitionCrateName DefinitionNodeID

this information alone is enough for accurate 'jump to def

was slightly surprised to see parentId > nodeId, i guess it must allocate node indices from leaves first

TODO:- also write out CTAGS ? .. but i'm not sure if ctags can do the accurate definition support. also write out type information, to relate to a struct/trait browser?

sample of what it looks like..

node	rustfind	16956	17112	jumptodefmap.rs	144	1	24	stmt	
node	rustfind	23072	23074	rustfind.rs	58	10	7	stmt	
node	rustfind	8366	13331	rust2html.rs	171	0	97	struct	FileLineNodes
node	rustfind	22784	22786	rustfind.rs	58	10	7	pat	
node	rustfind	2275	2279	find_ast_node.rs	658	51	11	method_call	
node	rustfind	15111	15114	crosscratemap.rs	61	30	4	path	
node	rustfind	8007	8026	rust2html.rs	116	7	7	pat	
...
jdef	22625	rustfind	22564
jdef	4085	rustfind	14629
jdef	14866	std	64533
jdef	14581	syntax	4956
Clone this wiki locally