@Jonas Schievink I see that you are adding fst to import map. If you want to use it during completion as well, you might, or might not need completion resolve request.
This is not implemented at the moment, but it should allow to postone the computation of an edit until the moment the completion is actually selected.
I think we probably should get by without one (my gut feeling is that we can't save a lot of work that way), but it's an important thing to be aware of.
Ah, yes, I think I saw some comments about that
Are there any tests for the symbol index by the way? I can't get the existing tests to fail when I try :D
Good question! Seems like no? Which is a bit of a surprise, tbh :)
In my defense, this is one of the oldest bits of rust-analyzer, which survived mostly intact :D
Is there a way to get the files that comprise a given crate? I've been trying to use SourceRoot for this, but those contain files for other crates too.
Not really -- crates aren't really assembled from files
You can walk the tree of modules and collect all module files
13ms - handle_code_action 11ms - auto_import::search_for_imports 11ms - search_for_imports 0ms - crate_def_map:wait (1 calls) 9ms - get_name_definition (3 calls) 1ms - import_map::global_search (1 calls) 0ms - find_path (5 calls)
That's better (than the >2 seconds it took earlier) :heart:
Nice! It even fits in my 16ms vanity goal I have for rust-analyzer :)
super exciting for auto-importing completions as well :smiley:
Oh yes, that would be awesome!
@Jonas Schievink could you remind what we've decided to do with https://github.com/rust-analyzer/rust-analyzer/pull/4819#discussion_r438625567?