This commit is contained in:
Eli Dowling 2024-02-11 18:26:24 +10:00 committed by faldor20
parent 6c36d5f510
commit 584a21ea7c
No known key found for this signature in database
GPG key ID: F2216079B890CD57
4 changed files with 8 additions and 8 deletions

View file

@ -163,7 +163,7 @@ fn resolve_exposed_imports(
.into_iter()
.filter_map(|(symbol, _)| {
exposes.get(&module_id)?.iter().find(|(symb, _)| {
//TODO this seems to not be comparing proprely so we aren't getting any exposed imports
//TODO this seems to not be comparing properly so we aren't getting any exposed imports
symb == &symbol
})
})
@ -179,7 +179,7 @@ fn make_modules_info(
typechecked: &MutMap<ModuleId, CheckedModule>,
) -> ModulesInfo {
//We wrap this in arc because later we will go through each module's imports and store the full list of symbols that each imported module exposes.
//eg: A imports B. B exposes [add, mutiply, divide] and A will store a reference to that list.
//eg: A imports B. B exposes [add, multiply, divide] and A will store a reference to that list.
let exposed = exposes
.into_iter()
.map(|(id, symbols)| (id, Arc::new(symbols)))

View file

@ -336,7 +336,7 @@ pub(super) fn get_upper_case_completion_items(
label: mod_name.clone(),
kind: Some(CompletionItemKind::MODULE),
documentation: Some(formatting::module_documentation(
formatting::DescripitonType::Exposes,
formatting::DescriptionsType::Exposes,
mod_id,
interns,
modules_info,

View file

@ -23,7 +23,7 @@ fn module_exposed_list(
})
})
}
pub(super) enum DescripitonType {
pub(super) enum DescriptionsType {
Exposes,
}
fn md_doc(val: String) -> Documentation {
@ -35,7 +35,7 @@ fn md_doc(val: String) -> Documentation {
///Generates a nicely formatted block of text for the completionitem documentation field
pub(super) fn module_documentation(
description_type: DescripitonType,
description_type: DescriptionsType,
module_id: &ModuleId,
interns: &Interns,
modules_info: &ModulesInfo,
@ -43,6 +43,6 @@ pub(super) fn module_documentation(
let exposed = || module_exposed_list(module_id, interns, modules_info).unwrap_or_default();
match description_type {
DescripitonType::Exposes => md_doc(format!("```roc\n{0}\n```", exposed())),
DescriptionsType::Exposes => md_doc(format!("```roc\n{0}\n```", exposed())),
}
}

View file

@ -388,11 +388,11 @@ mod tests {
}
///Runs a basic completion and returns the response
async fn completion_test(
inital: &str,
initial: &str,
addition: &str,
position: Position,
) -> Option<std::vec::Vec<std::string::String>> {
let doc = DOC_LIT.to_string() + inital;
let doc = DOC_LIT.to_string() + initial;
let (inner, url) = test_setup(doc.clone()).await;
let reg = &inner.registry;