This Week at Zed Industries: #11

Kirill Bulatov

Kirill Bulatov

July 14th, 2023

Refreshed from last week's quiet, we've closed many long-awaited features and fixes! We're also continuing to work on our AI integration and overall stability.


This week I fixed some problems with the way Zed parses code in languages like ERB and HEEx, where multiple disjoint ranges of code need to be combined together into a single document.

For both of these templating languages, the underlying programming languages (Ruby and Elixir, respectively) have special meaning associated with newline characters. But in the outer templates, the newline characters generally don't occur within the code snippet ranges. So previously, in the following ERB file, the Ruby snippets would be parsed as if there was no newline between them, which could result in an incorrect syntax tree. Now, when parsing disjoing ranges that appear on separate lines, Zed will include a newline character in between, which matches more closely to how the code is actually interpreted.

<head><% statement_1() %></head>
<div><% statement_2() %></div>

In addition to this parsing issue, there were also problems with how Zed selected language-specific editing behaviors in templating languages like these. Previously, in these languages, commands like toggling comments and auto-closing brackets would sometimes use the "inner" language's settings, even when the cursor was not located inside of a code snippet for that language.


This week I focused on polishing branch & project picker, PHP syntax highlighting improving code generation for tree-sitter. Branch list got a new fancy "create branch" button and a modal version (keyboard enthusiasts rejoice), whereas project picker had it's result highlighting fixed. I really want to land PHP in the next week's preview release; syntax highlighting is already done and right now I am setting up an integration with LSP. Tree-sitter work I was doing is related to the way C code is generated. I started off trying to improve compile times for tree-sitter-rust and in the process I've sped up other parsers as a whole, all the while dropping compile times for tree-sitter-rust from 30 seconds to 6 seconds. Yay! For the next week I plan to continue working on PHP integration and to upstream tree-sitter changes.


I've been struggling to get inspired on the livestreaming project, so this week I decided to take a break and focus on a bunch of little UI problems we had. I added a system for resizing the splits in the center pane, added file icons, added the svelte language, and thought about how we can integrate Zed into the wider world of coding-as-content. Watch this space for more next week!


Short week for me as I got back from vacation. Mostly just catching up and having conversations with folks about where everything is at and next steps.

My individual contributions continue to be focused on a new universal Cell element that combines all of our existing elements into one for easier styling. I spent some time working with Zed's new designer Derek on crafting the ideal styling interface for that component. I also explored hot reloading our styles in development so we can craft them in Rust rather than TypeScript. We'll see where that leads.


Partial week for me after getting started on Wednesday. I've started iterating on some ideas around inline code and ai editing within buffers. I'm supporting Max and Kyle with providing some updated search ui design to accomodate the natural language search capabilites they're working on. I also spent a chunk of time with Nathan discussing the new Cell work he's been working on in GPUI. Trying to help as much as I can there with influencing the styling/layout api's specifically.


What a week! Thrilled to have Derek join us for the next month or so to help explore some design work, so we've been spending a lot of time talking a range of things around design, themes, assistant and more.

I've been working on the new Channels panel, where you will be able to see all the channels in the org/group you are in, and join them. Initially this will be used to join streams happening in the org you are in, but later this will be one of the ways you enter a discussion as well. Channels can host both a discussion and a stream. This panel is one of the blockers right now to making our vision for building Zed in public a reality, so I'm excited to get this in to the app soon. It will make joining active calls and streams much easier as well, as we are now split between Zed and Slack internally for this at the moment.

It has been pretty cool to meet mostly in Zed since we launched voice!

Otherwise, I've been working on adding some syntax highlighting for some new languages, some work in the theme, design adjustments to the assistant and more. Busy week! :)


For some time now, the team has been talking about having a way to see if Zed users are using the collaboration features, so I decided to jump in and add call events this week. I built out a calls dashboard in Metabase that has various views into the calls data. For users with telemtry enabled, we can see when calls begin, when they end, the number of users in a call, etc. As a reminder, code is never stored in our telemetry and all data is anonymous - it can't be linked to specific users.


My hopes from the last week came true and this one was also relatively calm.

I had finished a first version of the hints blogpost, got initial feedback and now it needs another rewrite — I hard tried to start it a few times, but ended up discarding the new drafts. Guess I'm just fed up with hints topic for now and have to put it away for a while. Good that there are no issues with the implementation so far, only the blogpost remains.

I've continued my crusade to tackle bugs and popular issues: fixed LSP restart issues (and released the fix myself for the first time), supported postfix completions and "select all" action in the editor. Currently I work on the improved terminal selection and navigation, but it seems quite hard to properly implement some corner cases — my only hope for Mikayla's astonishing working frenzy to help me out.


All of my work has fallen into two broad buckets, polishing the semantic index, and AI roadmapping.

This was a big week as the first version of the semantic index released internally for testing. Overally, I'm reasonably happy with the search results we are getting from the index, but alot of work has been done on polishing up the contextual information we are embedding and extending to other languages. This is work that is likely to continue into next week. Beyond language work, we've scoped out a fairly signficant UI change to make this feature more accessible and intuitive for the user, and work has only just gotten started on this new UI. While we may be further out than we initially thought for shipping this feature, the new UI is a step up and will offer a much better experience for interacting with this work.

Beyond work on the index, I spent some time this week catching up with recent AI research. The rate at which this is moving is challenging to keep up, but as the semantic index matures, more and more of my attention starts to shift towards the future of AI at Zed. Lots of great discussion going on, on what this may look like and im excited by all the interesting work we can do in this space.


I spent a fair bit of time this week diving into how we handle panics in Zed. The inner workings of Zed are deeply parallel and async, with several different mechanisms for performing non-blocking and potentially expensive background work. Depending on the situation, a panic in one of these tasks could cause incorrect crash reporting or just leave the app in an inconsistant, broken state. We still don't have a 100% solution given fundumental limitations of how threads interact but our understanding of the situation has improved and sometimes that's all you can do.