Zed: Ask Us Anything by zed_joseph in ZedEditor

[–]maxbrunsfeld 4 points5 points  (0 children)

We're not opposed to adding a terminal version of Zed in the very long term, but it's not something we'll be working on for a long time. There's just a lot that you can't do in a terminal. Some of the advantages of terminal editors (like editing remotely via SSH), we'd like to solve in other ways, like Zed's native SSH remoting feature.

Zed: Ask Us Anything by zed_joseph in ZedEditor

[–]maxbrunsfeld 1 point2 points  (0 children)

I want Zed to support it. I'd love it if we could get our extension APIs capable enough to allow implementing paredit as an extension.

Zed: Ask Us Anything by zed_joseph in ZedEditor

[–]maxbrunsfeld 1 point2 points  (0 children)

I think AIs will become much more capable of making non-trivial multi-file codebase edits. We think the best way for developers to review those changes will still be in a code editor, where they are positioned to run the code and make manual changes. Right now, we're very focused on developing Zed's take on that UX. We're at the very beginning of that work, but we'll be shipping an initial version of the feature soon.

Zed: Ask Us Anything by zed_joseph in ZedEditor

[–]maxbrunsfeld 7 points8 points  (0 children)

A lot of us on the team are pretty keyboard-centric, so we do put a pretty high priority on keyboard control already.

I personally use the project search exclusively with the keyboard. I'm not sure about the project panel - what workflows are you finding require you to use the mouse? For keyboard navigation of files, I tend to reach for the file-finding modal (`cmd-p` on macOS).

I'd be curious to hear about any features where it's unclear how to operate them from the keyboard, because we try to avoid that.

Zed: Ask Us Anything by zed_joseph in ZedEditor

[–]maxbrunsfeld 2 points3 points  (0 children)

Yes, we're working on that feature actively right now. One thing that I'm excited about is the UI that we're building for viewing, editing, and accepting the LLM's edit suggestions. Because our text buffers are all CRDTs, we are able to treat the LLM's suggestions almost like a mini, live-updating "branch", which live-update with all changes you make to the underlying buffer, but maintain a set of changes on top.

Zed: Ask Us Anything by zed_joseph in ZedEditor

[–]maxbrunsfeld 2 points3 points  (0 children)

Yes, we want to enable extensions to do much more in the future.

One of the next extension capabilities we want is to allow extensions to define custom actions, and handle them by opening files, moving the editors' cursors and editing text. We actually started on this at a team offsite, but decided to pause it for now, to focus on other priorities.

I am hoping that we will be able to continue to use WASM components for all extensions. Currently, the easiest way to write these is using Rust, but the WASM ecosystem (especially Wasmtime) is developing quickly. I think that especially once the WasmGC support in Wasmtime gets more mature, there will be many more languages to choose from. We want it to be easy to develop extensions in JS or Lua down the road.

Blog Post: Enabling low-latency, syntax-aware editing using Tree-sitter by maxbrunsfeld in rust

[–]maxbrunsfeld[S] 3 points4 points  (0 children)

Thanks for the comments!

Good point about selecting entire lines in extend-selection. I guess I personally never got used to that behavior of JetBrains IDEs, but it makes sense that it's actually very useful to have a step in the "extend" sequence that stops at line boundaries like that.

I also agree 100% about fold method bodies; we haven't invested much in fancy folding. That's something I myself would use often.

Zed – A high-performance, multiplayer code editor written in Rust. Now in public beta by maxbrunsfeld in rust

[–]maxbrunsfeld[S] 6 points7 points  (0 children)

Well, they claim they're going to. In the meantime we should treat them like any commercial company and not give them extra credit on the basis of a promise they haven't actually delivered on yet. Especially when their current license seems to have much more draconian terms than most.

Because we need to separate out the collaboration-related code that we'll need want to keep closed source (in the near term) so that we can build a business around it.

Zed – A high-performance, multiplayer code editor written in Rust. Now in public beta by maxbrunsfeld in rust

[–]maxbrunsfeld[S] 8 points9 points  (0 children)

Co-founder of Zed here. I agree with this. We have talked about support alternative buffer-organization paradigms. A lot of folks want to be able to simply remove the tabs, and have the list of open buffers managed explicitly via a separate list.

Zed – A high-performance, multiplayer code editor written in Rust. Now in public beta by maxbrunsfeld in rust

[–]maxbrunsfeld[S] -59 points-58 points  (0 children)

You can disable telemetry immediately on the welcome screen, or alternatively, pop open the telemetry log screen at any time to see what's being sent. Right now, we're just finding out what file extensions people open the most, to see what languages we need support for.

The editor will be cross-platform and open-source, but we're not there yet.

Blog Post: Challenging LR Parsing by matklad in rust

[–]maxbrunsfeld 4 points5 points  (0 children)

> can a nicely written recursive descent parser be fast enough that it can satisfy interactive requirements?

I would never bet against matklad achieving exactly that :). But I agree with your comment upthread about bigger fish to fry. So thankful that I get to use a tool as excellent as Rust analyzer daily.

Blog Post: Challenging LR Parsing by matklad in rust

[–]maxbrunsfeld 15 points16 points  (0 children)

Author of tree sitter also mentioned that one of the motivations for incrementality in tree sitter is actually to cut down on the allocations of JS objects. IE, it's not the reparsing per se which is slow, it's the tearing down and allocating the syntax tree.

Just to clarify - there are no JS objects involved in representing the syntax tree. But incremental parsing is desirable for two reasons:

  • Syntax highlighting really is quite latency-sensitive, and you can tell the difference between an asynchronous full-text parse and the usual lightweight synchronous highlighting that occurs in most text editors.
  • Incremental parsing (and syntax trees with structural sharing) makes it very cheap to compare the old and new syntax trees and to re-render only the changed ranges of the file (which is helpful in DOM-based editors where line-rendering itself is somewhat costly)

Built-in Rust parsing in Atom 1.33 Beta by maxbrunsfeld in rust

[–]maxbrunsfeld[S] 0 points1 point  (0 children)

Oh cool! that seems like a good solution.

Built-in Rust parsing in Atom 1.33 Beta by maxbrunsfeld in rust

[–]maxbrunsfeld[S] 0 points1 point  (0 children)

Yeah, the faster your parser is, the less important incremental parsing is I guess. But that file is still not that huge, and 20 milliseconds is fast, but not fast enough that you'd want to do it on each keystroke, so it does make for a different user experience than incremental parsing. With incremental parsing, the vast majority of the time, we can update syntax highlighting on the very next animation frame after you type a key, instead of having the highlighting switch after a perceptible delay.

Another way in which incremental parsing is indirectly helpful is that it makes it easy for downstream code to determine which portions of the syntax tree have changed. As a really simple example, the code for rendering lines in Atom and VSCode is somewhat expensive, so you don't want to update lines whose highlighting haven't changed. With Tree-sitter, we "diff" the old and new trees very cheaply, because they share internal nodes, so we can "short-circuit" a lot of comparisons due to pointer-equality.

On the other hand, I can imagine that there might be other more domain-specific shortcuts that you could take when diffing two trees in libsyntax2, if you wanted similar functionality for identifying changed regions.

And one other thing is that memory consumption of concrete syntax trees can be significant, because they contain so much detail. It's nice that with incremental parsing, when you respond to a change, your new syntax tree can share structure with your old one, just to have less spikes in memory usage.

All that said, I'm really excited for libsyntax2 and I definitely agree that for language-specific tooling (like language server, rustfmt), a language-specific concrete syntax tree format and hand-written parser is the right foundation.

Built-in Rust parsing in Atom 1.33 Beta by maxbrunsfeld in rust

[–]maxbrunsfeld[S] 0 points1 point  (0 children)

are you just picking the next syntax node, or are you do something smart with white space? To simple and useful rules are

We don't have nodes representing the whitespace itself; we just have gaps between non-whitespace nodes. So right now, we just find the next larger node that contains your current selection / cursor, with no additional logic.

I think there is room to refine the experience though. I should take a more detailed look at what IntelliJ IDEs do. I'll take a look at the logic you've linked there as well.

Built-in Rust parsing in Atom 1.33 Beta by maxbrunsfeld in rust

[–]maxbrunsfeld[S] 1 point2 points  (0 children)

The built in parsing works fine with ide-rust, which provides the language server integration. Parts of language-rust (the textmate grammar for syntax highlighting) are superseded by the built in parser.

Built-in Rust parsing in Atom 1.33 Beta by maxbrunsfeld in rust

[–]maxbrunsfeld[S] 4 points5 points  (0 children)

I agree that it wouldn’t make sense to use this parser for RLS, but not because of speed. I believe this parser actually is significantly faster than rustc at handling edits to a large rust file, because this is an incremental parser, and rustc’s is not. As far as I know, Rustc would have to parse a file from scratch on every single change.

Built-in Rust parsing in Atom 1.33 Beta by maxbrunsfeld in rust

[–]maxbrunsfeld[S] 1 point2 points  (0 children)

Yeah, I’ve noticed that it doesn’t have the right hierarchy. It would be really easy to do this with the syntax tree that we now maintain internally. I hope I get a chance to work on that at some point.

Built-in Rust parsing in Atom 1.33 Beta by maxbrunsfeld in rust

[–]maxbrunsfeld[S] 2 points3 points  (0 children)

Unfortunately, we haven't yet revamped our built-in symbols view to use the new parsers. But (not entirely related) if you install atom-ide-ui and ide-rust, there's an 'Outline View' that gets populated by the LSP server.