merge primitives completion to new completion code
This commit is contained in:
parent
a11ce70bb4
commit
ce267363fb
@ -319,15 +319,30 @@ fn make_module_completions(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let (insert_text, module_profile, define_info) = if file_type == "primitives" {
|
||||||
|
let primitive_map = server.srcs.primitive_text.name_to_text.read().unwrap();
|
||||||
|
if let Some(text) = primitive_map.get(&module.name) {
|
||||||
|
insert_text.push(make_primitives_instantiation_code(text));
|
||||||
|
(
|
||||||
|
insert_text.join("\n"),
|
||||||
|
make_primitives_module_profile_code(text),
|
||||||
|
format!("[Definition] Primitive module: {}", module.name)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
insert_text.push(make_instantiation_code(&module));
|
insert_text.push(make_instantiation_code(&module));
|
||||||
|
|
||||||
let insert_text = insert_text.join("\n");
|
|
||||||
let module_profile = make_module_profile_code(&module);
|
|
||||||
|
|
||||||
let path_uri = Url::from_file_path(def_path).unwrap().to_string();
|
let path_uri = Url::from_file_path(def_path).unwrap().to_string();
|
||||||
let def_row = module.range.start.line;
|
let def_row = module.range.start.line;
|
||||||
let def_col = module.range.start.character;
|
let def_col = module.range.start.character;
|
||||||
let define_info = format!("Go to [Definition]({path_uri}#L{def_row}:{def_col})");
|
|
||||||
|
(
|
||||||
|
insert_text.join("\n"),
|
||||||
|
make_module_profile_code(&module),
|
||||||
|
format!("Go to [Definition]({path_uri}#L{def_row}:{def_col})")
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
let module_profile = MarkupContent {
|
let module_profile = MarkupContent {
|
||||||
kind: MarkupKind::Markdown,
|
kind: MarkupKind::Markdown,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user