Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Find a file
Federico Dionisi 2651037472
Read LSP message headers at once (#7449)
The current LSP headers reader implementation assumes a specific order
(i.e., `Content-Length` first, and then `Content-Type`). Unfortunately,
this assumption is not always valid, as no specification enforces the
rule. @caius and I encountered this issue while implementing the
Terraform LSP, where `Content-Type` comes first, breaking the
implementation in #6929.

This PR introduces a `read_headers` function, which asynchronously reads
the incoming pipe until the headers' delimiter (i.e., '\r\n\r\n'),
adding it to the message buffer, and returning an error when delimiter's
not found.

I added a few tests but only considered scenarios where headers are
delivered at once (which should be the case?). I'm unsure if this
suffices or if I should consider more scenarios; I would love to hear
others' opinions.


Release Notes:

- N/A

---------

Co-authored-by: Caius <caius@caius.name>
2024-02-09 09:40:50 -08:00
.cargo Remove 2 suffix from gpui_macros, fix compile errors in tests 2024-01-03 13:12:21 -08:00
.config
.github Bump action runners versions 2024-02-09 15:25:16 +02:00
.zed WIP: Add a setting to visually redact enviroment variables (#7124) 2024-01-31 11:42:09 -08:00
assets Fix mis-description in default settings (#7564) 2024-02-08 10:19:18 -05:00
crates Read LSP message headers at once (#7449) 2024-02-09 09:40:50 -08:00
docs docs: Update OPAM installation instructions (#7510) 2024-02-07 14:12:53 -05:00
plugins
script Revert "Debug build (#7176)" (#7577) 2024-02-08 20:04:55 -07:00
.dockerignore Add serialized versions of themes (#6885) 2024-01-27 13:35:43 -05:00
.gitattributes Prevent GitHub from displaying comments within JSON files as errors (#7043) 2024-01-29 23:11:25 -05:00
.gitignore Add serialized versions of themes (#6885) 2024-01-27 13:35:43 -05:00
.gitmodules
.mailmap Update .mailmap (#7578) 2024-02-08 12:08:37 -05:00
Cargo.lock Linux: Experiment with CosmicText based Text System (#7539) 2024-02-08 22:49:03 -08:00
Cargo.toml Merge branch 'main' into kvark-linux 2024-02-07 12:30:36 -08:00
CODE_OF_CONDUCT.md Add CODE_OF_CONDUCT.md (#4239) 2024-01-23 22:31:39 -05:00
CONTRIBUTING.md Style crate names in CONTRIBUTING.md (#6939) 2024-01-28 11:07:37 -05:00
debug.plist
docker-compose.sql
docker-compose.yml
Dockerfile chore: Bump Rust version to 1.76 (#7592) 2024-02-09 10:45:39 +02:00
LICENSE-AGPL chore: Add crate licenses. (#4158) 2024-01-23 16:56:22 +01:00
LICENSE-APACHE chore: Add crate licenses. (#4158) 2024-01-23 16:56:22 +01:00
LICENSE-GPL Licenses: change license fields in Cargo.toml to AGPL-3.0-or-later. (#5535) 2024-01-27 13:51:16 +01:00
Procfile Update procfile and local development docs, zed.dev is no longer needed 2024-01-17 13:28:58 -08:00
README.md Note installation step via Homebrew (#7053) 2024-01-30 21:47:30 -05:00
rust-toolchain.toml chore: Bump Rust version to 1.76 (#7592) 2024-02-09 10:45:39 +02:00
typos.toml Fix typos configuration (#6877) 2024-01-27 11:03:25 -05:00

Zed

CI

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

Installation

You can download Zed today for macOS (v10.15+).

Support for additional platforms is on our roadmap:

For macOS users, you can also install Zed from Homebrew:

brew install zed

Developing Zed

Contributing

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

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.