Skip to content

Commit 13da7af

Browse files
committed
Remove indexing_v1 and lowering_v1
1 parent 1da254d commit 13da7af

File tree

135 files changed

+20
-7046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+20
-7046
lines changed

Cargo.lock

Lines changed: 1 addition & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/building/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
dashmap = "6.1.0"
88
id = { version = "0.1.0", path = "../id" }
9-
indexing_v1 = { version = "0.1.0", path = "../indexing_v1" }
9+
indexing = { version = "0.1.0", path = "../indexing" }
1010
indexmap = "2.7.1"
1111
lexing = { version = "0.1.0", path = "../lexing" }
1212
parking_lot = "0.12.3"

crates/building/src/base.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{mem, sync::Arc};
22

3-
use indexing_v1::IndexingResult;
3+
use indexing::FullModuleIndex;
44
use rowan::ast::AstNode;
55
use rustc_hash::{FxHashMap, FxHashSet};
66
use syntax::cst;
@@ -38,7 +38,7 @@ pub struct Runtime {
3838

3939
content: FxHashMap<FileId, Arc<str>>,
4040
parse: FxHashMap<FileId, cst::Module>,
41-
index: FxHashMap<FileId, Arc<IndexingResult>>,
41+
index: FxHashMap<FileId, Arc<FullModuleIndex>>,
4242

4343
parent: Option<QueryKey>,
4444
dependencies: FxHashMap<QueryKey, FxHashSet<QueryKey>>,
@@ -164,13 +164,13 @@ impl Runtime {
164164
)
165165
}
166166

167-
pub fn index(&mut self, id: FileId) -> Arc<IndexingResult> {
167+
pub fn index(&mut self, id: FileId) -> Arc<FullModuleIndex> {
168168
let k = QueryKey::Index(id);
169169
self.query(
170170
k,
171171
|this| {
172172
let module = this.parse(id);
173-
let (result, _) = indexing_v1::index(&module);
173+
let result = indexing::index_module(&module);
174174
Arc::new(result)
175175
},
176176
|this| {

crates/indexing/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ pub use source::*;
88

99
use syntax::cst;
1010

11-
pub fn index_module(module: &cst::Module) -> (Index, Relational, IndexingSource, Vec<IndexError>) {
11+
pub struct FullModuleIndex {
12+
pub index: Index,
13+
pub relational: Relational,
14+
pub source: IndexingSource,
15+
pub error: Vec<IndexError>,
16+
}
17+
18+
pub fn index_module(module: &cst::Module) -> FullModuleIndex {
1219
let algorithm::State { index, relational, source, error } = algorithm::index_module(module);
13-
(index, relational, source, error)
20+
FullModuleIndex { index, relational, source, error }
1421
}

crates/indexing/tests/indexing.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use indexing::{index_module, Index, IndexError, IndexingSource, Relational};
1+
use indexing::{index_module, FullModuleIndex, Index, IndexError, IndexingSource, Relational};
22
use rowan::ast::AstNode;
33
use std::fmt::Write;
44
use syntax::cst;
@@ -11,17 +11,17 @@ fn index_source(source: &str) -> (cst::Module, Index, Relational, IndexingSource
1111
let (module, _) = parsing::parse(&lexed, &tokens);
1212
let module = cst::Module::cast(module).unwrap();
1313

14-
let (index, relational, source, errors) = index_module(&module);
15-
(module, index, relational, source, errors)
14+
let FullModuleIndex { index, relational, source, error } = index_module(&module);
15+
(module, index, relational, source, error)
1616
}
1717

1818
test_each_file! { in "./crates/indexing/tests/indexing" => |source: &str| {
19-
let (_, index, relational, source, errors) = index_source(source);
19+
let (_, index, relational, source, error) = index_source(source);
2020

2121
let mut snapshot = String::new();
2222
writeln!(snapshot, "{:#?}", index).unwrap();
2323
writeln!(snapshot, "{:#?}", relational).unwrap();
2424
writeln!(snapshot, "{:#?}", source).unwrap();
25-
writeln!(snapshot, "{:#?}", errors).unwrap();
25+
writeln!(snapshot, "{:#?}", error).unwrap();
2626
insta::assert_snapshot!(snapshot);
2727
}}

crates/indexing_v1/Cargo.toml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)