Fix struct recursion testing

This commit is contained in:
Sofia 2025-07-29 23:38:26 +03:00
parent 8f7b785664
commit 3adb745576
2 changed files with 4 additions and 3 deletions

View File

@ -68,7 +68,7 @@ impl LanguageServer for Backend {
Ok(())
}
async fn completion(&self, _: CompletionParams) -> jsonrpc::Result<Option<CompletionResponse>> {
async fn completion(&self, params: CompletionParams) -> jsonrpc::Result<Option<CompletionResponse>> {
Ok(Some(CompletionResponse::Array(vec![
CompletionItem::new_simple("Hello".to_string(), "Some detail".to_string()),
CompletionItem::new_simple("Bye".to_string(), "More detail".to_string()),

View File

@ -97,9 +97,10 @@ fn check_typedefs_for_recursion<'a, 'b>(
typedef.meta,
);
} else {
seen.insert(name.clone());
if let Some(inner_typedef) = defmap.get(name) {
check_typedefs_for_recursion(defmap, inner_typedef, seen.clone(), state)
let mut inner_seen = seen.clone();
inner_seen.insert(name.clone());
check_typedefs_for_recursion(defmap, inner_typedef, inner_seen.clone(), state)
}
}
}