zed/crates
Richard Feldman ec487d8f64
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](922fcaf5a6 (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 13:35:34 -04:00
..
activity_indicator Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
anthropic Make Claude 3.5 the default Anthropic model (#13324) 2024-06-21 18:47:38 +02:00
assets Move from Zed fonts to IBM Plex (#13596) 2024-06-27 14:36:44 -06:00
assistant Extract completion provider crate (#14823) 2024-07-19 13:35:34 -04:00
assistant_slash_command Lay the groundwork for collaborating on assistant panel (#13991) 2024-07-10 17:36:22 +02:00
assistant_tooling Bring the Tool Calling README up to date (#11683) 2024-05-12 04:47:19 -07:00
audio Make tests less noisy (#12463) 2024-05-29 18:06:45 -07:00
auto_update Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
breadcrumbs breadcrumbs: Use early return in set_active_pane_item (#14691) 2024-07-17 18:58:44 -04:00
call Remove never-used client parameter from message handler functions (#13406) 2024-06-22 16:07:36 -07:00
channel Remove never-used client parameter from message handler functions (#13406) 2024-06-22 16:07:36 -07:00
cli Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
client client: Remove leftover http.rs file (#14822) 2024-07-19 12:22:31 -04:00
clock Lay the groundwork for collaborating on assistant panel (#13991) 2024-07-10 17:36:22 +02:00
collab Extract completion provider crate (#14823) 2024-07-19 13:35:34 -04:00
collab_ui Use ui::prelude::* in a few more spots (#14807) 2024-07-19 08:57:51 -04:00
collections gpui: Add SVG rendering to img element and generic asset cache (#9931) 2024-03-29 17:09:49 -07:00
command_palette Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
command_palette_hooks Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
completion Extract completion provider crate (#14823) 2024-07-19 13:35:34 -04:00
copilot Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
db paths: Replace lazy_static! with OnceLock (#13213) 2024-06-18 12:22:37 -04:00
dev_server_projects remoting: Allow Add/Remove remote folder (#14532) 2024-07-16 12:01:59 -06:00
diagnostics Avoid losing focus when block decorations go offscreen (#14815) 2024-07-19 17:04:18 +02:00
editor Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
extension Exclude dev extensions from auto-updates (#14680) 2024-07-17 15:35:09 -04:00
extension_api zed_extension_api: Return structured slash command completions (#13879) 2024-07-05 14:08:42 -04:00
extension_cli extension_cli: Allow building without dynamically linking WebRTC (#13080) 2024-06-14 20:13:31 -04:00
extensions_ui Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
feature_flags Add an experimental, WIP diagnostics grouping panel (#14515) 2024-07-15 22:58:18 +03:00
feedback Refine inline transformation UX (#12939) 2024-06-13 08:35:22 +02:00
file_finder remoting: Allow Add/Remove remote folder (#14532) 2024-07-16 12:01:59 -06:00
file_icons Make tests less noisy (#12463) 2024-05-29 18:06:45 -07:00
fs Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
fsevent Retain run loop (#11241) 2024-04-30 23:31:59 -06:00
fuzzy Introduce an outline panel (#12637) 2024-06-12 23:22:52 +03:00
git Introduce an outline panel (#12637) 2024-06-12 23:22:52 +03:00
git_hosting_providers Extract http from util (#11680) 2024-05-10 15:50:20 -06:00
go_to_line Add more menus to Zed (#12940) 2024-06-18 12:16:54 -07:00
google_ai Respect requested gemini model (#13427) 2024-06-23 14:10:31 -06:00
gpui Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
gpui_macros Upsell built-in features on the extensions page (#14516) 2024-07-15 17:10:01 -04:00
headless remoting: Allow Add/Remove remote folder (#14532) 2024-07-16 12:01:59 -06:00
html_to_markdown Publish html_to_markdown (#13718) 2024-07-01 17:18:58 -04:00
http zed_extension_api: Add github_release_by_tag_name (#12172) 2024-05-22 20:40:31 -04:00
image_viewer Add text_color helper for tab contents (#14737) 2024-07-18 09:27:05 -04:00
indexed_docs assistant: Allow /docs to perform JIT indexing when run (#14768) 2024-07-18 17:01:48 -04:00
inline_completion_button Change the context menu and Copilot settings icon (#14501) 2024-07-16 09:40:40 -03:00
install_cli Fix flickering (#9012) 2024-03-11 10:45:57 +01:00
journal Add the ability for extensions to provide language settings (#10296) 2024-04-08 19:17:12 -04:00
language Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
language_model Extract completion provider crate (#14823) 2024-07-19 13:35:34 -04:00
language_selector Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
language_tools Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
languages go: Fix quoting of targeting expression for non-fish shells (#14821) 2024-07-19 18:05:31 +02:00
live_kit_client gpui: Update Menu name to use SharedString type to support more types (#14791) 2024-07-19 08:51:31 -04:00
live_kit_server Vendor LiveKit protocol (#11672) 2024-05-10 14:18:40 -04:00
lsp Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
markdown Avoid losing focus when block decorations go offscreen (#14815) 2024-07-19 17:04:18 +02:00
markdown_preview Simplify constructing tab content that is purely textual (#14695) 2024-07-17 20:11:05 -04:00
media Revert "Revert "Revert dependency updates in #9836 (#10089)"" 2024-04-02 13:12:38 -06:00
menu open picker (#14524) 2024-07-15 17:04:15 -06:00
multi_buffer Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
node_runtime JSON: Show package.json dependency tooltips on hover (#13481) 2024-06-25 14:59:29 +02:00
notifications Remove never-used client parameter from message handler functions (#13406) 2024-06-22 16:07:36 -07:00
ollama Allow Ollama Model KeepAlive to be None, defaulting to indefinite (#13059) 2024-06-14 10:33:28 -07:00
open_ai Add gpt-4o-mini as an available model (#14770) 2024-07-18 22:32:56 -06:00
outline Add a way to filter items in the outline panel (#13984) 2024-07-09 16:44:24 +03:00
outline_panel Do not fold excerpts by default in the outline panel (#14378) 2024-07-13 04:08:21 +03:00
paths Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
picker open picker (#14524) 2024-07-15 17:04:15 -06:00
prettier Lookup prettier more leniently (#14403) 2024-07-13 21:59:14 +03:00
project Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
project_panel project_panel: Select the newly created file when copy/pasting a file (#14705) 2024-07-18 17:26:33 +03:00
project_symbols Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
proto Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
quick_action_bar Allow an initial prompt to be associated with inline assist (#14816) 2024-07-19 17:13:48 +02:00
recent_projects Use -f in ssh remoting too (#14773) 2024-07-18 19:24:59 -06:00
refineable Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
release_channel auto-updates: Do not poll for updates on dev channel (#13311) 2024-06-20 15:00:54 +02:00
remote Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
remote_server Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
repl repl: Refactor editor registration (#14819) 2024-07-19 08:58:57 -07:00
rich_text New revision of the Assistant Panel (#10870) 2024-04-23 16:23:26 -07:00
rope Indent guides (#11503) 2024-05-23 15:50:59 +02:00
rpc Rank exact extension ID matches higher in search results (#14588) 2024-07-16 12:33:28 -06:00
search Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
semantic_index Extract completion provider crate (#14823) 2024-07-19 13:35:34 -04:00
semantic_version Extract SemanticVersion into its own crate (#9956) 2024-03-29 12:11:57 -04:00
settings Show an initial empty keymap (#14609) 2024-07-16 20:24:13 -06:00
snippet html: Add support for autoclosing of tags (#11761) 2024-05-20 17:00:27 +02:00
snippet_provider extensions: Add support for snippets provided by extensions (#14020) 2024-07-10 09:40:50 +02:00
sqlez Remove extraneous Cargo.lock files (#14001) 2024-07-09 12:15:34 -04:00
sqlez_macros Dynamicer builds (#13074) 2024-06-21 16:32:32 -07:00
story Introduce a new markdown crate (#11556) 2024-05-09 11:03:33 +02:00
storybook gpui: Update Menu name to use SharedString type to support more types (#14791) 2024-07-19 08:51:31 -04:00
sum_tree Introduce Editor::insert_flaps and Editor::remove_flaps (#12096) 2024-05-21 20:23:37 +02:00
supermaven Handle supermaven account status messages (#14749) 2024-07-18 11:22:30 -07:00
supermaven_api paths: Replace lazy_static! with OnceLock (#13213) 2024-06-18 12:22:37 -04:00
tab_switcher Introduce recent files ambient context for assistant (#11791) 2024-05-14 13:48:36 +02:00
task task: Add re-run task button to terminal title (#12379) 2024-05-29 11:40:43 +02:00
tasks_ui Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
telemetry_events Add metrics_id to editor_events (#13525) 2024-06-25 16:47:55 -04:00
terminal Revert hold: true for macOS tasks (#14376) 2024-07-13 04:02:38 +03:00
terminal_view Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
text Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
theme linux: Indicate when the window is focused (#14266) 2024-07-12 14:20:58 -07:00
theme_importer linux: Panic less on window init (#14255) 2024-07-11 16:04:46 -06:00
theme_selector Use UpdateGlobal accessors in more places (#11925) 2024-05-16 13:30:04 -04:00
time_format Inline git blame (#10398) 2024-04-15 14:21:52 +02:00
title_bar Fix context in command palette from application menu (#14599) 2024-07-16 15:14:18 -06:00
ui Rework mouse handling of git hunks diff (#14727) 2024-07-19 13:48:04 +03:00
ui_input Rename ui_text_field crate to ui_input (#13949) 2024-07-08 17:05:30 -04:00
util Associate logs from log_err with the calling crate (#13617) 2024-06-27 17:03:47 -07:00
vcs_menu Adjust list item & pickers spacing (#14250) 2024-07-15 10:23:18 -03:00
vim vim: Fix 'Y' to yank to end of line (#14783) 2024-07-18 22:34:40 -06:00
welcome Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
workspace Use ui::prelude::* in a few more spots (#14807) 2024-07-19 08:57:51 -04:00
worktree Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
zed Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
zed_actions Add more menus to Zed (#12940) 2024-06-18 12:16:54 -07:00