Skip to content

Commit

Permalink
Remove the old syntax tree viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Giga-Bowser committed Jan 7, 2025
1 parent 25565ae commit ba90f87
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 700 deletions.
11 changes: 0 additions & 11 deletions crates/ide/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ mod ssr;
mod static_index;
mod status;
mod syntax_highlighting;
mod syntax_tree;
mod test_explorer;
mod typing;
mod view_crate_graph;
Expand Down Expand Up @@ -330,16 +329,6 @@ impl Analysis {
})
}

/// Returns a syntax tree represented as `String`, for debug purposes.
// FIXME: use a better name here.
pub fn syntax_tree(
&self,
file_id: FileId,
text_range: Option<TextRange>,
) -> Cancellable<String> {
self.with_db(|db| syntax_tree::syntax_tree(db, file_id, text_range))
}

pub fn view_syntax_tree(&self, file_id: FileId) -> Cancellable<String> {
self.with_db(|db| view_syntax_tree::view_syntax_tree(db, file_id))
}
Expand Down
338 changes: 0 additions & 338 deletions crates/ide/src/syntax_tree.rs

This file was deleted.

12 changes: 0 additions & 12 deletions crates/rust-analyzer/src/handlers/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,6 @@ pub(crate) fn handle_memory_usage(state: &mut GlobalState, _: ()) -> anyhow::Res
Ok(out)
}

pub(crate) fn handle_syntax_tree(
snap: GlobalStateSnapshot,
params: lsp_ext::SyntaxTreeParams,
) -> anyhow::Result<String> {
let _p = tracing::info_span!("handle_syntax_tree").entered();
let id = from_proto::file_id(&snap, &params.text_document.uri)?;
let line_index = snap.file_line_index(id)?;
let text_range = params.range.and_then(|r| from_proto::text_range(&line_index, r).ok());
let res = snap.analysis.syntax_tree(id, text_range)?;
Ok(res)
}

pub(crate) fn handle_view_syntax_tree(
snap: GlobalStateSnapshot,
params: lsp_ext::ViewSyntaxTreeParams,
Expand Down
Loading

0 comments on commit ba90f87

Please sign in to comment.