@@ -1883,6 +1883,20 @@ mod cmd {
18831883 doc.reload(view.id)
18841884 }
18851885
1886+ fn tree_sitter_scopes(
1887+ cx: &mut compositor::Context,
1888+ _args: &[&str],
1889+ _event: PromptEvent,
1890+ ) -> anyhow::Result<()> {
1891+ let (view, doc) = current!(cx.editor);
1892+ let text = doc.text().slice(..);
1893+
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));
1897+ Ok(())
1898+ }
1899+
18861900 pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
18871901 TypableCommand {
18881902 name: "quit",
@@ -2114,6 +2128,13 @@ mod cmd {
21142128 doc: "Discard changes and reload from the source file.",
21152129 fun: reload,
21162130 completer: None,
2131+ },
2132+ TypableCommand {
2133+ name: "tree-sitter-scopes",
2134+ alias: None,
2135+ doc: "Display tree sitter scopes, primarily for theming and development.",
2136+ fun: tree_sitter_scopes,
2137+ completer: None,
21172138 }
21182139 ];
21192140