@@ -1883,6 +1883,20 @@ mod cmd {
1883 doc.reload(view.id)
1883 doc.reload(view.id)
1886+ fn tree_sitter_scopes(
1887+ cx: &mut compositor::Context,
1889+ _event: PromptEvent,
1890+ ) -> anyhow::Result<()> {
1891+ let (view, doc) = current!(cx.editor);
1892+ let text = doc.text().slice(..);
1894+ let pos = doc.selection(view.id).primary().cursor(text);
1895+ let scopes = indent::get_scopes(doc.syntax(), text, pos);
1896+ cx.editor.set_status(format!("scopes: {:?}", &scopes));
1886 pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
1900 pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
1887 TypableCommand {
1901 TypableCommand {
1888 name: "quit",
1902 name: "quit",
@@ -2114,6 +2128,13 @@ mod cmd {
2114 doc: "Discard changes and reload from the source file.",
2128 doc: "Discard changes and reload from the source file.",
2115 fun: reload,
2129 fun: reload,
2116 completer: None,
2130 completer: None,
2133+ name: "tree-sitter-scopes",
2135+ doc: "Display tree sitter scopes, primarily for theming and development.",
2136+ fun: tree_sitter_scopes,