Skip to content

Commit

Permalink
Some cleanup from pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
emarcotte-dh committed Jul 17, 2024
1 parent a4f6b55 commit 5b368c9
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::unreachable;

use async_lsp::lsp_types::{
Diagnostic, DiagnosticSeverity, DocumentSymbol, Location, MarkedString, Position,
PublishDiagnosticsParams, Range, SymbolKind, Url,
Expand Down Expand Up @@ -40,10 +42,6 @@ impl DocumentSymbolTreeBuilder {
}

fn build(self) -> Vec<DocumentSymbol> {
assert!(
self.stack.is_empty(),
"The symbol stack isn't empty which is a bug :("
);
self.found
}
}
Expand All @@ -65,10 +63,7 @@ impl ProtoParser {
}

impl ParsedTree {
fn walk_and_collect_kinds<'a>(
cursor: &mut TreeCursor<'a>,
kinds: &[&str],
) -> Vec<Node<'a>> {
fn walk_and_collect_kinds<'a>(cursor: &mut TreeCursor<'a>, kinds: &[&str]) -> Vec<Node<'a>> {
let mut v = vec![];

loop {
Expand Down Expand Up @@ -191,7 +186,7 @@ impl ParsedTree {
let kind = match node.kind() {
"message_name" => SymbolKind::STRUCT,
"enum_name" => SymbolKind::ENUM,
_ => panic!("Should be impossible"),
_ => unreachable!("unsupported symbol kind"),
};
let detail = self.find_preceding_comments(node.id(), content);
let message = node.parent().unwrap();
Expand Down Expand Up @@ -570,25 +565,6 @@ message Outer2 {
},
)
);
/*
assert_eq!(res[0].uri, Url::parse(url).unwrap());
assert_eq!(
res[0].range,
Range {
start: Position {
line: 5,
character: 12
},
end: Position {
line: 5,
character: 18
},
}
);
let res = tree.definition(&posinvalid, &url.parse().unwrap(), contents);
assert_eq!(res.len(), 0);
*/
}

#[test]
Expand Down

0 comments on commit 5b368c9

Please sign in to comment.