mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-24 05:05:00 +00:00
fix: wrong completion kind (#127)
* fix: wrong completion kind * dev: add completion requests back to e2e testing
This commit is contained in:
parent
2c13d7efdd
commit
21a872bbe8
2 changed files with 21 additions and 18 deletions
|
@ -257,8 +257,8 @@ pub mod typst_to_lsp {
|
|||
TypstCompletionKind::Syntax => LspCompletionKind::SNIPPET,
|
||||
TypstCompletionKind::Func => LspCompletionKind::FUNCTION,
|
||||
TypstCompletionKind::Param => LspCompletionKind::VARIABLE,
|
||||
TypstCompletionKind::Constant => LspCompletionKind::FIELD,
|
||||
TypstCompletionKind::Symbol(_) => LspCompletionKind::TEXT,
|
||||
TypstCompletionKind::Constant => LspCompletionKind::CONSTANT,
|
||||
TypstCompletionKind::Symbol(_) => LspCompletionKind::FIELD,
|
||||
TypstCompletionKind::Type => LspCompletionKind::CLASS,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,7 +171,8 @@ fn e2e() {
|
|||
let log = log.trim().split('\n').collect::<Vec<_>>();
|
||||
let mut uri_set = HashSet::new();
|
||||
let mut uris = Vec::new();
|
||||
for line in log {
|
||||
let log_lines = log.len();
|
||||
for (idx, line) in log.into_iter().enumerate() {
|
||||
let mut v: Value = serde_json::from_str(line).unwrap();
|
||||
|
||||
// discover range in contentChanges and construct signatureHelp
|
||||
|
@ -210,13 +211,14 @@ fn e2e() {
|
|||
work_done_progress_params: Default::default(),
|
||||
text_document_position_params: pos.clone(),
|
||||
}));
|
||||
// todo: specific test
|
||||
// srv.request::<Completion>(json!(CompletionParams {
|
||||
// text_document_position: pos.clone(),
|
||||
// context: None,
|
||||
// work_done_progress_params: Default::default(),
|
||||
// partial_result_params: Default::default(),
|
||||
// }));
|
||||
if log_lines == idx + 1 || log_lines == idx + 5 || log_lines == idx + 10 {
|
||||
srv.request::<Completion>(json!(CompletionParams {
|
||||
text_document_position: pos.clone(),
|
||||
context: None,
|
||||
work_done_progress_params: Default::default(),
|
||||
partial_result_params: Default::default(),
|
||||
}));
|
||||
}
|
||||
srv.request::<GotoDefinition>(json!(GotoDefinitionParams {
|
||||
text_document_position_params: pos.clone(),
|
||||
work_done_progress_params: Default::default(),
|
||||
|
@ -317,13 +319,14 @@ fn e2e() {
|
|||
end: MX_POS
|
||||
}
|
||||
}));
|
||||
// todo: specific test
|
||||
// srv.request::<SemanticTokensFullRequest>(json!
|
||||
// (SemanticTokensParams { text_document:
|
||||
// TextDocumentIdentifier { uri: u.clone() },
|
||||
// work_done_progress_params: Default::default(),
|
||||
// partial_result_params: Default::default(),
|
||||
// }));
|
||||
|
||||
if log_lines == idx + 1 {
|
||||
srv.request::<SemanticTokensFullRequest>(json!(SemanticTokensParams {
|
||||
text_document: TextDocumentIdentifier { uri: u.clone() },
|
||||
work_done_progress_params: Default::default(),
|
||||
partial_result_params: Default::default(),
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -356,7 +359,7 @@ fn e2e() {
|
|||
std::fs::write(root.join("vscode/result_sorted.json"), c).unwrap();
|
||||
let hash = format!("siphash128_13:{:x}", hash);
|
||||
|
||||
insta::assert_snapshot!(hash, @"siphash128_13:379db828c1cee3340b4e98b2042d675b");
|
||||
insta::assert_snapshot!(hash, @"siphash128_13:db9523369516f3a16997fc1913381d6e");
|
||||
}
|
||||
|
||||
struct StableHash<'a>(&'a Value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue