Rust-analyzer: Prefer std paths to core/alloc paths in autoimport etc.

Created on 27 Jan 2020  路  2Comments  路  Source: rust-analyzer/rust-analyzer

Autoimport and path qualification should prefer to use std paths before core or alloc. I think this probably requires a small hack here to hardcode this preference; at least I can't think of any principled rule for this.

(Note that this is unrelated to no_std; once we have no_std support, the path finding algorithm should automatically only find core paths in such crates.)

E-easy E-has-instructions

Most helpful comment

Probably, yeah!

All 2 comments

Does it make any sense to add core and alloc entries here: https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir_expand/src/name.rs#L142 to be able to compare them as names in the line proposed in the ticket?

Probably, yeah!

Was this page helpful?
0 / 5 - 0 ratings