News for hackers. Stuff that matters.
Re:Treefrog: A code editor that uses both AST and text editi... by rajandatta on Wednesday January 05, 2022 @12:42PM (#29812198)
Parsing on newlines is probably not a great fit for Lisp-syntax languages. Does the availability of LSPs make a difference? Asking as I don't know your tool.
Re:Treefrog: A code editor that uses both AST and text editi... by Jtsummers on Wednesday January 05, 2022 @01:29PM (#29812956)
Yeah, s-exprs don't break down by lines very well, but they are easy-ish to work with in a structured format, similar to HTML/XML editors since the delineation between elements is usually very clear. The only problem with lisps would be when macros are involved where there is more fluidity in the structure. But something like this:

  (defun double-all-the-things (things)
    (mapcar (lambda (x) (* 2 x)) things))
would be straightforward to navigate through with an s-expr aware editor.
Re:Treefrog: A code editor that uses both AST and text editi... by gushogg-blake on Wednesday January 05, 2022 @01:37PM (#29813071)
It's more that the selection operates on whole lines in Tree mode, so it would parse fine with the tree-sitter grammar (for syntax highlighting etc) but selecting the inner contents of a block would take the block's closing ) with it. This would only matter if you wanted to move the contents somewhere though - editing and refactoring commands (including with the help of LSPs) will work, with the selection being the outermost node on the first selected line.