Stream: t-compiler/wg-rls-2.0

Topic: Import map


matklad (Jun 09 2020 at 14:53, on Zulip):

@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.

matklad (Jun 09 2020 at 14:54, on Zulip):

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.

matklad (Jun 09 2020 at 14:54, on Zulip):

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.

Jonas Schievink (Jun 09 2020 at 15:07, on Zulip):

Ah, yes, I think I saw some comments about that

Jonas Schievink (Jun 09 2020 at 15:46, on Zulip):

Are there any tests for the symbol index by the way? I can't get the existing tests to fail when I try :D

matklad (Jun 09 2020 at 15:47, on Zulip):

Good question! Seems like no? Which is a bit of a surprise, tbh :)

matklad (Jun 09 2020 at 15:48, on Zulip):

In my defense, this is one of the oldest bits of rust-analyzer, which survived mostly intact :D

Jonas Schievink (Jun 09 2020 at 16:12, on Zulip):

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.

matklad (Jun 09 2020 at 16:13, on Zulip):

Not really -- crates aren't really assembled from files

matklad (Jun 09 2020 at 16:13, on Zulip):

You can walk the tree of modules and collect all module files

Jonas Schievink (Jun 09 2020 at 16:45, on Zulip):
   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:

matklad (Jun 09 2020 at 16:46, on Zulip):

Nice! It even fits in my 16ms vanity goal I have for rust-analyzer :)

Florian Diebold (Jun 09 2020 at 17:03, on Zulip):

super exciting for auto-importing completions as well :smiley:

Jonas Schievink (Jun 09 2020 at 17:32, on Zulip):

Oh yes, that would be awesome!

matklad (Jun 11 2020 at 08:30, on Zulip):

@Jonas Schievink could you remind what we've decided to do with https://github.com/rust-analyzer/rust-analyzer/pull/4819#discussion_r438625567?

Last update: Sep 27 2020 at 14:45UTC