Accessing lezer tree from command


I would like to reformat user code on “Ctrl+” using node type of lezer parsed tree.
To do so, I created a new “KeyBinding” and I am accessing the tree from “target.state.tree”.

“tree” property is not documented as part of EditorState in “@codemirror/state/dist/index.d.ts”.
Is it the right to access lezer tree from “Command” ?

Many thanks,

Use the syntaxTree function instead — that one is public.

Thanks a lot.