2021-02-20 17:02:34 +00:00
|
|
|
[workspace]
|
2024-07-26 01:30:48 +00:00
|
|
|
resolver = "2"
|
2022-10-25 17:31:58 +00:00
|
|
|
members = [
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/activity_indicator",
|
2024-03-31 21:57:57 +00:00
|
|
|
"crates/anthropic",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/assets",
|
|
|
|
"crates/assistant",
|
2024-05-24 17:03:41 +00:00
|
|
|
"crates/assistant_slash_command",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/audio",
|
|
|
|
"crates/auto_update",
|
|
|
|
"crates/breadcrumbs",
|
|
|
|
"crates/call",
|
|
|
|
"crates/channel",
|
|
|
|
"crates/cli",
|
|
|
|
"crates/client",
|
|
|
|
"crates/clock",
|
|
|
|
"crates/collab",
|
|
|
|
"crates/collab_ui",
|
|
|
|
"crates/collections",
|
|
|
|
"crates/command_palette",
|
2024-02-25 18:21:20 +00:00
|
|
|
"crates/command_palette_hooks",
|
context_servers: Add initial implementation (#16103)
This commit proposes the addition of "context serveres" and the
underlying protocol (model context protocol). Context servers allow
simple definition of slash commands in another language and running
local on the user machines. This aims to quickly prototype new commands,
and provide a way to add personal (or company wide) customizations to
the assistant panel, without having to maintain an extension. We can
use this to reuse our existing codebase, with authenticators, etc and
easily have it provide context into the assistant panel.
As such it occupies a different design space as extensions, which I
think are
more aimed towards long-term, well maintained pieces of code that can be
easily distributed.
It's implemented as a central crate for easy reusability across the
codebase
and to easily hook into the assistant panel at all points.
Design wise there are a few pieces:
1. client.rs: A simple JSON-RPC client talking over stdio to a spawned
server. This is
very close to how LSP work and likely there could be a combined client
down the line.
2. types.rs: Serialization and deserialization client for the underlying
model context protocol.
3. protocol.rs: Handling the session between client and server.
4. manager.rs: Manages settings and adding and deleting servers from a
central pool.
A server can be defined in the settings.json as:
```
"context_servers": [
{"id": "test", "executable": "python", "args": ["-m", "context_server"]
]
```
## Quick Example
A quick example of how a theoretical backend site can look like. With
roughly 100 lines
of code (nicely generated by Claude) and a bit of decorator magic (200
lines in total), one
can come up with a framework that makes it as easy as:
```python
@context_server.slash_command(name="rot13", description="Perform a rot13 transformation")
@context_server.argument(name="input", type=str, help="String to rot13")
async def rot13(input: str) -> str:
return ''.join(chr((ord(c) - 97 + 13) % 26 + 97) if c.isalpha() else c for c in echo.lower())
```
to define a new slash_command.
## Todo:
- Allow context servers to be defined in workspace settings.
- Allow passing env variables to context_servers
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-15 14:49:30 +00:00
|
|
|
"crates/context_servers",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/copilot",
|
|
|
|
"crates/db",
|
2024-06-27 23:14:13 +00:00
|
|
|
"crates/dev_server_projects",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/diagnostics",
|
2024-08-26 15:43:13 +00:00
|
|
|
"crates/docs_preprocessor",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/editor",
|
|
|
|
"crates/extension",
|
2024-03-02 00:00:55 +00:00
|
|
|
"crates/extension_api",
|
2024-03-19 14:50:21 +00:00
|
|
|
"crates/extension_cli",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/extensions_ui",
|
|
|
|
"crates/feature_flags",
|
|
|
|
"crates/feedback",
|
|
|
|
"crates/file_finder",
|
2024-03-29 20:55:01 +00:00
|
|
|
"crates/file_icons",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/fs",
|
|
|
|
"crates/fsevent",
|
|
|
|
"crates/fuzzy",
|
|
|
|
"crates/git",
|
2024-05-07 01:24:48 +00:00
|
|
|
"crates/git_hosting_providers",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/go_to_line",
|
2024-03-19 18:22:26 +00:00
|
|
|
"crates/google_ai",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/gpui",
|
|
|
|
"crates/gpui_macros",
|
2024-04-11 21:36:35 +00:00
|
|
|
"crates/headless",
|
2024-06-04 20:14:26 +00:00
|
|
|
"crates/html_to_markdown",
|
2024-07-23 22:01:05 +00:00
|
|
|
"crates/http_client",
|
2024-03-19 17:13:10 +00:00
|
|
|
"crates/image_viewer",
|
2024-07-02 17:14:56 +00:00
|
|
|
"crates/indexed_docs",
|
2024-05-03 19:50:42 +00:00
|
|
|
"crates/inline_completion_button",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/install_cli",
|
|
|
|
"crates/journal",
|
|
|
|
"crates/language",
|
Extract completion provider crate (#14823)
We will soon need `semantic_index` to be able to use
`CompletionProvider`. This is currently impossible due to a cyclic crate
dependency, because `CompletionProvider` lives in the `assistant` crate,
which depends on `semantic_index`.
This PR breaks the dependency cycle by extracting two crates out of
`assistant`: `language_model` and `completion`.
Only one piece of logic changed: [this
code](https://github.com/zed-industries/zed/commit/922fcaf5a6076e56890373035b1065b13512546d#diff-3857b3707687a4d585f1200eec4c34a7a079eae8d303b4ce5b4fce46234ace9fR61-R69).
* As of https://github.com/zed-industries/zed/pull/13276, whenever we
ask a given completion provider for its available models, OpenAI
providers would go and ask the global assistant settings whether the
user had configured an `available_models` setting, and if so, return
that.
* This PR changes it so that instead of eagerly asking the assistant
settings for this info (the new crate must not depend on `assistant`, or
else the dependency cycle would be back), OpenAI completion providers
now store the user-configured settings as part of their struct, and
whenever the settings change, we update the provider.
In theory, this change should not change user-visible behavior...but
since it's the only change in this large PR that's more than just moving
code around, I'm mentioning it here in case there's an unexpected
regression in practice! (cc @amtoaer in case you'd like to try out this
branch and verify that the feature is still working the way you expect.)
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-19 17:35:34 +00:00
|
|
|
"crates/language_model",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/language_selector",
|
|
|
|
"crates/language_tools",
|
2024-02-23 14:56:08 +00:00
|
|
|
"crates/languages",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/live_kit_client",
|
|
|
|
"crates/live_kit_server",
|
|
|
|
"crates/lsp",
|
2024-05-09 09:03:33 +00:00
|
|
|
"crates/markdown",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/markdown_preview",
|
|
|
|
"crates/media",
|
|
|
|
"crates/menu",
|
|
|
|
"crates/multi_buffer",
|
|
|
|
"crates/node_runtime",
|
|
|
|
"crates/notifications",
|
2024-06-12 00:35:27 +00:00
|
|
|
"crates/ollama",
|
2024-03-19 18:22:26 +00:00
|
|
|
"crates/open_ai",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/outline",
|
2024-06-12 20:22:52 +00:00
|
|
|
"crates/outline_panel",
|
2024-06-17 23:27:42 +00:00
|
|
|
"crates/paths",
|
2024-08-18 21:22:19 +00:00
|
|
|
"crates/performance",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/picker",
|
|
|
|
"crates/prettier",
|
|
|
|
"crates/project",
|
|
|
|
"crates/project_panel",
|
|
|
|
"crates/project_symbols",
|
2024-06-10 18:49:53 +00:00
|
|
|
"crates/proto",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/quick_action_bar",
|
|
|
|
"crates/recent_projects",
|
|
|
|
"crates/refineable",
|
|
|
|
"crates/refineable/derive_refineable",
|
|
|
|
"crates/release_channel",
|
2024-07-19 17:27:26 +00:00
|
|
|
"crates/remote",
|
|
|
|
"crates/remote_server",
|
Bring Jupyter to Zed Editing (#12062)
Run any Jupyter kernel in Zed on any buffer (editor):
<img width="1074" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/eac8ed69-d02b-4d46-b379-6186d8f59470">
## TODO
### Lifecycle
* [x] Launch kernels on demand
* [x] Wait for kernel to be started
* [x] Request Kernel info on start
* [x] Show in progress indicator
* [ ] Allow picking kernel (it defaults to first matching language name)
* [ ] Menu for interrupting and shutting down the kernel
* [ ] Drop running kernels once editor is dropped
### Media Outputs
* [x] Render text and tracebacks with ANSI color handling
* [x] Render markdown as text
* [x] Render PNG and JPEG images using an explicit height based on
line-height
* ~~Render SVG~~ -- not happening for this PR due to lack of text in SVG
support
* [ ] Process `update_display_data` message and related `display_id`
* [x] Process `page` data from payloads as outputs
* [ ] Render markdown as, well, rendered markdown -- Note: unsure if we
can get line heights here
### Document
* [x] Select code and run
* [x] Run current line
* [x] Clear previous overlapping runs
* [ ] Support running markdown code blocks
* [ ] Action to export session as notebook or output files
* [ ] Action to clear all outputs
* [ ] Delete outputs when lines are deleted
## Other missing features
The following is a list of missing functionality or expectations that
are out of scope for this PR.
### Python Environments
Detecting python environments should probably be done in a separate PR
in tandem with how they're used with LSP. Users likely want to pick an
environment for their project, whether a virtualenv, conda env, pyenv,
poetry backed virtualenv, or the system. Related issues:
* https://github.com/zed-industries/zed/issues/7646
* https://github.com/zed-industries/zed/issues/7808
* https://github.com/zed-industries/zed/issues/7296
### LSP Integration
* Submit `complete_request` messages for completions to interleave
interactive variables with LSP
* LSP for IPython semantics (`%%timeit`, `!ls`, `get_ipython`, etc.)
## Future release notes
- Run code in any editor, whether it's a script or a markdown document
Release Notes:
- N/A
2024-06-17 17:02:31 +00:00
|
|
|
"crates/repl",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/rich_text",
|
|
|
|
"crates/rope",
|
|
|
|
"crates/rpc",
|
|
|
|
"crates/search",
|
2024-04-12 17:40:59 +00:00
|
|
|
"crates/semantic_index",
|
2024-03-29 16:11:57 +00:00
|
|
|
"crates/semantic_version",
|
2024-07-23 17:44:02 +00:00
|
|
|
"crates/session",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/settings",
|
2024-07-23 16:50:11 +00:00
|
|
|
"crates/settings_ui",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/snippet",
|
2024-07-09 12:02:36 +00:00
|
|
|
"crates/snippet_provider",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/sqlez",
|
|
|
|
"crates/sqlez_macros",
|
|
|
|
"crates/story",
|
|
|
|
"crates/storybook",
|
|
|
|
"crates/sum_tree",
|
2024-05-03 19:50:42 +00:00
|
|
|
"crates/supermaven",
|
|
|
|
"crates/supermaven_api",
|
2024-06-27 23:14:13 +00:00
|
|
|
"crates/tab_switcher",
|
|
|
|
"crates/task",
|
|
|
|
"crates/tasks_ui",
|
|
|
|
"crates/telemetry_events",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/terminal",
|
|
|
|
"crates/terminal_view",
|
|
|
|
"crates/text",
|
|
|
|
"crates/theme",
|
|
|
|
"crates/theme_importer",
|
|
|
|
"crates/theme_selector",
|
2024-02-24 02:18:06 +00:00
|
|
|
"crates/time_format",
|
2024-06-27 23:14:13 +00:00
|
|
|
"crates/title_bar",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/ui",
|
2024-07-08 21:05:30 +00:00
|
|
|
"crates/ui_input",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/util",
|
|
|
|
"crates/vcs_menu",
|
|
|
|
"crates/vim",
|
|
|
|
"crates/welcome",
|
|
|
|
"crates/workspace",
|
2024-03-11 18:35:27 +00:00
|
|
|
"crates/worktree",
|
2024-02-16 02:54:43 +00:00
|
|
|
"crates/zed",
|
|
|
|
"crates/zed_actions",
|
2024-03-08 22:18:06 +00:00
|
|
|
|
2024-07-26 01:52:53 +00:00
|
|
|
#
|
|
|
|
# Extensions
|
|
|
|
#
|
|
|
|
|
2024-03-26 22:50:08 +00:00
|
|
|
"extensions/astro",
|
2024-04-02 17:47:03 +00:00
|
|
|
"extensions/clojure",
|
2024-03-29 20:38:27 +00:00
|
|
|
"extensions/csharp",
|
2024-04-05 21:04:07 +00:00
|
|
|
"extensions/dart",
|
2024-04-24 00:44:11 +00:00
|
|
|
"extensions/deno",
|
Extract Elixir extension (#10948)
This PR extracts Elixir support into an extension and removes the
built-in Elixir support from Zed.
As part of this, [Lexical](https://github.com/lexical-lsp/lexical) has
been added as an available language server for Elixir.
Since the Elixir extension provides three different language servers,
you'll need to use the `language_servers` setting to select the one you
want to use:
#### Elixir LS
```json
{
"languages": {
"Elixir": {
"language_servers": [ "elixir-ls", "!next-ls", "!lexical", "..."]
}
}
}
```
#### Next LS
```json
{
"languages": {
"Elixir": {
"language_servers": [ "next-ls", "!elixir-ls", "!lexical", "..."]
}
}
}
```
#### Lexical
```json
{
"languages": {
"Elixir": {
"language_servers": [ "lexical", "!elixir-ls", "!next-ls", "..."]
}
}
}
```
These can either go in your user settings or your project settings.
Release Notes:
- Removed built-in support for Elixir, in favor of making it available
as an extension.
2024-04-25 17:59:14 +00:00
|
|
|
"extensions/elixir",
|
2024-04-11 17:23:49 +00:00
|
|
|
"extensions/elm",
|
2024-04-03 17:54:53 +00:00
|
|
|
"extensions/emmet",
|
2024-03-29 22:03:38 +00:00
|
|
|
"extensions/erlang",
|
2024-03-02 00:00:55 +00:00
|
|
|
"extensions/gleam",
|
2024-04-18 15:23:11 +00:00
|
|
|
"extensions/glsl",
|
2024-03-26 15:41:41 +00:00
|
|
|
"extensions/haskell",
|
2024-04-03 16:42:36 +00:00
|
|
|
"extensions/html",
|
2024-04-11 18:32:10 +00:00
|
|
|
"extensions/lua",
|
2024-04-11 22:20:19 +00:00
|
|
|
"extensions/ocaml",
|
2024-03-29 18:51:54 +00:00
|
|
|
"extensions/php",
|
2024-08-18 22:34:55 +00:00
|
|
|
"extensions/perplexity",
|
2024-03-26 16:50:44 +00:00
|
|
|
"extensions/prisma",
|
2024-03-26 17:55:46 +00:00
|
|
|
"extensions/purescript",
|
2024-07-20 13:18:02 +00:00
|
|
|
"extensions/ruff",
|
2024-05-10 15:53:11 +00:00
|
|
|
"extensions/ruby",
|
2024-08-15 16:26:13 +00:00
|
|
|
"extensions/slash-commands-example",
|
2024-06-19 12:03:04 +00:00
|
|
|
"extensions/snippets",
|
2024-03-23 00:29:06 +00:00
|
|
|
"extensions/svelte",
|
2024-04-12 15:49:49 +00:00
|
|
|
"extensions/terraform",
|
2024-07-03 15:10:51 +00:00
|
|
|
"extensions/test-extension",
|
2024-03-28 22:40:12 +00:00
|
|
|
"extensions/toml",
|
2024-03-26 16:50:44 +00:00
|
|
|
"extensions/uiua",
|
2024-04-12 18:39:27 +00:00
|
|
|
"extensions/vue",
|
2024-03-28 00:56:30 +00:00
|
|
|
"extensions/zig",
|
2024-03-08 22:18:06 +00:00
|
|
|
|
2024-07-26 01:52:53 +00:00
|
|
|
#
|
|
|
|
# Tooling
|
|
|
|
#
|
|
|
|
|
2024-08-26 15:43:13 +00:00
|
|
|
"tooling/xtask"
|
2022-10-25 17:31:58 +00:00
|
|
|
]
|
2021-10-04 19:22:21 +00:00
|
|
|
default-members = ["crates/zed"]
|
2021-04-02 17:02:09 +00:00
|
|
|
|
2022-10-11 00:10:42 +00:00
|
|
|
[workspace.dependencies]
|
2024-07-26 01:52:53 +00:00
|
|
|
#
|
|
|
|
# Workspace member crates
|
|
|
|
#
|
|
|
|
|
2024-02-06 19:41:36 +00:00
|
|
|
activity_indicator = { path = "crates/activity_indicator" }
|
|
|
|
ai = { path = "crates/ai" }
|
2024-03-31 21:57:57 +00:00
|
|
|
anthropic = { path = "crates/anthropic" }
|
2024-02-06 19:41:36 +00:00
|
|
|
assets = { path = "crates/assets" }
|
|
|
|
assistant = { path = "crates/assistant" }
|
2024-05-24 17:03:41 +00:00
|
|
|
assistant_slash_command = { path = "crates/assistant_slash_command" }
|
2024-02-06 19:41:36 +00:00
|
|
|
audio = { path = "crates/audio" }
|
|
|
|
auto_update = { path = "crates/auto_update" }
|
|
|
|
breadcrumbs = { path = "crates/breadcrumbs" }
|
|
|
|
call = { path = "crates/call" }
|
|
|
|
channel = { path = "crates/channel" }
|
|
|
|
cli = { path = "crates/cli" }
|
|
|
|
client = { path = "crates/client" }
|
|
|
|
clock = { path = "crates/clock" }
|
|
|
|
collab = { path = "crates/collab" }
|
|
|
|
collab_ui = { path = "crates/collab_ui" }
|
|
|
|
collections = { path = "crates/collections" }
|
|
|
|
command_palette = { path = "crates/command_palette" }
|
2024-02-25 18:21:20 +00:00
|
|
|
command_palette_hooks = { path = "crates/command_palette_hooks" }
|
context_servers: Add initial implementation (#16103)
This commit proposes the addition of "context serveres" and the
underlying protocol (model context protocol). Context servers allow
simple definition of slash commands in another language and running
local on the user machines. This aims to quickly prototype new commands,
and provide a way to add personal (or company wide) customizations to
the assistant panel, without having to maintain an extension. We can
use this to reuse our existing codebase, with authenticators, etc and
easily have it provide context into the assistant panel.
As such it occupies a different design space as extensions, which I
think are
more aimed towards long-term, well maintained pieces of code that can be
easily distributed.
It's implemented as a central crate for easy reusability across the
codebase
and to easily hook into the assistant panel at all points.
Design wise there are a few pieces:
1. client.rs: A simple JSON-RPC client talking over stdio to a spawned
server. This is
very close to how LSP work and likely there could be a combined client
down the line.
2. types.rs: Serialization and deserialization client for the underlying
model context protocol.
3. protocol.rs: Handling the session between client and server.
4. manager.rs: Manages settings and adding and deleting servers from a
central pool.
A server can be defined in the settings.json as:
```
"context_servers": [
{"id": "test", "executable": "python", "args": ["-m", "context_server"]
]
```
## Quick Example
A quick example of how a theoretical backend site can look like. With
roughly 100 lines
of code (nicely generated by Claude) and a bit of decorator magic (200
lines in total), one
can come up with a framework that makes it as easy as:
```python
@context_server.slash_command(name="rot13", description="Perform a rot13 transformation")
@context_server.argument(name="input", type=str, help="String to rot13")
async def rot13(input: str) -> str:
return ''.join(chr((ord(c) - 97 + 13) % 26 + 97) if c.isalpha() else c for c in echo.lower())
```
to define a new slash_command.
## Todo:
- Allow context servers to be defined in workspace settings.
- Allow passing env variables to context_servers
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-15 14:49:30 +00:00
|
|
|
context_servers = { path = "crates/context_servers" }
|
2024-02-06 19:41:36 +00:00
|
|
|
copilot = { path = "crates/copilot" }
|
|
|
|
db = { path = "crates/db" }
|
2024-06-27 23:14:13 +00:00
|
|
|
dev_server_projects = { path = "crates/dev_server_projects" }
|
2024-02-06 19:41:36 +00:00
|
|
|
diagnostics = { path = "crates/diagnostics" }
|
|
|
|
editor = { path = "crates/editor" }
|
2024-02-07 20:14:50 +00:00
|
|
|
extension = { path = "crates/extension" }
|
2024-02-13 19:09:02 +00:00
|
|
|
extensions_ui = { path = "crates/extensions_ui" }
|
2024-02-06 19:41:36 +00:00
|
|
|
feature_flags = { path = "crates/feature_flags" }
|
|
|
|
feedback = { path = "crates/feedback" }
|
|
|
|
file_finder = { path = "crates/file_finder" }
|
2024-03-29 20:55:01 +00:00
|
|
|
file_icons = { path = "crates/file_icons" }
|
2024-02-06 19:41:36 +00:00
|
|
|
fs = { path = "crates/fs" }
|
|
|
|
fsevent = { path = "crates/fsevent" }
|
|
|
|
fuzzy = { path = "crates/fuzzy" }
|
|
|
|
git = { path = "crates/git" }
|
2024-05-07 01:24:48 +00:00
|
|
|
git_hosting_providers = { path = "crates/git_hosting_providers" }
|
2024-02-06 19:41:36 +00:00
|
|
|
go_to_line = { path = "crates/go_to_line" }
|
2024-03-19 18:22:26 +00:00
|
|
|
google_ai = { path = "crates/google_ai" }
|
2024-02-06 19:41:36 +00:00
|
|
|
gpui = { path = "crates/gpui" }
|
|
|
|
gpui_macros = { path = "crates/gpui_macros" }
|
2024-08-07 01:30:48 +00:00
|
|
|
handlebars = "4.3"
|
2024-04-11 21:36:35 +00:00
|
|
|
headless = { path = "crates/headless" }
|
2024-06-04 20:14:26 +00:00
|
|
|
html_to_markdown = { path = "crates/html_to_markdown" }
|
2024-07-23 22:01:05 +00:00
|
|
|
http_client = { path = "crates/http_client" }
|
2024-03-19 17:13:10 +00:00
|
|
|
image_viewer = { path = "crates/image_viewer" }
|
2024-07-02 17:14:56 +00:00
|
|
|
indexed_docs = { path = "crates/indexed_docs" }
|
2024-05-03 19:50:42 +00:00
|
|
|
inline_completion_button = { path = "crates/inline_completion_button" }
|
2024-06-27 23:14:13 +00:00
|
|
|
install_cli = { path = "crates/install_cli" }
|
2024-02-06 19:41:36 +00:00
|
|
|
journal = { path = "crates/journal" }
|
|
|
|
language = { path = "crates/language" }
|
Extract completion provider crate (#14823)
We will soon need `semantic_index` to be able to use
`CompletionProvider`. This is currently impossible due to a cyclic crate
dependency, because `CompletionProvider` lives in the `assistant` crate,
which depends on `semantic_index`.
This PR breaks the dependency cycle by extracting two crates out of
`assistant`: `language_model` and `completion`.
Only one piece of logic changed: [this
code](https://github.com/zed-industries/zed/commit/922fcaf5a6076e56890373035b1065b13512546d#diff-3857b3707687a4d585f1200eec4c34a7a079eae8d303b4ce5b4fce46234ace9fR61-R69).
* As of https://github.com/zed-industries/zed/pull/13276, whenever we
ask a given completion provider for its available models, OpenAI
providers would go and ask the global assistant settings whether the
user had configured an `available_models` setting, and if so, return
that.
* This PR changes it so that instead of eagerly asking the assistant
settings for this info (the new crate must not depend on `assistant`, or
else the dependency cycle would be back), OpenAI completion providers
now store the user-configured settings as part of their struct, and
whenever the settings change, we update the provider.
In theory, this change should not change user-visible behavior...but
since it's the only change in this large PR that's more than just moving
code around, I'm mentioning it here in case there's an unexpected
regression in practice! (cc @amtoaer in case you'd like to try out this
branch and verify that the feature is still working the way you expect.)
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-19 17:35:34 +00:00
|
|
|
language_model = { path = "crates/language_model" }
|
2024-02-06 19:41:36 +00:00
|
|
|
language_selector = { path = "crates/language_selector" }
|
|
|
|
language_tools = { path = "crates/language_tools" }
|
2024-02-25 17:02:59 +00:00
|
|
|
languages = { path = "crates/languages" }
|
2024-02-06 19:41:36 +00:00
|
|
|
live_kit_client = { path = "crates/live_kit_client" }
|
|
|
|
live_kit_server = { path = "crates/live_kit_server" }
|
|
|
|
lsp = { path = "crates/lsp" }
|
2024-05-09 09:03:33 +00:00
|
|
|
markdown = { path = "crates/markdown" }
|
2024-02-06 19:41:36 +00:00
|
|
|
markdown_preview = { path = "crates/markdown_preview" }
|
|
|
|
media = { path = "crates/media" }
|
|
|
|
menu = { path = "crates/menu" }
|
|
|
|
multi_buffer = { path = "crates/multi_buffer" }
|
|
|
|
node_runtime = { path = "crates/node_runtime" }
|
|
|
|
notifications = { path = "crates/notifications" }
|
2024-06-12 00:35:27 +00:00
|
|
|
ollama = { path = "crates/ollama" }
|
2024-03-19 18:22:26 +00:00
|
|
|
open_ai = { path = "crates/open_ai" }
|
2024-02-06 19:41:36 +00:00
|
|
|
outline = { path = "crates/outline" }
|
2024-06-12 20:22:52 +00:00
|
|
|
outline_panel = { path = "crates/outline_panel" }
|
2024-06-17 23:27:42 +00:00
|
|
|
paths = { path = "crates/paths" }
|
2024-08-18 21:22:19 +00:00
|
|
|
performance = { path = "crates/performance" }
|
2024-02-06 19:41:36 +00:00
|
|
|
picker = { path = "crates/picker" }
|
|
|
|
plugin = { path = "crates/plugin" }
|
|
|
|
plugin_macros = { path = "crates/plugin_macros" }
|
|
|
|
prettier = { path = "crates/prettier" }
|
|
|
|
project = { path = "crates/project" }
|
|
|
|
project_panel = { path = "crates/project_panel" }
|
|
|
|
project_symbols = { path = "crates/project_symbols" }
|
2024-06-27 23:14:13 +00:00
|
|
|
proto = { path = "crates/proto" }
|
2024-02-06 19:41:36 +00:00
|
|
|
quick_action_bar = { path = "crates/quick_action_bar" }
|
|
|
|
recent_projects = { path = "crates/recent_projects" }
|
2024-07-26 01:52:53 +00:00
|
|
|
refineable = { path = "crates/refineable" }
|
2024-02-06 19:41:36 +00:00
|
|
|
release_channel = { path = "crates/release_channel" }
|
2024-07-19 17:27:26 +00:00
|
|
|
remote = { path = "crates/remote" }
|
|
|
|
remote_server = { path = "crates/remote_server" }
|
Bring Jupyter to Zed Editing (#12062)
Run any Jupyter kernel in Zed on any buffer (editor):
<img width="1074" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/eac8ed69-d02b-4d46-b379-6186d8f59470">
## TODO
### Lifecycle
* [x] Launch kernels on demand
* [x] Wait for kernel to be started
* [x] Request Kernel info on start
* [x] Show in progress indicator
* [ ] Allow picking kernel (it defaults to first matching language name)
* [ ] Menu for interrupting and shutting down the kernel
* [ ] Drop running kernels once editor is dropped
### Media Outputs
* [x] Render text and tracebacks with ANSI color handling
* [x] Render markdown as text
* [x] Render PNG and JPEG images using an explicit height based on
line-height
* ~~Render SVG~~ -- not happening for this PR due to lack of text in SVG
support
* [ ] Process `update_display_data` message and related `display_id`
* [x] Process `page` data from payloads as outputs
* [ ] Render markdown as, well, rendered markdown -- Note: unsure if we
can get line heights here
### Document
* [x] Select code and run
* [x] Run current line
* [x] Clear previous overlapping runs
* [ ] Support running markdown code blocks
* [ ] Action to export session as notebook or output files
* [ ] Action to clear all outputs
* [ ] Delete outputs when lines are deleted
## Other missing features
The following is a list of missing functionality or expectations that
are out of scope for this PR.
### Python Environments
Detecting python environments should probably be done in a separate PR
in tandem with how they're used with LSP. Users likely want to pick an
environment for their project, whether a virtualenv, conda env, pyenv,
poetry backed virtualenv, or the system. Related issues:
* https://github.com/zed-industries/zed/issues/7646
* https://github.com/zed-industries/zed/issues/7808
* https://github.com/zed-industries/zed/issues/7296
### LSP Integration
* Submit `complete_request` messages for completions to interleave
interactive variables with LSP
* LSP for IPython semantics (`%%timeit`, `!ls`, `get_ipython`, etc.)
## Future release notes
- Run code in any editor, whether it's a script or a markdown document
Release Notes:
- N/A
2024-06-17 17:02:31 +00:00
|
|
|
repl = { path = "crates/repl" }
|
2024-02-06 19:41:36 +00:00
|
|
|
rich_text = { path = "crates/rich_text" }
|
|
|
|
rope = { path = "crates/rope" }
|
|
|
|
rpc = { path = "crates/rpc" }
|
|
|
|
search = { path = "crates/search" }
|
2024-04-23 23:23:26 +00:00
|
|
|
semantic_index = { path = "crates/semantic_index" }
|
2024-03-29 16:11:57 +00:00
|
|
|
semantic_version = { path = "crates/semantic_version" }
|
2024-07-23 17:44:02 +00:00
|
|
|
session = { path = "crates/session" }
|
2024-02-06 19:41:36 +00:00
|
|
|
settings = { path = "crates/settings" }
|
2024-07-23 16:50:11 +00:00
|
|
|
settings_ui = { path = "crates/settings_ui" }
|
2024-02-06 19:41:36 +00:00
|
|
|
snippet = { path = "crates/snippet" }
|
2024-07-09 12:02:36 +00:00
|
|
|
snippet_provider = { path = "crates/snippet_provider" }
|
2024-02-06 19:41:36 +00:00
|
|
|
sqlez = { path = "crates/sqlez" }
|
|
|
|
sqlez_macros = { path = "crates/sqlez_macros" }
|
|
|
|
story = { path = "crates/story" }
|
|
|
|
storybook = { path = "crates/storybook" }
|
|
|
|
sum_tree = { path = "crates/sum_tree" }
|
2024-06-27 23:14:13 +00:00
|
|
|
supermaven = { path = "crates/supermaven" }
|
|
|
|
supermaven_api = { path = "crates/supermaven_api" }
|
Add tab switcher (#7987)
The Tab Switcher implementation (#7653):
- `ctrl-tab` opens the Tab Switcher and moves selection to the
previously selcted tab. It also cycles selection forward.
- `ctrl-shift-tab` opens the Tab Switcher and moves selection to the
last tab in the list. It also cycles selection backward.
- Tab is selected and the Tab Switcher is closed on the shortcut
modifier key (`ctrl` by default) release.
- List items are in reverse activation history order.
- The list reacts to the item changes in background (new tab, tab
closed, tab title changed etc.)
Intentionally not in scope of this PR:
- File icons
- Close buttons
I will come back to these features. I think they need to be implemented
in separate PRs, and be synchronized with changes in how tabs are
rendered, to reuse the code as it's done in the current implementation.
The Tab Switcher looks usable even without them.
Known Issues:
Tab Switcher doesn't react to mouse click on a list item. It's not a tab
switcher specific problem, it looks like ctrl-clicks are not handled the
same way in Zed as cmd-clicks. For instance, menu items can be activated
with cmd-click, but don't react to ctrl-click. Since the Tab Switcher's
default keybinding is `ctrl-tab`, the user can only click an item with
`ctrl` pushed down, thus preventing `on_click()` from firing.
fixes #7653, #7321
Release Notes:
- Added Tab Switcher which is accessible via `ctrl-tab` and
`ctrl-shift-tab` (#7653) (#7321)
Related issues:
- Unblocks #7356, I hope 😄
How it looks and works (it's only `ctrl-tab`'s and `ctrl-shift-tab`'s,
no `enter`'s or mouse clicks):
https://github.com/zed-industries/zed/assets/2101250/4ad4ec6a-5314-481b-8b35-7ac85e43eb92
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-27 18:15:08 +00:00
|
|
|
tab_switcher = { path = "crates/tab_switcher" }
|
2024-06-27 23:14:13 +00:00
|
|
|
task = { path = "crates/task" }
|
|
|
|
tasks_ui = { path = "crates/tasks_ui" }
|
|
|
|
telemetry_events = { path = "crates/telemetry_events" }
|
2024-02-06 19:41:36 +00:00
|
|
|
terminal = { path = "crates/terminal" }
|
|
|
|
terminal_view = { path = "crates/terminal_view" }
|
|
|
|
text = { path = "crates/text" }
|
|
|
|
theme = { path = "crates/theme" }
|
|
|
|
theme_importer = { path = "crates/theme_importer" }
|
|
|
|
theme_selector = { path = "crates/theme_selector" }
|
2024-02-24 02:18:06 +00:00
|
|
|
time_format = { path = "crates/time_format" }
|
2024-06-27 23:14:13 +00:00
|
|
|
title_bar = { path = "crates/title_bar" }
|
2024-02-06 19:41:36 +00:00
|
|
|
ui = { path = "crates/ui" }
|
2024-07-08 21:05:30 +00:00
|
|
|
ui_input = { path = "crates/ui_input" }
|
2024-02-06 19:41:36 +00:00
|
|
|
util = { path = "crates/util" }
|
|
|
|
vcs_menu = { path = "crates/vcs_menu" }
|
|
|
|
vim = { path = "crates/vim" }
|
|
|
|
welcome = { path = "crates/welcome" }
|
|
|
|
workspace = { path = "crates/workspace" }
|
2024-06-27 23:14:13 +00:00
|
|
|
worktree = { path = "crates/worktree" }
|
2024-02-06 19:41:36 +00:00
|
|
|
zed = { path = "crates/zed" }
|
|
|
|
zed_actions = { path = "crates/zed_actions" }
|
|
|
|
|
2024-07-26 01:52:53 +00:00
|
|
|
#
|
|
|
|
# External crates
|
|
|
|
#
|
|
|
|
|
2024-07-26 01:30:48 +00:00
|
|
|
aho-corasick = "1.1"
|
2024-08-22 18:55:16 +00:00
|
|
|
alacritty_terminal = { git = "https://github.com/alacritty/alacritty", rev = "91d034ff8b53867143c005acfaa14609147c9a2c" }
|
2024-07-25 09:38:09 +00:00
|
|
|
any_vec = "0.14"
|
2024-07-25 02:54:02 +00:00
|
|
|
anyhow = "1.0.86"
|
2024-07-15 16:36:39 +00:00
|
|
|
ashpd = "0.9.1"
|
2024-01-27 01:22:31 +00:00
|
|
|
async-compression = { version = "0.4", features = ["gzip", "futures-io"] }
|
2024-07-26 01:52:53 +00:00
|
|
|
async-dispatcher = "0.1"
|
2024-03-12 23:37:10 +00:00
|
|
|
async-fs = "1.6"
|
2024-07-23 16:50:11 +00:00
|
|
|
async-pipe = { git = "https://github.com/zed-industries/async-pipe-rs", rev = "82d00a04211cf4e1236029aa03e6b6ce2a74c553" }
|
2024-03-12 10:54:12 +00:00
|
|
|
async-recursion = "1.0.0"
|
2024-02-13 19:09:02 +00:00
|
|
|
async-tar = "0.4.2"
|
2024-01-31 02:41:29 +00:00
|
|
|
async-trait = "0.1"
|
2024-07-26 01:52:53 +00:00
|
|
|
async-tungstenite = "0.23"
|
2024-07-02 17:30:55 +00:00
|
|
|
async-watch = "0.3.1"
|
2024-05-09 13:23:21 +00:00
|
|
|
async_zip = { version = "0.0.17", features = ["deflate", "deflate64"] }
|
2024-07-26 21:40:38 +00:00
|
|
|
base64 = "0.22"
|
2024-07-11 22:04:46 +00:00
|
|
|
bitflags = "2.6.0"
|
2024-08-28 19:54:30 +00:00
|
|
|
blade-graphics = { git = "https://github.com/kvark/blade", rev = "fee06c42f658b36dd9ac85444a9ee2a481383695" }
|
|
|
|
blade-macros = { git = "https://github.com/kvark/blade", rev = "fee06c42f658b36dd9ac85444a9ee2a481383695" }
|
|
|
|
blade-util = { git = "https://github.com/kvark/blade", rev = "fee06c42f658b36dd9ac85444a9ee2a481383695" }
|
2024-07-25 23:20:08 +00:00
|
|
|
cargo_metadata = "0.18"
|
2024-05-13 22:52:12 +00:00
|
|
|
cargo_toml = "0.20"
|
2024-01-22 21:11:24 +00:00
|
|
|
chrono = { version = "0.4", features = ["serde"] }
|
2024-03-18 19:00:37 +00:00
|
|
|
clap = { version = "4.4", features = ["derive"] }
|
2024-08-28 22:43:14 +00:00
|
|
|
clickhouse = "0.12.0"
|
2024-06-11 18:43:12 +00:00
|
|
|
cocoa = "0.25"
|
2024-07-26 01:52:53 +00:00
|
|
|
core-foundation = "0.9.3"
|
2024-02-24 02:18:06 +00:00
|
|
|
core-foundation-sys = "0.8.6"
|
2024-07-02 17:30:55 +00:00
|
|
|
ctor = "0.2.6"
|
2024-07-26 21:58:37 +00:00
|
|
|
dashmap = "6.0"
|
2024-01-31 02:41:29 +00:00
|
|
|
derive_more = "0.99.17"
|
2024-06-17 23:27:42 +00:00
|
|
|
dirs = "4.0"
|
2024-03-07 02:18:29 +00:00
|
|
|
emojis = "0.6.1"
|
2024-07-26 14:48:07 +00:00
|
|
|
env_logger = "0.11"
|
2024-05-10 03:08:49 +00:00
|
|
|
exec = "0.3.1"
|
|
|
|
fork = "0.1.23"
|
2024-01-31 02:41:29 +00:00
|
|
|
futures = "0.3"
|
2024-04-12 17:40:59 +00:00
|
|
|
futures-batch = "0.6.1"
|
2024-03-12 23:37:10 +00:00
|
|
|
futures-lite = "1.13"
|
2024-06-17 23:31:42 +00:00
|
|
|
git2 = { version = "0.19", default-features = false }
|
2024-01-31 02:41:29 +00:00
|
|
|
globset = "0.4"
|
2024-05-29 21:15:29 +00:00
|
|
|
heed = { version = "0.20.1", features = ["read-txn-no-tls"] }
|
2024-02-23 16:13:28 +00:00
|
|
|
hex = "0.4.3"
|
2024-08-06 15:49:04 +00:00
|
|
|
hyper = "0.14"
|
2024-05-29 20:05:16 +00:00
|
|
|
html5ever = "0.27.0"
|
2024-02-26 21:09:22 +00:00
|
|
|
ignore = "0.4.22"
|
2024-06-25 13:12:45 +00:00
|
|
|
image = "0.25.1"
|
2024-06-11 19:31:55 +00:00
|
|
|
indexmap = { version = "1.6.2", features = ["serde"] }
|
2024-07-26 01:59:17 +00:00
|
|
|
indoc = "2"
|
2024-02-26 01:37:52 +00:00
|
|
|
# We explicitly disable http2 support in isahc.
|
2024-07-08 22:29:13 +00:00
|
|
|
isahc = { version = "1.7.2", default-features = false, features = [
|
|
|
|
"text-decoding",
|
|
|
|
] }
|
2024-02-26 01:37:52 +00:00
|
|
|
itertools = "0.11.0"
|
2024-07-26 21:20:01 +00:00
|
|
|
jsonwebtoken = "9.3"
|
2024-05-10 03:08:49 +00:00
|
|
|
libc = "0.2"
|
2024-02-20 04:49:47 +00:00
|
|
|
linkify = "0.10.0"
|
2024-07-23 20:29:56 +00:00
|
|
|
log = { version = "0.4.16", features = ["kv_unstable_serde", "serde"] }
|
2024-05-29 20:05:16 +00:00
|
|
|
markup5ever_rcdom = "0.3.0"
|
2024-04-26 02:37:40 +00:00
|
|
|
nanoid = "0.4"
|
2024-04-30 00:13:28 +00:00
|
|
|
nix = "0.28"
|
2024-06-10 18:19:17 +00:00
|
|
|
num-format = "0.4.4"
|
2024-05-10 03:08:49 +00:00
|
|
|
once_cell = "1.19.0"
|
2024-01-31 02:41:29 +00:00
|
|
|
ordered-float = "2.1.1"
|
2024-02-27 21:29:27 +00:00
|
|
|
palette = { version = "0.7.5", default-features = false, features = ["std"] }
|
2024-03-12 23:10:49 +00:00
|
|
|
parking_lot = "0.12.1"
|
2024-05-24 14:04:24 +00:00
|
|
|
pathdiff = "0.2"
|
2024-02-22 18:59:52 +00:00
|
|
|
profiling = "1"
|
2023-04-25 00:41:55 +00:00
|
|
|
postage = { version = "0.5", features = ["futures-traits"] }
|
2024-01-31 02:41:29 +00:00
|
|
|
pretty_assertions = "1.3.0"
|
2024-03-19 02:33:20 +00:00
|
|
|
prost = "0.9"
|
|
|
|
prost-build = "0.9"
|
|
|
|
prost-types = "0.9"
|
2024-02-26 19:04:48 +00:00
|
|
|
pulldown-cmark = { version = "0.10.0", default-features = false }
|
2024-01-31 02:41:29 +00:00
|
|
|
rand = "0.8.5"
|
|
|
|
regex = "1.5"
|
2024-05-09 22:57:14 +00:00
|
|
|
repair_json = "0.1.0"
|
2024-07-24 00:11:48 +00:00
|
|
|
rsa = "0.9.6"
|
2024-08-20 05:39:17 +00:00
|
|
|
runtimelib = { version = "0.15", default-features = false, features = [
|
2024-07-08 22:29:13 +00:00
|
|
|
"async-dispatcher-runtime",
|
|
|
|
] }
|
2023-10-03 19:16:53 +00:00
|
|
|
rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] }
|
2024-07-24 20:38:21 +00:00
|
|
|
rustc-demangle = "0.1.23"
|
2024-05-11 08:10:13 +00:00
|
|
|
rust-embed = { version = "8.4", features = ["include-exclude"] }
|
2024-08-22 18:55:16 +00:00
|
|
|
schemars = { version = "0.8", features = ["impl_json_schema"] }
|
2024-02-16 02:54:43 +00:00
|
|
|
semver = "1.0"
|
2022-10-11 00:10:42 +00:00
|
|
|
serde = { version = "1.0", features = ["derive", "rc"] }
|
2023-03-17 14:39:24 +00:00
|
|
|
serde_derive = { version = "1.0", features = ["deserialize_in_place"] }
|
2022-10-11 00:10:42 +00:00
|
|
|
serde_json = { version = "1.0", features = ["preserve_order", "raw_value"] }
|
2024-03-06 20:48:43 +00:00
|
|
|
serde_json_lenient = { version = "0.1", features = [
|
|
|
|
"preserve_order",
|
|
|
|
"raw_value",
|
|
|
|
] }
|
2024-01-27 03:40:31 +00:00
|
|
|
serde_repr = "0.1"
|
2024-02-23 16:13:28 +00:00
|
|
|
sha2 = "0.10"
|
2024-02-25 17:02:59 +00:00
|
|
|
shellexpand = "2.1.0"
|
2024-05-22 04:39:16 +00:00
|
|
|
shlex = "1.3.0"
|
2024-06-17 23:27:42 +00:00
|
|
|
signal-hook = "0.3.17"
|
2024-06-11 10:39:45 +00:00
|
|
|
similar = "1.3"
|
2024-07-11 22:04:46 +00:00
|
|
|
simplelog = "0.12.2"
|
2023-04-20 07:11:45 +00:00
|
|
|
smallvec = { version = "1.6", features = ["union"] }
|
2024-01-31 02:41:29 +00:00
|
|
|
smol = "1.2"
|
2024-07-29 18:21:19 +00:00
|
|
|
strsim = "0.11"
|
2023-10-04 21:16:32 +00:00
|
|
|
strum = { version = "0.25.0", features = ["derive"] }
|
2024-03-07 03:51:43 +00:00
|
|
|
subtle = "2.5.0"
|
2024-07-26 01:30:48 +00:00
|
|
|
sys-locale = "0.3.1"
|
2024-03-12 19:27:40 +00:00
|
|
|
sysinfo = "0.30.7"
|
2024-01-31 02:41:29 +00:00
|
|
|
tempfile = "3.9.0"
|
|
|
|
thiserror = "1.0.29"
|
2024-05-16 11:09:28 +00:00
|
|
|
tiktoken-rs = "0.5.9"
|
2024-03-06 20:48:43 +00:00
|
|
|
time = { version = "0.3", features = [
|
Add `git blame` (#8889)
This adds a new action to the editor: `editor: toggle git blame`. When
used it turns on a sidebar containing `git blame` information for the
currently open buffer.
The git blame information is updated when the buffer changes. It handles
additions, deletions, modifications, changes to the underlying git data
(new commits, changed commits, ...), file saves. It also handles folding
and wrapping lines correctly.
When the user hovers over a commit, a tooltip displays information for
the commit that introduced the line. If the repository has a remote with
the name `origin` configured, then clicking on a blame entry opens the
permalink to the commit on the code host.
Users can right-click on a blame entry to get a context menu which
allows them to copy the SHA of the commit.
The feature also works on shared projects, e.g. when collaborating a
peer can request `git blame` data.
As of this PR, Zed now comes bundled with a `git` binary so that users
don't have to have `git` installed locally to use this feature.
### Screenshots
![screenshot-2024-03-28-13 57
43@2x](https://github.com/zed-industries/zed/assets/1185253/ee8ec55d-3b5e-4d63-a85a-852da914f5ba)
![screenshot-2024-03-28-14 01
23@2x](https://github.com/zed-industries/zed/assets/1185253/2ba8efd7-e887-4076-a87a-587a732b9e9a)
![screenshot-2024-03-28-14 01
32@2x](https://github.com/zed-industries/zed/assets/1185253/496f4a06-b189-4881-b427-2289ae6e6075)
### TODOs
- [x] Bundling `git` binary
### Release Notes
Release Notes:
- Added `editor: toggle git blame` command that toggles a sidebar with
git blame information for the current buffer.
---------
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-28 17:32:11 +00:00
|
|
|
"macros",
|
|
|
|
"parsing",
|
2024-03-06 20:48:43 +00:00
|
|
|
"serde",
|
|
|
|
"serde-well-known",
|
|
|
|
"formatting",
|
|
|
|
] }
|
2024-07-19 17:27:26 +00:00
|
|
|
tiny_http = "0.8"
|
2024-02-16 22:43:40 +00:00
|
|
|
toml = "0.8"
|
2024-03-19 14:50:21 +00:00
|
|
|
tokio = { version = "1", features = ["full"] }
|
2024-02-23 19:50:06 +00:00
|
|
|
tower-http = "0.4.4"
|
2024-07-24 20:38:21 +00:00
|
|
|
tree-sitter = { version = "0.22", features = ["wasm"] }
|
|
|
|
tree-sitter-bash = "0.21"
|
|
|
|
tree-sitter-c = "0.21"
|
|
|
|
tree-sitter-cpp = "0.22"
|
|
|
|
tree-sitter-css = "0.21"
|
|
|
|
tree-sitter-elixir = "0.2"
|
2023-07-14 01:09:32 +00:00
|
|
|
tree-sitter-embedded-template = "0.20.0"
|
2024-07-24 20:38:21 +00:00
|
|
|
tree-sitter-go = "0.21"
|
2024-07-31 15:23:12 +00:00
|
|
|
tree-sitter-go-mod = { git = "https://github.com/camdencheek/tree-sitter-go-mod", rev = "1f55029bacd0a6a11f6eb894c4312d429dcf735c", package = "tree-sitter-gomod" }
|
2024-07-24 20:38:21 +00:00
|
|
|
tree-sitter-gowork = { git = "https://github.com/d1y/tree-sitter-go-work", rev = "dcbabff454703c3a4bc98a23cf8778d4be46fd22" }
|
|
|
|
tree-sitter-heex = { git = "https://github.com/phoenixframework/tree-sitter-heex", rev = "6dd0303acf7138dd2b9b432a229e16539581c701" }
|
|
|
|
tree-sitter-html = "0.20"
|
|
|
|
tree-sitter-jsdoc = "0.21"
|
|
|
|
tree-sitter-json = "0.21"
|
|
|
|
tree-sitter-md = { git = "https://github.com/zed-industries/tree-sitter-markdown", rev = "e3855e37f8f2c71aa7513c18a9c95fb7461b1b10" }
|
|
|
|
protols-tree-sitter-proto = "0.2"
|
|
|
|
tree-sitter-python = "0.21"
|
|
|
|
tree-sitter-regex = "0.21"
|
|
|
|
tree-sitter-ruby = "0.21"
|
|
|
|
tree-sitter-rust = "0.21"
|
|
|
|
tree-sitter-typescript = "0.21"
|
|
|
|
tree-sitter-yaml = "0.6"
|
2024-01-31 02:41:29 +00:00
|
|
|
unindent = "0.1.7"
|
2024-02-28 09:03:34 +00:00
|
|
|
unicase = "2.6"
|
Fix caret movement issue for some special characters (#10198)
Currently in Zed, certain characters require pressing the key twice to
move the caret through that character. For example: "❤️" and "y̆".
The reason for this is as follows:
Currently, Zed uses `chars` to distinguish different characters, and
calling `chars` on `y̆` will yield two `char` values: `y` and `\u{306}`,
and calling `chars` on `❤️` will yield two `char` values: `❤` and
`\u{fe0f}`.
Therefore, consider the following scenario (where ^ represents the
caret):
- what we see: ❤️ ^
- the actual buffer: ❤ \u{fe0f} ^
After pressing the left arrow key once:
- what we see: ❤️ ^
- the actual buffer: ❤ ^ \u{fe0f}
After pressing the left arrow key again:
- what we see: ^ ❤️
- the actual buffer: ^ ❤ \u{fe0f}
Thus, two left arrow key presses are needed to move the caret, and this
PR fixes this bug (or this is actually a feature?).
I have tried to keep the scope of code modifications as minimal as
possible. In this PR, Zed handles such characters as follows:
- what we see: ❤️ ^
- the actual buffer: ❤ \u{fe0f} ^
After pressing the left arrow key once:
- what we see: ^ ❤️
- the actual buffer: ^ ❤ \u{fe0f}
Or after pressing the delete key:
- what we see: ^
- the actual buffer: ^
Please note that currently, different platforms and software handle
these special characters differently, and even the same software may
handle these characters differently in different situations. For
example, in my testing on Chrome on macOS, GitHub treats `y̆` as a
single character, just like in this PR; however, in Rust Playground,
`y̆` is treated as two characters, and pressing the delete key does not
delete the entire `y̆` character, but instead deletes `\u{306}` to yield
the character `y`. And they both treat `❤️` as a single character,
pressing the delete key will delete the entire `❤️` character.
This PR is based on the principle of making changes with the smallest
impact on the code, and I think that deleting the entire character with
the delete key is more intuitive.
Release Notes:
- Fix caret movement issue for some special characters
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
2024-04-10 19:01:25 +00:00
|
|
|
unicode-segmentation = "1.10"
|
2024-01-31 02:41:29 +00:00
|
|
|
url = "2.2"
|
2024-05-22 22:04:47 +00:00
|
|
|
uuid = { version = "1.1.2", features = ["v4", "v5", "serde"] }
|
2024-03-23 00:29:06 +00:00
|
|
|
wasmparser = "0.201"
|
|
|
|
wasm-encoder = "0.201"
|
2024-07-25 17:56:40 +00:00
|
|
|
wasmtime = { version = "21.0.1", default-features = false, features = [
|
windows: Better keyboard input support (#9180)
### Description
Currently, there are some issues with input handling on Windows:
#### 1. Direct crash when encountering IME input.
https://github.com/zed-industries/zed/assets/14981363/598f7272-1948-4a42-99c5-2ef7b9162a1e
#### 2. Handling messages every 1/60 seconds in the main thread. Despite
being named "immediate_handle," it's not exactly immediate.
```rust
// actually halt here
let wait_result =
unsafe { DCompositionWaitForCompositorClock(Some(&[self.inner.event]), INFINITE) };
// compositor clock ticked so we should draw a frame
if wait_result == 1 {
unsafe { invalidate_thread_windows(GetCurrentThreadId()) };
while unsafe { PeekMessageW(&mut msg, HWND::default(), 0, 0, PM_REMOVE) }.as_bool()
```
#### 3. According to Windows recommendations, character input should be
obtained using `WM_CHAR` instead of `WM_KEYDOWN`. Additionally, there
are problems with the handling within `WM_CHAR`.
```rust
fn handle_char_msg(&self, wparam: WPARAM) -> LRESULT {
let mut callbacks = self.callbacks.borrow_mut();
if let Some(callback) = callbacks.input.as_mut() {
let modifiers = self.current_modifiers();
let msg_char = wparam.0 as u8 as char; // these are u16 chars, cant treat them as u8
```
And, we don't handle `WM_SYSKEYDOWN` properly, which leads to `Alt + F4`
not working.
Release Notes:
- N/A
2024-03-13 19:10:22 +00:00
|
|
|
"async",
|
|
|
|
"demangle",
|
|
|
|
"runtime",
|
|
|
|
"cranelift",
|
|
|
|
"component-model",
|
|
|
|
] }
|
2024-07-25 17:56:40 +00:00
|
|
|
wasmtime-wasi = "21.0.1"
|
Detect and possibly use user-installed `gopls` / `zls` language servers (#8188)
After a lot of back-and-forth, this is a small attempt to implement
solutions (1) and (3) in
https://github.com/zed-industries/zed/issues/7902. The goal is to have a
minimal change that helps users get started with Zed, until we have
extensions ready.
Release Notes:
- Added detection of user-installed `gopls` to Go language server
adapter. If a user has `gopls` in `$PATH` when opening a worktree, it
will be used.
- Added detection of user-installed `zls` to Zig language server
adapter. If a user has `zls` in `$PATH` when opening a worktree, it will
be used.
Example:
I don't have `go` installed globally, but I do have `gopls`:
```
~ $ which go
go not found
~ $ which gopls
/Users/thorstenball/code/go/bin/gopls
```
But I do have `go` in a project's directory:
```
~/tmp/go-testing φ which go
/Users/thorstenball/.local/share/mise/installs/go/1.21.5/go/bin/go
~/tmp/go-testing φ which gopls
/Users/thorstenball/code/go/bin/gopls
```
With current Zed when I run `zed ~/tmp/go-testing`, I'd get the dreaded
error:
![screenshot-2024-02-23-11 14
08@2x](https://github.com/zed-industries/zed/assets/1185253/822ea59b-c63e-4102-a50e-75501cc4e0e3)
But with the changes in this PR, it works:
```
[2024-02-23T11:14:42+01:00 INFO language::language_registry] starting language server "gopls", path: "/Users/thorstenball/tmp/go-testing", id: 1
[2024-02-23T11:14:42+01:00 INFO language::language_registry] found user-installed language server for Go. path: "/Users/thorstenball/code/go/bin/gopls", arguments: ["-mode=stdio"]
[2024-02-23T11:14:42+01:00 INFO lsp] starting language server. binary path: "/Users/thorstenball/code/go/bin/gopls", working directory: "/Users/thorstenball/tmp/go-testing", args: ["-mode=stdio"]
```
---------
Co-authored-by: Antonio <antonio@zed.dev>
2024-02-23 12:39:14 +00:00
|
|
|
which = "6.0.0"
|
2024-03-23 00:29:06 +00:00
|
|
|
wit-component = "0.201"
|
2023-11-27 21:16:50 +00:00
|
|
|
|
2024-07-30 03:50:07 +00:00
|
|
|
[workspace.dependencies.async-stripe]
|
2024-08-15 13:50:59 +00:00
|
|
|
version = "0.38"
|
2024-07-30 03:50:07 +00:00
|
|
|
default-features = false
|
|
|
|
features = [
|
|
|
|
"runtime-tokio-hyper-rustls",
|
|
|
|
"billing",
|
|
|
|
"checkout",
|
|
|
|
"events",
|
|
|
|
# The features below are only enabled to get the `events` feature to build.
|
|
|
|
"chrono",
|
|
|
|
"connect",
|
|
|
|
]
|
|
|
|
|
2024-03-03 19:58:31 +00:00
|
|
|
[workspace.dependencies.windows]
|
2024-07-25 17:41:59 +00:00
|
|
|
version = "0.58"
|
2024-03-03 19:58:31 +00:00
|
|
|
features = [
|
2024-03-07 23:59:48 +00:00
|
|
|
"implement",
|
2024-04-18 18:58:46 +00:00
|
|
|
"Foundation_Numerics",
|
2024-05-09 21:24:57 +00:00
|
|
|
"System",
|
|
|
|
"System_Threading",
|
2024-06-13 17:52:53 +00:00
|
|
|
"UI_ViewManagement",
|
2024-03-06 20:48:43 +00:00
|
|
|
"Wdk_System_SystemServices",
|
2024-03-14 22:29:25 +00:00
|
|
|
"Win32_Globalization",
|
2024-04-18 18:58:46 +00:00
|
|
|
"Win32_Graphics_Direct2D",
|
|
|
|
"Win32_Graphics_Direct2D_Common",
|
2024-03-15 17:40:58 +00:00
|
|
|
"Win32_Graphics_DirectWrite",
|
2024-05-15 17:45:17 +00:00
|
|
|
"Win32_Graphics_Dwm",
|
2024-04-18 18:58:46 +00:00
|
|
|
"Win32_Graphics_Dxgi_Common",
|
2024-03-16 00:17:26 +00:00
|
|
|
"Win32_Graphics_Gdi",
|
2024-04-18 18:58:46 +00:00
|
|
|
"Win32_Graphics_Imaging",
|
|
|
|
"Win32_Graphics_Imaging_D2D",
|
2024-03-03 19:58:31 +00:00
|
|
|
"Win32_Security",
|
2024-03-18 17:16:29 +00:00
|
|
|
"Win32_Security_Credentials",
|
2024-03-14 17:43:06 +00:00
|
|
|
"Win32_Storage_FileSystem",
|
2024-03-07 23:59:48 +00:00
|
|
|
"Win32_System_Com",
|
|
|
|
"Win32_System_Com_StructuredStorage",
|
2024-03-05 16:35:07 +00:00
|
|
|
"Win32_System_DataExchange",
|
2024-03-16 00:17:26 +00:00
|
|
|
"Win32_System_LibraryLoader",
|
2024-07-15 02:40:41 +00:00
|
|
|
"Win32_System_Memory",
|
2024-03-05 16:35:07 +00:00
|
|
|
"Win32_System_Ole",
|
windows: Better keyboard input support (#9180)
### Description
Currently, there are some issues with input handling on Windows:
#### 1. Direct crash when encountering IME input.
https://github.com/zed-industries/zed/assets/14981363/598f7272-1948-4a42-99c5-2ef7b9162a1e
#### 2. Handling messages every 1/60 seconds in the main thread. Despite
being named "immediate_handle," it's not exactly immediate.
```rust
// actually halt here
let wait_result =
unsafe { DCompositionWaitForCompositorClock(Some(&[self.inner.event]), INFINITE) };
// compositor clock ticked so we should draw a frame
if wait_result == 1 {
unsafe { invalidate_thread_windows(GetCurrentThreadId()) };
while unsafe { PeekMessageW(&mut msg, HWND::default(), 0, 0, PM_REMOVE) }.as_bool()
```
#### 3. According to Windows recommendations, character input should be
obtained using `WM_CHAR` instead of `WM_KEYDOWN`. Additionally, there
are problems with the handling within `WM_CHAR`.
```rust
fn handle_char_msg(&self, wparam: WPARAM) -> LRESULT {
let mut callbacks = self.callbacks.borrow_mut();
if let Some(callback) = callbacks.input.as_mut() {
let modifiers = self.current_modifiers();
let msg_char = wparam.0 as u8 as char; // these are u16 chars, cant treat them as u8
```
And, we don't handle `WM_SYSKEYDOWN` properly, which leads to `Alt + F4`
not working.
Release Notes:
- N/A
2024-03-13 19:10:22 +00:00
|
|
|
"Win32_System_SystemInformation",
|
|
|
|
"Win32_System_SystemServices",
|
|
|
|
"Win32_System_Threading",
|
2024-05-09 21:24:57 +00:00
|
|
|
"Win32_System_WinRT",
|
windows: Better keyboard input support (#9180)
### Description
Currently, there are some issues with input handling on Windows:
#### 1. Direct crash when encountering IME input.
https://github.com/zed-industries/zed/assets/14981363/598f7272-1948-4a42-99c5-2ef7b9162a1e
#### 2. Handling messages every 1/60 seconds in the main thread. Despite
being named "immediate_handle," it's not exactly immediate.
```rust
// actually halt here
let wait_result =
unsafe { DCompositionWaitForCompositorClock(Some(&[self.inner.event]), INFINITE) };
// compositor clock ticked so we should draw a frame
if wait_result == 1 {
unsafe { invalidate_thread_windows(GetCurrentThreadId()) };
while unsafe { PeekMessageW(&mut msg, HWND::default(), 0, 0, PM_REMOVE) }.as_bool()
```
#### 3. According to Windows recommendations, character input should be
obtained using `WM_CHAR` instead of `WM_KEYDOWN`. Additionally, there
are problems with the handling within `WM_CHAR`.
```rust
fn handle_char_msg(&self, wparam: WPARAM) -> LRESULT {
let mut callbacks = self.callbacks.borrow_mut();
if let Some(callback) = callbacks.input.as_mut() {
let modifiers = self.current_modifiers();
let msg_char = wparam.0 as u8 as char; // these are u16 chars, cant treat them as u8
```
And, we don't handle `WM_SYSKEYDOWN` properly, which leads to `Alt + F4`
not working.
Release Notes:
- N/A
2024-03-13 19:10:22 +00:00
|
|
|
"Win32_UI_Controls",
|
2024-03-16 00:17:26 +00:00
|
|
|
"Win32_UI_HiDpi",
|
2024-03-14 22:29:25 +00:00
|
|
|
"Win32_UI_Input_Ime",
|
windows: Better keyboard input support (#9180)
### Description
Currently, there are some issues with input handling on Windows:
#### 1. Direct crash when encountering IME input.
https://github.com/zed-industries/zed/assets/14981363/598f7272-1948-4a42-99c5-2ef7b9162a1e
#### 2. Handling messages every 1/60 seconds in the main thread. Despite
being named "immediate_handle," it's not exactly immediate.
```rust
// actually halt here
let wait_result =
unsafe { DCompositionWaitForCompositorClock(Some(&[self.inner.event]), INFINITE) };
// compositor clock ticked so we should draw a frame
if wait_result == 1 {
unsafe { invalidate_thread_windows(GetCurrentThreadId()) };
while unsafe { PeekMessageW(&mut msg, HWND::default(), 0, 0, PM_REMOVE) }.as_bool()
```
#### 3. According to Windows recommendations, character input should be
obtained using `WM_CHAR` instead of `WM_KEYDOWN`. Additionally, there
are problems with the handling within `WM_CHAR`.
```rust
fn handle_char_msg(&self, wparam: WPARAM) -> LRESULT {
let mut callbacks = self.callbacks.borrow_mut();
if let Some(callback) = callbacks.input.as_mut() {
let modifiers = self.current_modifiers();
let msg_char = wparam.0 as u8 as char; // these are u16 chars, cant treat them as u8
```
And, we don't handle `WM_SYSKEYDOWN` properly, which leads to `Alt + F4`
not working.
Release Notes:
- N/A
2024-03-13 19:10:22 +00:00
|
|
|
"Win32_UI_Input_KeyboardAndMouse",
|
|
|
|
"Win32_UI_Shell",
|
|
|
|
"Win32_UI_WindowsAndMessaging",
|
2024-03-03 19:58:31 +00:00
|
|
|
]
|
|
|
|
|
2024-07-25 17:56:40 +00:00
|
|
|
[patch.crates-io]
|
|
|
|
# Patch Tree-sitter for updated wasmtime.
|
|
|
|
tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "7f4a57817d58a2f134fe863674acad6bbf007228" }
|
|
|
|
|
2021-04-19 22:00:10 +00:00
|
|
|
[profile.dev]
|
|
|
|
split-debuginfo = "unpacked"
|
2023-11-23 16:54:43 +00:00
|
|
|
debug = "limited"
|
2024-06-24 13:43:31 +00:00
|
|
|
codegen-units = 16
|
2021-05-07 12:42:56 +00:00
|
|
|
|
2024-02-27 00:27:57 +00:00
|
|
|
[profile.dev.package]
|
|
|
|
taffy = { opt-level = 3 }
|
|
|
|
cranelift-codegen = { opt-level = 3 }
|
2024-04-01 15:56:17 +00:00
|
|
|
resvg = { opt-level = 3 }
|
2024-03-05 14:37:28 +00:00
|
|
|
rustybuzz = { opt-level = 3 }
|
|
|
|
ttf-parser = { opt-level = 3 }
|
2024-02-27 00:27:57 +00:00
|
|
|
wasmtime-cranelift = { opt-level = 3 }
|
2024-03-23 00:29:06 +00:00
|
|
|
wasmtime = { opt-level = 3 }
|
2023-11-16 07:15:14 +00:00
|
|
|
|
2021-05-07 12:42:56 +00:00
|
|
|
[profile.release]
|
2023-11-23 16:54:43 +00:00
|
|
|
debug = "limited"
|
2023-06-06 19:50:08 +00:00
|
|
|
lto = "thin"
|
2023-06-22 16:06:17 +00:00
|
|
|
codegen-units = 1
|
2024-02-26 09:08:57 +00:00
|
|
|
|
chore: Merge zed lib with zed binary.
TL;DR:
- shaves off about 0.5 seconds from most of our debug builds.
- It would've slightly regressed release build due to preventing build pipelining, but as a tradeoff I've bumped up codegen-units for zed.
\# What did you come up with this time Piotr
In our zed repository I've noticed that merely *loading dependencies* in each crate takes non-trivial amount of time (~800ms in case of editor).
That is to say, the moment you \`use editor\`, your build time increases by 800ms - this happens just once in crate though, as it looks like compiler has to load .rlibs of all of the referenced dependencies.
This is visible under rustc's self-profile. Repro steps on twitter: https://twitter.com/PiotrOsiewicz/status/1762845413072101567
\# How does this commit alleviate this?
zed lib + zed bin are on critical path of every build and cumulatively take about 3s to build. This commit bundles all of this up into ~2.2s of bin build time instead.
\# Wait, splitting binary targets is good, no?
Splitting up a binary target into lib + bin is generally considered to be a good practice, as you can then reuse the lib part elsewhere if needed.
It also allows the build to kick off the moment metadata for all of the dependencies is available (thus, you don't need to wait for codegen).
However, we do not really use zed as a lib, so the first benefit is not really a thing for us.
The latter *is* indeed something we lose out on in release mode (in dev codegen phase of leaf-ish crates is insignificant, as we use shared generics - thus we don't spend much time codegening).
That's why I've bumped codegen units for zed crate to 16 in release mode to keep build times in tact.
2024-03-19 00:11:36 +00:00
|
|
|
[profile.release.package]
|
|
|
|
zed = { codegen-units = 16 }
|
|
|
|
|
2024-06-24 12:34:16 +00:00
|
|
|
[profile.release-fast]
|
|
|
|
inherits = "release"
|
2024-08-25 23:24:08 +00:00
|
|
|
debug = "full"
|
2024-06-24 12:34:16 +00:00
|
|
|
lto = false
|
|
|
|
codegen-units = 16
|
|
|
|
|
2024-03-05 17:01:17 +00:00
|
|
|
[workspace.lints.clippy]
|
|
|
|
dbg_macro = "deny"
|
|
|
|
todo = "deny"
|
|
|
|
|
2024-03-14 20:02:03 +00:00
|
|
|
# Motivation: We use `vec![a..b]` a lot when dealing with ranges in text, so
|
|
|
|
# warning on this rule produces a lot of noise.
|
|
|
|
single_range_in_vec_init = "allow"
|
|
|
|
|
2024-03-05 17:01:17 +00:00
|
|
|
# These are all of the rules that currently have violations in the Zed
|
|
|
|
# codebase.
|
|
|
|
#
|
|
|
|
# We'll want to drive this list down by either:
|
|
|
|
# 1. fixing violations of the rule and begin enforcing it
|
|
|
|
# 2. deciding we want to allow the rule permanently, at which point
|
|
|
|
# we should codify that separately above.
|
|
|
|
#
|
|
|
|
# This list shouldn't be added to; it should only get shorter.
|
|
|
|
# =============================================================================
|
|
|
|
|
|
|
|
# There are a bunch of rules currently failing in the `style` group, so
|
|
|
|
# allow all of those, for now.
|
2024-07-10 15:53:17 +00:00
|
|
|
style = { level = "allow", priority = -1 }
|
2024-03-05 17:01:17 +00:00
|
|
|
|
|
|
|
# Individual rules that have violations in the codebase:
|
|
|
|
type_complexity = "allow"
|
|
|
|
|
2024-02-26 09:08:57 +00:00
|
|
|
[workspace.metadata.cargo-machete]
|
|
|
|
ignored = ["bindgen", "cbindgen", "prost_build", "serde"]
|