mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Make edition handling a bit nicer and allow specifying edition in crate_graph macro
This commit is contained in:
parent
d5ad38cbb8
commit
70839b7ef8
5 changed files with 28 additions and 25 deletions
|
@ -63,11 +63,7 @@ impl ProjectWorkspace {
|
|||
for tgt in pkg.targets(&self.cargo) {
|
||||
let root = tgt.root(&self.cargo);
|
||||
if let Some(file_id) = load(root) {
|
||||
let edition = if pkg.edition(&self.cargo) == "2015" {
|
||||
Edition::Edition2015
|
||||
} else {
|
||||
Edition::Edition2018
|
||||
};
|
||||
let edition = pkg.edition(&self.cargo);
|
||||
let crate_id = crate_graph.add_crate_root(file_id, edition);
|
||||
if tgt.kind(&self.cargo) == TargetKind::Lib {
|
||||
lib_tgt = Some(crate_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue