Skip to content

Commit b2e0d29

Browse files
committed
Remove unusable documentation infrastructure
Rd files are not installed!!
1 parent aa71d9c commit b2e0d29

File tree

4 files changed

+3
-301
lines changed

4 files changed

+3
-301
lines changed

crates/ark/src/lsp/inputs/documentation.rs

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

crates/ark/src/lsp/inputs/documentation_rd_file.rs

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

crates/ark/src/lsp/inputs/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//
66
//
77

8-
pub mod documentation;
9-
pub mod documentation_rd_file;
108
pub mod library;
119
pub mod package;
1210
pub mod package_description;

crates/ark/src/lsp/inputs/package.rs

Lines changed: 3 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use std::fs;
99
use std::path::PathBuf;
1010

11-
use crate::lsp::inputs::documentation::Documentation;
1211
use crate::lsp::inputs::package_description::Description;
1312
use crate::lsp::inputs::package_namespace::Namespace;
1413

@@ -21,7 +20,6 @@ pub struct Package {
2120

2221
pub description: Description,
2322
pub namespace: Namespace,
24-
pub documentation: Documentation,
2523

2624
// List of symbols exported via NAMESPACE `export()` directives and via
2725
// `DocType{data}`. Note the latter should only apply to packages with
@@ -32,38 +30,21 @@ pub struct Package {
3230
}
3331

3432
impl Package {
35-
pub fn new(
36-
path: PathBuf,
37-
description: Description,
38-
namespace: Namespace,
39-
documentation: Documentation,
40-
) -> Self {
33+
pub fn new(path: PathBuf, description: Description, namespace: Namespace) -> Self {
4134
// Compute exported symbols. Start from explicit NAMESPACE exports.
42-
let mut exported_symbols = namespace.exports.clone();
43-
44-
// Add exported datasets. Ideally we'd only do that for packages
45-
// specifying `LazyData: true`.
46-
let exported_datasets = documentation.rd_files.iter().filter_map(|rd| {
47-
if rd.doc_type == Some(crate::lsp::inputs::documentation_rd_file::RdDocType::Data) {
48-
rd.name.clone()
49-
} else {
50-
None
51-
}
52-
});
53-
exported_symbols.extend(exported_datasets);
35+
let exported_symbols = namespace.exports.clone();
5436

5537
Self {
5638
path,
5739
description,
5840
namespace,
59-
documentation,
6041
exported_symbols,
6142
}
6243
}
6344

6445
#[cfg(test)]
6546
pub fn from_parts(path: PathBuf, description: Description, namespace: Namespace) -> Self {
66-
Self::new(path, description, namespace, Default::default())
47+
Self::new(path, description, namespace)
6748
}
6849

6950
/// Load a package from a given path.
@@ -92,20 +73,10 @@ impl Package {
9273
Namespace::default()
9374
};
9475

95-
let documentation_path = package_path.join("man");
96-
let documentation = match Documentation::load_from_folder(&documentation_path) {
97-
Ok(documentation) => documentation,
98-
Err(err) => {
99-
tracing::warn!("Can't load package documentation: {err:?}");
100-
Documentation::default()
101-
},
102-
};
103-
10476
Ok(Some(Self::new(
10577
package_path.to_path_buf(),
10678
description,
10779
namespace,
108-
documentation,
10980
)))
11081
}
11182

@@ -130,57 +101,3 @@ impl Package {
130101
}
131102
}
132103
}
133-
134-
#[cfg(test)]
135-
mod tests {
136-
use super::*;
137-
use crate::lsp::inputs::documentation_rd_file::RdDocType;
138-
use crate::lsp::inputs::documentation_rd_file::RdFile;
139-
use crate::lsp::inputs::package_description::Description;
140-
use crate::lsp::inputs::package_namespace::Namespace;
141-
142-
#[test]
143-
fn test_exported_symbols_combining_namespace_and_rd_files() {
144-
let namespace = Namespace {
145-
exports: vec!["foo".to_string(), "bar".to_string()],
146-
..Default::default()
147-
};
148-
149-
let rd_files = vec![
150-
RdFile {
151-
name: Some("data1".to_string()),
152-
doc_type: Some(RdDocType::Data),
153-
},
154-
RdFile {
155-
name: Some("pkgdoc".to_string()),
156-
doc_type: Some(RdDocType::Package),
157-
},
158-
RdFile {
159-
name: Some("other".to_string()),
160-
doc_type: None,
161-
},
162-
];
163-
let documentation = Documentation { rd_files };
164-
165-
let description = Description {
166-
name: "mypkg".to_string(),
167-
version: "1.0.0".to_string(),
168-
depends: vec![],
169-
fields: Default::default(),
170-
};
171-
172-
let package = Package::new(
173-
PathBuf::from("/mock/path"),
174-
description,
175-
namespace,
176-
documentation,
177-
);
178-
179-
assert!(package.exported_symbols.contains(&"foo".to_string()));
180-
assert!(package.exported_symbols.contains(&"bar".to_string()));
181-
assert!(package.exported_symbols.contains(&"data1".to_string()));
182-
183-
assert!(!package.exported_symbols.contains(&"pkgdoc".to_string()));
184-
assert!(!package.exported_symbols.contains(&"other".to_string()));
185-
}
186-
}

0 commit comments

Comments
 (0)