zed/crates
Kyle Kelley d77e553466
File context for assistant panel (#9712)
Introducing the Active File Context portion of #9705. When someone is in
the assistant panel it now includes the active file as a system message
on send while showing them a nice little display in the lower right:


![image](https://github.com/zed-industries/zed/assets/836375/9abc56e0-e8f2-45ee-9e7e-b83b28b483ea)

For this iteration, I'd love to see the following before we land this:

* [x] Toggle-able context - user should be able to disable sending this
context
* [x] Show nothing if there is no context coming in
* [x] Update token count as we change items
* [x] Listen for a more finely scoped event for when the active item
changes
* [x] Create a global for pulling a file icon based on a path. Zed's
main way to do this is nested within project panel's `FileAssociation`s.
* [x] Get the code fence name for a Language for the system prompt
* [x] Update the token count when the buffer content changes

I'm seeing this PR as the foundation for providing other kinds of
context -- diagnostic summaries, failing tests, additional files, etc.

Release Notes:

- Added file context to assistant chat panel
([#9705](https://github.com/zed-industries/zed/issues/9705)).

<img width="1558" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/86eb7e50-3e28-4754-9c3f-895be588616d">

---------

Co-authored-by: Conrad Irwin <conrad@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-29 13:55:01 -07:00
..
activity_indicator Add auto-update system for extensions (#9890) 2024-03-28 15:41:22 -04:00
assets
assistant File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
audio Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
auto_update
breadcrumbs
call
channel Fix issues with extension API that come up when moving Svelte into an extension (#9611) 2024-03-22 17:29:06 -07:00
cli Windows: Enable clippy deny warnings (#9920) 2024-03-28 11:55:35 -04:00
client Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
clock
collab Extract SemanticVersion into its own crate (#9956) 2024-03-29 12:11:57 -04:00
collab_ui gpui: Rework overlay element (#9911) 2024-03-29 16:26:16 +01:00
collections
color
command_palette
command_palette_hooks Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
copilot Query code actions and hovers from all related local language servers (#9943) 2024-03-29 12:18:38 +02:00
copilot_ui Don't update active completion for editors that are not focused (#9904) 2024-03-28 10:51:55 +01:00
db Fix issues with extension API that come up when moving Svelte into an extension (#9611) 2024-03-22 17:29:06 -07:00
diagnostics Add an animation to the LSP checking indicator (#9463) 2024-03-19 10:16:18 -07:00
editor gpui: Rework overlay element (#9911) 2024-03-29 16:26:16 +01:00
extension Extract PHP support into an extension (#9966) 2024-03-29 14:51:54 -04:00
extension_api Fix issues with extension API that come up when moving Svelte into an extension (#9611) 2024-03-22 17:29:06 -07:00
extension_cli Add git blame (#8889) 2024-03-28 18:32:11 +01:00
extensions_ui Extract C# support into an extension (#9971) 2024-03-29 16:38:27 -04:00
feature_flags
feedback Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
file_finder Fix next/prev shortcuts handling in the File Finder (#9785) 2024-03-25 14:06:37 -07:00
file_icons File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
fs Add git blame (#8889) 2024-03-28 18:32:11 +01:00
fsevent
fuzzy
git Fix GitHub commit permalinks (#9961) 2024-03-29 13:17:48 -04:00
go_to_line
google_ai Fix licensing errors 2024-03-20 15:52:02 +01:00
gpui Extract SemanticVersion into its own crate (#9956) 2024-03-29 12:11:57 -04:00
gpui_macros
image_viewer Adjust image viewer tab title font (#9903) 2024-03-28 11:44:15 -04:00
install_cli
journal Revert "Revert "chore: Bump Rust version to 1.77 (#9631)"" (#9672) 2024-03-22 11:17:16 +01:00
language File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
language_selector
language_tools Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
languages File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
live_kit_client Add a schema to extensions, to prevent installing extensions on too old of a Zed version (#9599) 2024-03-20 17:33:26 -04:00
live_kit_server Merge prost dependecies (#9522) 2024-03-18 20:33:20 -06:00
lsp Query code actions and hovers from all related local language servers (#9943) 2024-03-29 12:18:38 +02:00
markdown_preview markdown preview: Handle line breaks in between task list items correctly (#9795) 2024-03-26 12:12:57 +02:00
media gpui: Update dependencies (second attempt) (#9836) 2024-03-28 10:22:31 -07:00
menu Fix the linux keymap (#9829) 2024-03-26 16:10:09 -07:00
multi_buffer
node_runtime Allow extensions to define more of the methods in the LspAdapter trait (#9554) 2024-03-20 12:47:04 -07:00
notifications
open_ai Hard code max token counts for supported models (#9675) 2024-03-21 20:30:33 -06:00
outline
picker Add spawning of tasks without saving them in the task stack (#9951) 2024-03-29 18:41:14 +01:00
prettier Fix prettier-plugin-organize-imports plugin removes used imports (#9598) 2024-03-21 08:23:15 +01:00
project Omit empty hovers (#9967) 2024-03-29 21:59:01 +02:00
project_panel File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
project_symbols
quick_action_bar
recent_projects chore: Wrap WorkspaceId in newtype (#9492) 2024-03-18 12:39:03 +01:00
refineable
release_channel
rich_text
rope Revert "language: Remove buffer fingerprinting (#9007)" 2024-03-21 14:10:18 -06:00
rpc Add git blame (#8889) 2024-03-28 18:32:11 +01:00
search Support newline and tab literals in regex search-and-replace operations (#9609) 2024-03-25 12:21:04 +01:00
semantic_version Extract SemanticVersion into its own crate (#9956) 2024-03-29 12:11:57 -04:00
settings Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
snippet
sqlez
sqlez_macros
story
storybook windows: Support compiling with MinGW toolchain (part 2) (#9843) 2024-03-28 10:40:07 -07:00
sum_tree
tab_switcher Add tab switcher (#7987) 2024-03-27 11:15:08 -07:00
task task: Make UseSelectedQuery modal action expand to full command (#9947) 2024-03-29 11:45:50 +01:00
tasks_ui Add spawning of tasks without saving them in the task stack (#9951) 2024-03-29 18:41:14 +01:00
telemetry_events Extract SemanticVersion into its own crate (#9956) 2024-03-29 12:11:57 -04:00
terminal Windows: Enable clippy deny warnings (#9920) 2024-03-28 11:55:35 -04:00
terminal_view gpui: Rework overlay element (#9911) 2024-03-29 16:26:16 +01:00
text Add git blame (#8889) 2024-03-28 18:32:11 +01:00
theme gpui: Add support for window transparency & blur on macOS (#9610) 2024-03-29 11:10:47 -04:00
theme_importer gpui: Add support for window transparency & blur on macOS (#9610) 2024-03-29 11:10:47 -04:00
theme_selector Add support for applying theme after extension is installed (#9529) 2024-03-20 11:13:58 -04:00
time_format
ui gpui: Rework overlay element (#9911) 2024-03-29 16:26:16 +01:00
util Extract SemanticVersion into its own crate (#9956) 2024-03-29 12:11:57 -04:00
vcs_menu
vim vim: Fix t operand not working correctly when cursor is on tag (#9899) 2024-03-28 10:16:54 +01:00
welcome Allow specifying no base keymap (#9471) 2024-03-20 18:52:17 -06:00
workspace File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
worktree Add git blame (#8889) 2024-03-28 18:32:11 +01:00
zed File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
zed_actions