Giter VIP home page Giter VIP logo

zed-industries / zed Goto Github PK

View Code? Open in Web Editor NEW
43.8K 189.0 2.3K 107.86 MB

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Home Page: https://zed.dev

License: Other

Rust 97.71% JavaScript 0.18% C 0.01% Metal 0.16% Shell 0.35% Scheme 0.97% Dockerfile 0.01% Procfile 0.01% Swift 0.12% Objective-C 0.01% Rich Text Format 0.13% Python 0.13% TypeScript 0.01% WGSL 0.14% Nix 0.01% Handlebars 0.09%
text-editor zed gpui

zed's Introduction

Zed

CI

Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.


Installation

Packaging status

On macOS and Linux you can download Zed directly or install Zed via your local package manager.

Other platforms are not yet available:

Developing Zed

Contributing

See CONTRIBUTING.md for ways you can contribute to Zed.

Also... we're hiring! Check out our jobs page for open roles.

Licensing

License information for third party dependencies must be correctly provided for CI to pass.

We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:

  • Is it showing a no license specified error for a crate you've created? If so, add publish = false under [package] in your crate's Cargo.toml.
  • Is the error failed to satisfy license requirements for a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to the accepted array in script/licenses/zed-licenses.toml.
  • Is cargo-about unable to find the license for a dependency? If so, add a clarification field at the end of script/licenses/zed-licenses.toml, as specified in the cargo-about book.

zed's People

Contributors

alygin avatar apricotbucket28 avatar as-cii avatar bennetbo avatar charleschen0823 avatar conradirwin avatar d1y avatar danilo-leal avatar forloveofcats avatar huacnlee avatar iamnbutler avatar josephtlyons avatar junkuizhang avatar kazatsuyu avatar kcaverly avatar kethku avatar kvark avatar maxbrunsfeld avatar maxdeviant avatar mikayla-maki avatar mrnugget avatar nathansobo avatar notpeter avatar osiewicz avatar petros avatar renovate[bot] avatar rgbkrk avatar someonetoignore avatar sonufrienko avatar weartist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zed's Issues

Time-traveling workspaces

Design

  • Chat panel
    • What happens to the workspace when hovering and clicking on a message?
    • Time-traveling indicator (what time are you rewound to?)
    • How do you jump back to the present?
    • For now, we are going to manually create a Zed organization with a #general channel
    • Long-term we'll need a way for signing up, creating a channel, etc.
  • Switching the active working copy for a given repository in the project browser
    • Every repository could have an avatar next to it
    • Clicking on the switcher opens a menu with a list of working copies sorted by when they were last edited
    • Working copies that are offline may have a gray avatar next to them, you can still click on them but they just open a read-only view

Engineering

  • When clicking on a chat message, rewind the workspace's state and jump to the sender's location
    • Persist worktree operations
    • Allow opening buffers when the worktree has been rewound
    • Maybe: Allow users to open files that weren't edited when the worktree has been rewound

Further optimizations to `FoldMap`

We should profile and optimize interacting with folds. @nathansobo and I collected some measurements on a file with 200k lines and there's quite a lot that can be done to speed up folding and unfolding.

Idea: Syntactic soft wrap

Check out this soft-wrap situation:

Screen Shot 2021-06-29 at 8 18 00 PM

It's pretty ugly and unreadable. What if we broke the line at a method call boundary and correctly indented the soft-wrapped line. We could write a Tree-sitter query that identifies syntactic nodes that are candidates for soft wrapping, then use whatever we come up for auto-indent to select synthetic indentation for the line.

zed.dev 0.2

Design & Ship new zed.dev.

Design / Dev

  • Make all new pages (app, tech, community, etc.)
  • Build prose styles
  • Add existing content (updates, release notes, etc)
  • Responsive styles
  • Style consistency pass
  • Hook up ToC

Content

  • Refine launch content in prose repo + get feedback
  • Work on our story

Last Minute To Dos

  • Updates -> releases
  • remove releases

Strech / Post-Launch

  • Figure out custom scrollbar

Polish

  • figure out why sign out link is rendering differently
  • textarea on mobile chrome doesn't seem to allow newlines
  • Custom checkboxes on mobile chrome don't render correctly

Launch

  • Generate favicons, social media text/images, etc
  • Clean up favicons (export hand-made sizes)
  • Test across browsers/device sizes Can't do until after launch.
  • Deploy to server

Need Help

Testing

This is to test discord integration.

UX design for collaboration in Zed

We think that real-time collaboration will be the biggest feature that differentiates Zed from other code editors. Our goal is to offer a workflow that lets remote teams collaborate with the same fluidity as in-person teams.

Here are a few interactions that in-person teams frequently have, and that we'd like to be able to replicate in Zed:

  • I start work in the morning and I see which members of my team are at present.
  • I'm new to a codebase, so someone on my team wants to show me around. I watch them complete a programming task, and we talk about the code verbally as we go.
  • While working by myself, I encounter some code that I don't fully understand, which was written by a teammate. I ask that teammate if they can stop what they're doing and help me when they have a moment. They look at my code with me, edit my code, and show me related code in other files.
  • I want to write some code together with two other teammates, because there are lots of decisions that we need to discuss. We trade-off editing the code, and sometimes briefly split up to make different changes at the same time.
  • Another developer has made changes to a file that I'm editing on a different branch. I am notified that our work may potentially conflict.
  • I'm the lead engineer on a medium-sized team. How can I get a birds-eye view of all the development going on right now and easily assist my teammates as they hit obstacles?

Here are some specific interactions that we think we'll need. These are a bit prescriptive so feel free to question these assumptions or structure things differently

  • Log into Zed
  • Start and stop sharing
  • Open a remote project that's being shared by a teammate
  • See other users that are editing the same repository
  • See a list of teammates
  • Follow along with a teammate
  • Talk to teammates

Broadcasting and following

  • Collaborators list (who else is editing this working copy?)
  • Who can you follow?
  • Enabling and disabling broadcasting
  • Permissions (controlling who can see, e.g. anybody else with access to the repository?)

Design

  • What does it look like when you're following somebody?
  • How do you enable broadcasting? Is it per-workspace or per-worktree?
  • Following/unfollowing mechanics

Engineering

Artifacts at the edges of rectangles

If you look closely, it seems like there are some strange gaps at the edges of quadrants. What's going on? Do we need to take more care to align things to the pixel grid?

Screen Shot 2021-03-30 at 7 23 21 PM

Investigate using `scoped_pool` for text layout

Refs #16

Previously, text layout used easy_parallel which had a significant overhead associated with it because of spawning new thread each time. That drove us to change that code path to be sequential instead, but it would be interesting to benchmark the constant cost associated with submitting work to a scoped_pool thread pool and seeing if it's suitable for a time-sensitive operation like text layout.

Trip to Italy

09/20 09/27 10/04 10/11 10/18
Nathan 🟢 🟢
Max 🟢 🟢 🟢 🟢 🟢
Antonio 🟡 🟡 🟢 🟢 🟢
Nate 🟢 🟢 🟢 🟢 🟡

Soft-wrap

  • Implement WrapMap
  • Preserve indentation when soft-wrapping
  • Gutter styling
  • Preserve scroll position when resizing the window

To Do Before 0.2 Cut

Let's do these by Friday, before sending out the investor update.

Need

  • Deploy chat changes to server
  • Fix syntax highlighting bug
  • Create #insiders channel and add all existing users as members

Want

Dev

  • Cursor should be pointer when hovering over active x in a tab

Below the line

  • x should show on all tabs when any tab or the tab bar s hovered
  • Theme picker should use same input as other selectors/file finder
  • Tab bar itself should be styleable (could be either workspace.tabbar or workspace.tabs)
  • file_finder.rs needs some cleanup after @iamnbutler hid the icon

Design

  • Refine tab symmetry
  • Separate chat and file finder input styles
  • Add shadow to chat selector
  • Open an empty buffer on launch with no args
  • Make sidebar icons smaller
  • Light theme
    • Selection style
    • Selectors
  • Add borders title bar, panels
    • Blocked: Need to be able to add a border below the titlebar
    • Blocked: Make left and right sidebar independently styleable
    • Blocked: Why can't workspace.sidebar.resize_handle be styled with background?
  • Raise title bar height to 32px
  • Update to new tabs
    • Nate: I introduced a new bug where the close button is lower on active tabs :(
  • Blocked: Style selector input

Stretch

  • key bindings to adjust buffer font size
  • make split dividers styleable in _base.toml

Out of Scope

  • Add breadcrumb
  • Add status bar

Syntax support

  • Allow chunk-oriented reading from the buffer
  • Associate each Rust buffer with a language and parse tree
  • Map capture ids from Language to style ids in Theme
  • Create initial syntax theme and bundle it
  • Remove mem::transmute from buffer::HighlightedChunks
  • Use Buffer::syntax_tree in Buffer::highlighted_chunks to make sure that tree is up-to-date (using Buffer::snapshot)
  • Write unit test for buffer::HighlightedChunks
  • Extend selection
  • Jump to matching brace
  • Syntax-based folding
  • Auto-indent
  • Language injection to support Rust macros
  • TOML support

People panel

  • See other members of your organization and see what their status is
  • Click on other members of your organization to follow them
  • Awareness of what repositories you have open

Design

Figma → https://www.figma.com/file/5OIRnHbfIr1J1AQFeoJ9Iv/Zed-Pre-Alpha?node-id=366%3A1430

Presence

  • Who is online/offline?
  • What are people doing? (Status)
  • What team/org do people belong to?
  • What actions can I take on a:
    • Online person?
    • Offline person?

Collaboration

  • Who is in the same space as you? (working copy, etc.)
    • Are they followable?
  • How do you follow somebody and what does it look like?
  • Can you see when someone is following someone else?
  • Do we render people actively working together in a special way?
  • What happens when the host moves away from the session while someone else is still editing it?

Engineering

  • Show worktree collaborators in people panel
  • Allow joining a worktree from the people panel

Project browser

This just covers the basics, mainly so we have something to build on when implementing our entry point for collaboration.

  • Panels in workspace
  • Show all worktrees in workspace
  • Collapse/expand folders
  • Open
  • Align first directory name with icon and tab titles (possibly by giving UniformList optional top and bottom padding)
  • Disclosure arrows
  • Keyboard navigation
    • Toggle panel
    • Move up, down
    • Expand/collapse directory
  • Add files / folders
  • Rename

Spurious keystrokes are dispatched on keyup events

Currently, we're dispatching extra keystroke events on keyup. For example, suppose I save the editor with cmd-s, but press and release the keys in the following order:

  1. press cmd
  2. press s
  3. release cmd
  4. release s

Between times 3 and 4, I am seeing a lot of s characters inserted into my active buffer.

Minimal worktree sharing

  • Authentication
  • Server and client RPC system
  • Share a worktree and copy a link to the clipboard
  • Open a remote worktree with the shared link
  • Find files in the remote worktree
  • Open remote files
  • Integration tests
  • Relay operations between peers
  • Show remote selections
  • Investigate error handling message: invalid buffer 6 in update buffer message
  • Send the current selections when a guest joins a buffer
  • Remote save
  • Handle dropped connections
    • Sign out the user
    • Notify other participants in a worktree of user disconnection
  • Relay file system events from the host to peers
  • Trim whitespace from worktree URLs when joining
  • Allow joining with no open windows
  • Merge zed-server into the zed repo
  • Deploy, test, and merge 🚀

Use a simpler shader for non-rounded rectangles

Looking at the Metal profiler, I'm seeing us spending a lot of time on large solid quads that don't have rounded corners. Check out the screenshot below, for example, where we draw the workspace background. A single gray quad is consuming 768µs, which is a substantial percentage of our total frame time. We should try using a much simpler shader for quads with a zero corner radius. If the rectangles are square, we can even implement borders as simple quads rather than doing any distance math in the fragment shader. Instinctively it should be almost zero cost to fill the screen with a gray box.

Screen Shot 2021-03-30 at 6 42 36 PM

/cc @as-cii

Replace individual `Anchor` usages with `AnchorSet`

This is especially important after #81. By using an AnchorSet, anchors can all have the same version and we can walk the tree only once as opposed to scanning it from the beginning once for each anchor (there's a lot of repeated work there because we need to descend the tree to count only "acknowledged" fragments). Moreover, this should also speed up anchor comparison because if anchors are all at the same version we just need to compare their offset.

I started on this but decided to punt for the time being because it is a pretty extensive change and right now it feels better to focus on shipping an initial form of collaboration.

Flaky test: platform::mac::fonts::test_layout_str

---- platform::mac::fonts::tests::test_layout_str stdout ----
thread 'platform::mac::fonts::tests::test_layout_str' panicked at 'assertion failed: `(left != right)`
  left: `FontId(3)`,
  right: `FontId(3)`', gpui/src/platform/mac/fonts.rs:326:9

Somehow we're intermittently selecting the wrong font due to some race condition.

Standard editor commands and keybindings

These are keybindings I use pretty frequently in my day-to-day editing experience and are necessary for me to feel productive with my editor. I will start from the obvious ones so that we can talk about whether there's less obvious commands that we wanna leave out (or add) for the basic working editor.

  • Backspace (ctrl-h)
  • Delete (delete, ctrl-d)
  • Delete line under cursor (ctrl-shift-k)
  • Delete to beginning of line (cmd-backspace)
  • Delete to beginning of word (alt-h)
  • Delete to end of line (cmd-delete)
  • Delete to end of word (alt-d)
  • Duplicate line (cmd-shift-d)
  • Move line down (ctrl-cmd-down)
  • Move line up (ctrl-cmd-up)
  • Move to beginning (cmd-up)
  • Move to end (cmd-down)
  • Move to next word boundary (alt-right)
  • Move to previous word boundary (alt-left)
  • Move to the beginning of line (cmd-left, ctrl-a)
  • Move to the end of line (cmd-right, ctrl-e)
  • Select all (cmd-a)
  • Select line (cmd-l)
  • Select to beginning (cmd-shift-up)
  • Select to end (cmd-shift-down)
  • Select to next word boundary (alt-shift-right)
  • Select to previous word boundary (alt-shift-left)
  • Select to the beginning of line (cmd-shift-left)
  • Select to the end of line (cmd-shift-right)
  • Split selections into lines (cmd-shift-l)
  • Add selection above (cmd-alt-up)
  • Add selection below (cmd-alt-down)
  • Cancel (esc), clear all but first selection
  • Tab (tab)

Accessing large amounts of the buffer's text is slow

@maxbrunsfeld and I noticed this while testing cursor movement in a file with very long lines. The way that we profiled the following stack trace was by opening a file with one very long line and then duplicating that line ~40 times and, even without mutating the buffer or re-laying out the lines, the whole experience was very slow.

861.00 ms  100.0%	55.00 ms	 	zed::editor::buffer_view::BufferView::layout_lines::hfb5ec0199c85e6bb
513.00 ms   59.5%	0 s	 	 _$LT$core..iter..adapters..chain..Chain$LT$A$C$B$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h33c171720b849fcc
513.00 ms   59.5%	23.00 ms	 	  _$LT$zed..editor..display_map..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h8402b6233263ab7b
434.00 ms   50.4%	160.00 ms	 	   _$LT$zed..editor..display_map..fold_map..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h0195de469964cfc5
218.00 ms   25.3%	0 s	 	    core::option::Option$LT$T$GT$::and_then::h0f8e35f8372cac38
218.00 ms   25.3%	0 s	 	     _$LT$zed..editor..display_map..fold_map..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::_$u7b$$u7b$closure$u7d$$u7d$::h0405fb9249821c02
218.00 ms   25.3%	64.00 ms	 	      _$LT$core..iter..adapters..take..Take$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::ha51556fa436a3cd9
154.00 ms   17.8%	94.00 ms	 	       _$LT$zed..editor..buffer..CharIter$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::hcd81ce3e776158d7
60.00 ms    6.9%	0 s	 	        _$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h3499951562e3d670
60.00 ms    6.9%	37.00 ms	 	         core::str::validations::next_code_point::ha1da4399334a946d
23.00 ms    2.6%	23.00 ms	 	          _$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::hbb1157dfa69a6c95
33.00 ms    3.8%	33.00 ms	 	    core::option::Option$LT$T$GT$::as_mut::hd984cf1c3b4ca246
23.00 ms    2.6%	23.00 ms	 	    zed::sum_tree::cursor::Cursor$LT$T$C$S$C$U$GT$::item::h7ab8ef40e6b91b7f
56.00 ms    6.5%	26.00 ms	 	   core::option::Option$LT$T$GT$::map::h61a20d113224e68d
30.00 ms    3.4%	30.00 ms	 	    _$LT$zed..editor..display_map..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::_$u7b$$u7b$closure$u7d$$u7d$::hf95f8914fa4e8185
202.00 ms   23.4%	125.00 ms	 	 alloc::string::String::push::h28e37d8d9d7e7fe5
43.00 ms    4.9%	0 s	 	 gpui::text_layout::TextLayoutCache::layout_str::h9e8a486255d39ab4
22.00 ms    2.5%	0 s	 	 zed::editor::display_map::DisplayMap::max_point::h4c2f03c9aee69dab
22.00 ms    2.5%	0 s	 	  zed::editor::display_map::DisplayPoint::expand_tabs::h09841e7e3f55ccef
22.00 ms    2.5%	0 s	 	   zed::editor::display_map::expand_tabs::h4076fd7b42420e65
22.00 ms    2.5%	2.00 ms	 	    _$LT$core..iter..adapters..take..Take$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h9e91e9365aad93c9
20.00 ms    2.3%	13.00 ms	 	     _$LT$zed..editor..display_map..fold_map..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h0195de469964cfc5
6.00 ms    0.6%	0 s	 	      core::option::Option$LT$T$GT$::and_then::h0f8e35f8372cac38
6.00 ms    0.6%	0 s	 	       _$LT$zed..editor..display_map..fold_map..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::_$u7b$$u7b$closure$u7d$$u7d$::h0405fb9249821c02
1.00 ms    0.1%	1.00 ms	 	      zed::sum_tree::cursor::Cursor$LT$T$C$S$C$U$GT$::item::h7ab8ef40e6b91b7f
21.00 ms    2.4%	21.00 ms	 	 _$LT$core..iter..adapters..chain..Chain$LT$A$C$B$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h33c171720b849fcc
5.00 ms    0.5%	0 s	 	 _$LT$core..iter..adapters..chain..Chain$LT$A$C$B$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h33c171720b849fcc

A lot of the time seems to be going in accessing the buffer's text via the char iterator. We think this may be suboptimal because it does not take advantage of a whole str chunk whenever there is one to avoid decoding and re-encoding UTF-8 characters.

That said, even with a more str-oriented representation, it seems like our tree could contain a lot of little strings in the pathological case, e.g. a user typing a lot of text character-by-character without ever closing the buffer. For that, we wonder whether a case could be made for having a caching layer on top of the CRDT that stores the current text efficiently at the cost of more memory. In there, we could aggregate smaller strings into larger ones for the same reason described in the above paragraph.

One thought for the caching mechanism would be to aggregate larger and larger strings up the SumTree, or maybe only stopping at the leaf nodes or at a certain depth to avoid too many copies of the same text.

/cc: @nathansobo

Flaky `workspace::tests::test_open_paths` test

---- workspace::tests::test_open_paths stdout ----
thread 'workspace::tests::test_open_paths' panicked at 'assertion failed: `(left == right)`
  left: `""`,
 right: `"b.txt"`', zed/src/workspace.rs:1138:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Batch `SumTree` insertions when mutating `Buffer`

For instance, when we mark many fragments as deleted, we should buffer those up in a Vec and then use SumTree::extend. We should do something similar for ropes as well and I think RopeBuilder could help us with that by, again, not pushing one fragment worth of text at a time but rather batch things up as much as possible.

Basic working editor

Goal: A binary for friends and investors, with a small set of fully-functioning features.

  • Render selections
  • Artifacts at the edges of rectangles #4
  • Intermittent artifacts when rendering multiple selections #5
  • Clip selections when they extend outside the viewport
  • Run a GPU profile and perform any easy optimizations
  • Save files
  • Monochrome icons, rasterize on CPU and sprite them
  • Correct vertical font alignment
  • Run a basic CPU profile on render and perform any easy optimizations
  • Correct alignment of icons with text
  • Show when buffer is modified
  • Undo/redo
  • Application menus
  • Copy/paste #18
  • Match appearance of Atom One Light for modified tabs
  • Keep main thread responsive while scanning/rescanning worktree
  • Detect file system changes #15
  • Close tab button
  • Traverse symlink entries #29
  • Open files and folders #31
  • Store only one buffer per inode, but show each editor with the correct path (#34)
  • Bundle the app with an icon #30
  • New buffers / scratchpad
  • Saving a new buffer
  • Avoid spurious keystrokes on keyup events (#46)
  • Cleanly handle window close without leaking memory or crashing
  • Standard/expected keybindings #25

Research auto-indent

We tried adding support for auto-indent as part of #73 by using the syntax tree but we were not feeling good about the direction and it was taking longer than we were anticipating, so we decided to punt on it. However, this is something we wanna support long-term, so opening an issue to track this feature.

Random notes:

  • How CodeMirror 6 does this (https://marijnhaverbeke.nl/blog/indent-from-tree.html)
  • How CodeMirror 6 specifies indents for Rust (https://github.com/codemirror/lang-rust/blob/main/src/rust.ts)
  • Maybe don't even try to use the syntax tree and fall back to regular expressions just for indents?
  • Parse trees are obtained asynchronously, but text gets inserted synchronously. One possible solution we came up with was to parse the tree synchronously when a newline is inserted so that we can indent the new line correctly, but otherwise asynchronously indent or outdent as the user types.

Crash opening files containing a space in their filename

Screen.Shot.2021-07-02.at.2.53.54.PM.mov

I reproduced this locally and this was the stack trace of the crash:

09:18:45 [INFO] open paths ["/private/tmp/Some%20file.txt"]
09:18:45 [INFO] open new workspace
thread 'thread 'thread 'thread 'thread 'thread 'thread 'scoped_pool app 7thread 'thread 'scoped_pool app 8scoped_pool app 0' panicked at '' panicked at 'called `Option::unwrap()` on a `None` valuescoped_pool app 6scoped_pool app 13' panicked at 'thread 'scoped_pool app 3' panicked at 'called `Option::unwrap()` on a `None` valuecalled `Option::unwrap()` on a `None` value', scoped_pool app 9thread 'thread '' panicked at '', called `Option::unwrap()` on a `None` valuescoped_pool app 15', ' panicked at 'zed/src/worktree.rscalled `Option::unwrap()` on a `None` valuethread '' panicked at 'scoped_pool app 14' panicked at '' panicked at 'called `Option::unwrap()` on a `None` valuecalled `Option::unwrap()` on a `None` value', scoped_pool app 4thread 'thread 'scoped_pool app 11zed/src/worktree.rsscoped_pool app 5called `Option::unwrap()` on a `None` valuescoped_pool app 2' panicked at '' panicked at '', ' panicked at '', called `Option::unwrap()` on a `None` value', ', :zed/src/worktree.rscalled `Option::unwrap()` on a', called `Option::unwrap()` on a `None` value:', zed/src/worktree.rszed/src/worktree.rsthread 'zed/src/worktree.rszed/src/worktree.rs998:::scoped_pool app 1 `None` valuezed/src/worktree.rszed/src/worktree.rsscoped_pool app 12:' panicked at '998called `Option::unwrap()` on a `None` value:', 33zed/src/worktree.rs
:note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
998scoped_pool app 1033' panicked at '
called `Option::unwrap()` on a `None` valuecalled `Option::unwrap()` on a `None` value::zed/src/worktree.rs', ', ::998998zed/src/worktree.rs' panicked at '998called `Option::unwrap()` on a `None` value998::99833:zed/src/worktree.rs', 
' panicked at ':998:::zed/src/worktree.rs::99833:998
:33:99833', :998998zed/src/worktree.rs33:called `Option::unwrap()` on a `None` value
:33333333::
33





99833
33
', :zed/src/worktree.rs33:
998:33
thread 'background-executor-15' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', /Users/as-cii/dev/zed/scoped_pool/src/lib.rs:90:14
thread 'main' panicked at 'task has failed', /Users/as-cii/.cargo/git/checkouts/async-task-939ec7beeb877e57/341b57d/src/task.rs:368:45
libc++abi: terminating with uncaught foreign exception
Abort trap: 6

Bug report and video courtesy of @jasonrudolph

Chat

Design

  • Chat panel
  • Signed out state

Engineering

  • #112
  • Roughly match existing UI to mockups so that the chat panel blends in
  • Chat panel
    • Fetch more chat messages when scrolling the message list
      • Remove messages from the list to maintain performance when scrolling far back and forward
    • Limit length of channel messages
    • Finish cursor styling
      • Always get a handle but only the last-acquired handle can set back the cursor to an arrow state
      • Maintain hover state in MouseEventHandler using the clicked state on the OS event rather than the handler's state
    • Implement drop down for channel switcher
      • Add an API to Scene to handle zero-sized elements that escape the current layer
    • Style the editor
      • Rounded corners (not a feature of the editor)
      • Placeholder text (a feature of the editor)
    • Don't render non-visible glyphs in Text
      • Change AnyElement::paint to take an optional visible bounds rect
    • Address timezone bugs when displaying chat message timestamps
    • Toggle panels on mouse down instead of on click
  • Bundle Inconsolata and use it as the UI font
  • #134
  • Allow passing how many lines an auto-height editor can expand to at most
  • Use keymap context to determine whether hitting enter should insert a newline or confirm
  • Add signed out content to the chat panel

Minimum viable theme system

  • Create stubs for both Light and dark themes
  • Add a command that opens a fuzzy-matching modal dialog to select a theme
    • When selecting a theme in debug mode, reload the theme
  • Add some minimal color-manipulation functions

Collaboration domain model

A few notes about how we could structure the associations among the various entities introduced by collaboration:

  • An organization or a person can own multiple channels
  • A repository can be associated with multiple channels
  • A channel can be associated with multiple repositories
  • A Zed repository is not a GitHub repository, it's a brand new entity that can be associated with a git host (e.g., a GitHub repo)
    • This allows opening a repository locally with zed and seeing a list of channels based on the repository's remote URLs
  • Maybe: multiple zed repositories can point to the same GitHub repository
  • To interact with a channel you must be added to it as a member by channel admin
    • This means that initially each channel will be associated with a list of users who have permission to interact with it
    • Later on we could have teams and a more complex permission system
  • People and organizations all belong to the same namespace, and accessing their channels is just a matter of authorization using the mechanisms above

Saving an untitled buffer fails with `root entry does not exist`

  • Start zed without a path (just run zed without arguments). This bug reproduces even if you do start zed with a path, but not doing so feels even more minimal
  • Hit Cmd+N to create an untitled buffer
  • Hit Cmd+S to save that buffer and choose any destination folder
  • Hit Save on the macOS finder dialog
  • The file won't be saved and an error will be logged 💥

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.