mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
removed aliases completion for now
This commit is contained in:
parent
ad5f7864b9
commit
458c41c896
2 changed files with 20 additions and 14 deletions
|
@ -282,7 +282,7 @@ impl AnalyzedDocument {
|
||||||
imports,
|
imports,
|
||||||
aliases,
|
aliases,
|
||||||
other_subs,
|
other_subs,
|
||||||
false,
|
true,
|
||||||
);
|
);
|
||||||
Some(completions)
|
Some(completions)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
use std::{
|
use std::{collections::HashMap, sync::Arc};
|
||||||
collections::{HashMap},
|
|
||||||
sync::Arc,
|
|
||||||
};
|
|
||||||
|
|
||||||
use log::{debug, trace, warn};
|
use log::{debug, trace, warn};
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
|
@ -11,7 +8,7 @@ use roc_can::{
|
||||||
pattern::{ListPatterns, Pattern, RecordDestruct, TupleDestruct},
|
pattern::{ListPatterns, Pattern, RecordDestruct, TupleDestruct},
|
||||||
traverse::{walk_decl, walk_def, walk_expr, DeclarationInfo, Visitor},
|
traverse::{walk_decl, walk_def, walk_expr, DeclarationInfo, Visitor},
|
||||||
};
|
};
|
||||||
use roc_collections::{MutMap};
|
use roc_collections::MutMap;
|
||||||
use roc_module::symbol::{Interns, ModuleId, Symbol};
|
use roc_module::symbol::{Interns, ModuleId, Symbol};
|
||||||
use roc_region::all::{Loc, Position, Region};
|
use roc_region::all::{Loc, Position, Region};
|
||||||
use roc_types::{
|
use roc_types::{
|
||||||
|
@ -20,8 +17,6 @@ use roc_types::{
|
||||||
};
|
};
|
||||||
use tower_lsp::lsp_types::{CompletionItem, CompletionItemKind};
|
use tower_lsp::lsp_types::{CompletionItem, CompletionItemKind};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use super::utils::format_var_type;
|
use super::utils::format_var_type;
|
||||||
|
|
||||||
pub struct CompletionVisitor<'a> {
|
pub struct CompletionVisitor<'a> {
|
||||||
|
@ -333,7 +328,7 @@ pub fn get_upper_case_completion_items(
|
||||||
interns: &Interns,
|
interns: &Interns,
|
||||||
_subs: &mut Subs,
|
_subs: &mut Subs,
|
||||||
imported_modules: &HashMap<ModuleId, Arc<Vec<(Symbol, Variable)>>>,
|
imported_modules: &HashMap<ModuleId, Arc<Vec<(Symbol, Variable)>>>,
|
||||||
aliases: &MutMap<Symbol, (bool, Alias)>,
|
_aliases: &MutMap<Symbol, (bool, Alias)>,
|
||||||
all_subs: &Mutex<HashMap<ModuleId, Subs>>,
|
all_subs: &Mutex<HashMap<ModuleId, Subs>>,
|
||||||
just_modules: bool,
|
just_modules: bool,
|
||||||
) -> Vec<CompletionItem> {
|
) -> Vec<CompletionItem> {
|
||||||
|
@ -368,17 +363,28 @@ pub fn get_upper_case_completion_items(
|
||||||
if just_modules {
|
if just_modules {
|
||||||
return module_completions.collect();
|
return module_completions.collect();
|
||||||
}
|
}
|
||||||
//TODO! use a proper completion type instead of simple
|
|
||||||
let aliases_completions = aliases
|
module_completions.collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
//Provides a list of complteions for Type aliases within the scope.
|
||||||
|
//TODO: Use this when we know we are within a type definition
|
||||||
|
/*
|
||||||
|
fn alias_completions(
|
||||||
|
aliases: &MutMap<Symbol, (bool, Alias)>,
|
||||||
|
module_id: &ModuleId,
|
||||||
|
interns: &Interns,
|
||||||
|
) -> Vec<CompletionItem> {
|
||||||
|
aliases
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|(symbol, (_exposed, _alias))| &symbol.module_id() == module_id)
|
.filter(|(symbol, (_exposed, _alias))| &symbol.module_id() == module_id)
|
||||||
.map(|(symbol, (_exposed, _alias))| {
|
.map(|(symbol, (_exposed, _alias))| {
|
||||||
let name = symbol.as_str(interns).to_string();
|
let name = symbol.as_str(interns).to_string();
|
||||||
CompletionItem::new_simple(name.clone(), name + "we don't know how to print types ")
|
CompletionItem::new_simple(name.clone(), name + "we don't know how to print types ")
|
||||||
});
|
})
|
||||||
|
.collect()
|
||||||
module_completions.chain(aliases_completions).collect()
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
fn make_completion_items(
|
fn make_completion_items(
|
||||||
subs: &mut Subs,
|
subs: &mut Subs,
|
||||||
module_id: &ModuleId,
|
module_id: &ModuleId,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue