Skip to content

Commit 45e8866

Browse files
committed
[FIX] server: Document symbol - do not return a class name if the ast does not contain it
1 parent f7de583 commit 45e8866

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/src/features/document_symbols.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ impl DocumentSymbolFeature {
9292
}
9393

9494
fn visit_class(session: &mut SessionInfo, results: &mut Vec<DocumentSymbol>, file_info: &Rc<RefCell<FileInfo>>, stmt_class_def: &StmtClassDef) {
95+
if stmt_class_def.name.to_string().is_empty() {
96+
return;
97+
}
9598
let mut children_symbols: Vec<DocumentSymbol> = vec![];
9699
for child in stmt_class_def.body.iter() {
97100
DocumentSymbolFeature::visit_stmt(session, child, &mut children_symbols, file_info);

0 commit comments

Comments
 (0)