Skip to content

Commit

Permalink
feat: Add the prefix schema to the name of the document symbol
Browse files Browse the repository at this point in the history
Signed-off-by: he1pa <[email protected]>
  • Loading branch information
He1pa committed Aug 13, 2024
1 parent dcbd9d9 commit 034ddf9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kclvm/tools/src/LSP/src/document_symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ pub(crate) fn document_symbol(
}

schema_symbol.children = Some(children);
schema_symbol.name = format!(
"schema {}",
schema_symbol.name
);
document_symbols
.push(schema_symbol.clone());
}
Expand Down Expand Up @@ -186,7 +190,7 @@ mod tests {
let mut res = document_symbol(file.as_str(), &gs).unwrap();
let mut expect = vec![];
expect.push(build_document_symbol(
"Person4",
"schema Person4",
SymbolKind::STRUCT,
((0, 7), (0, 14)),
Some(vec![build_document_symbol(
Expand All @@ -206,6 +210,8 @@ mod tests {
Some("Person4".to_string()),
));

expect.sort_by(|a, b| a.name.cmp(&b.name));

match &mut res {
DocumentSymbolResponse::Flat(_) => panic!("test failed"),
DocumentSymbolResponse::Nested(got) => {
Expand Down

0 comments on commit 034ddf9

Please sign in to comment.