zed/crates
Piotr Osiewicz a850731b0e
lsp: Watch paths outside of worktrees at language servers request (#17173)
Context: https://x.com/fasterthanlime/status/1819120238228570598

Up to this PR:
- We were not watching paths outside of a worktree when language server
requested it.
- We expected GlobPattern used for file watching to be always rooted at
the worktree root.

'1 mattered for observing global files (e.g. global RA config) and both
points had impact on "monorepos".
Let's picture the following scenario:
You're working on a Rust project that has two crates: bin and lib crate:
```
my-rust-project/
  bin-crate/
  lib-crate/
```
Up to this PR, making changes like changing field visibility in
lib-crate **was not reflected** in bin-crate until RA was restarted. RA
for bin-crate asked us to watch lib-crate. Now, depending on if you had
this project open as:
- a project with one worktree rooted at my-rust-project:
- due to '2, we never noticed that we have to notify RA instance for
bin-crate about changes in lib-crate.
- a project with two worktrees (bin-crate and lib-crate):
- due to '1 (as lib-crate is not within bin-crate's worktree), we once
again missed the fact that we have to watch for changes in lib-crate.

This PR solves this by introducing a side-channel - we just store fs
watchers for abs paths at the Project level. Worktree changes handling
is left relatively untouched - as it's used for other changes besides
LSP change notifying, I've figured to better leave it as is, as right
now we have 1 worktree change watcher; if we were to change it, we'd
have `(language server) + 1` watchers per worktree, which seems.. pretty
horrid.

What's the end effect? At the very least fasterthanlime should be a tad
happier; in reality though, I expect it to have some impact on LS
reliability in monorepo setups.

TODO
- [x] Wire through FileChangeType into `fs::watch` interface.

Release Notes:

- Improved language server reliability in multi-worktree projects and
monorepo. We now notify the language server more reliably about which
files have changed.
2024-08-31 01:32:33 +02:00
..
activity_indicator Extract an LspStore object from Project, to prepare for language support over SSH (#17041) 2024-08-30 14:36:38 -07:00
anthropic assistant: Add foundation for receiving tool uses from Anthropic models (#17170) 2024-08-30 14:05:55 -04:00
assets Allow prompt templates to be overridden in the zed configuration directory (#15887) 2024-08-06 19:30:48 -06:00
assistant lsp: Watch paths outside of worktrees at language servers request (#17173) 2024-08-31 01:32:33 +02:00
assistant_slash_command Fix more bugs in files (#16241) 2024-08-16 10:09:38 -07:00
audio Make tests less noisy (#12463) 2024-05-29 18:06:45 -07:00
auto_update Unmount the auto-update disk image regardless of the auto-update status (#17019) 2024-08-28 21:15:38 -07:00
breadcrumbs breadcrumbs: Use early return in set_active_pane_item (#14691) 2024-07-17 18:58:44 -04:00
call chore: Fix clippy violations from Cargo.toml (#15216) 2024-07-25 20:22:01 +02:00
channel Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
cli zed: Use CLI env for lang servers, tasks, terminal (#17075) 2024-08-29 18:09:06 +02:00
client Extract an LspStore object from Project, to prepare for language support over SSH (#17041) 2024-08-30 14:36:38 -07:00
clock Lay the groundwork for collaborating on assistant panel (#13991) 2024-07-10 17:36:22 +02:00
collab Extract an LspStore object from Project, to prepare for language support over SSH (#17041) 2024-08-30 14:36:38 -07:00
collab_ui Unify Story/StoryContainers (#17114) 2024-08-29 17:27:01 -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 command_palette: Remove project as a dependency in Cargo.toml (#16082) 2024-08-12 13:01:32 -04:00
command_palette_hooks Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
context_servers context_servers: Completion support for context server slash commands (#17085) 2024-08-29 16:56:58 -04:00
copilot Fix manual copilot with show_inline_completions: false (#16621) 2024-08-21 20:27:19 -06:00
db Replace lazy_static with std::sync::LazyLock (#16066) 2024-08-20 14:27:33 -04:00
dev_server_projects remoting: Allow Add/Remove remote folder (#14532) 2024-07-16 12:01:59 -06:00
diagnostics Extract an LspStore object from Project, to prepare for language support over SSH (#17041) 2024-08-30 14:36:38 -07:00
docs_preprocessor Don't rely on relative path for docs preprocessor (#16883) 2024-08-26 11:43:13 -04:00
editor Extract an LspStore object from Project, to prepare for language support over SSH (#17041) 2024-08-30 14:36:38 -07:00
extension lsp: Watch paths outside of worktrees at language servers request (#17173) 2024-08-31 01:32:33 +02:00
extension_api zed_extension_api: Start a list of pending changes (#16305) 2024-08-15 13:10:46 -04:00
extension_cli Provide user agent when performing HTTP requests (#15470) 2024-07-30 11:12:37 +02:00
extensions_ui extensions_ui: Truncate long text with an ellipsis (#17007) 2024-08-28 10:47:43 -04:00
feature_flags Add logic for closed beta LLM models (#16482) 2024-08-19 11:09:52 -07:00
feedback inline completions: Add action to toggle inline completions (#16947) 2024-08-27 15:51:57 +02:00
file_finder Fix OpenPathPrompt locally with tilde (#17027) 2024-08-28 14:42:00 -06:00
file_icons chore: Clean up allocs around project panel (#15422) 2024-07-29 14:21:41 +02:00
fs lsp: Watch paths outside of worktrees at language servers request (#17173) 2024-08-31 01:32:33 +02:00
fsevent Retain run loop (#11241) 2024-04-30 23:31:59 -06:00
fuzzy Improve slash commands (#16195) 2024-08-13 23:06:07 -07:00
git Fix git commit popup message bracket (#16279) 2024-08-27 15:18:48 -04:00
git_hosting_providers Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
go_to_line Show correct number of characters selected (#16420) 2024-08-18 02:24:32 +03:00
google_ai Authorize access to language model providers based on country (#15859) 2024-08-06 11:49:04 -04:00
gpui gpui: Fix typo in DefaultThemeAppearance doc comment (#17157) 2024-08-30 09:48:13 -04:00
gpui_macros Use US English spelling of "behavior" and "customize" (#15117) 2024-07-24 16:36:01 -04:00
headless zed: Use CLI env for lang servers, tasks, terminal (#17075) 2024-08-29 18:09:06 +02:00
html_to_markdown Publish html_to_markdown (#13718) 2024-07-01 17:18:58 -04:00
http_client Introduce a separate backend service for LLM calls (#15831) 2024-08-05 20:26:21 -04:00
image_viewer image_viewer: Fix image view tab icon lost (#17063) 2024-08-29 11:51:35 +03:00
indexed_docs indexed_docs: Normalize - in crate names to _ when computing rustdoc output path (#16234) 2024-08-14 12:37:02 -04:00
inline_completion_button inline_completion_button: Do some cleanup (#15849) 2024-08-06 08:55:27 -04:00
install_cli Fix flickering (#9012) 2024-03-11 10:45:57 +01:00
journal Reuse workspace on new journal entry command if possible (#16924) 2024-08-28 21:18:42 -07:00
language Fix - being a word character for selections (#17171) 2024-08-30 12:34:23 -06:00
language_model assistant: Add foundation for receiving tool uses from Anthropic models (#17170) 2024-08-30 14:05:55 -04:00
language_selector Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
language_tools Extract an LspStore object from Project, to prepare for language support over SSH (#17041) 2024-08-30 14:36:38 -07:00
languages Revert "Make selection more consistent across languages (#17084)" (#17175) 2024-08-30 18:01:39 -04:00
live_kit_client live_kit_client: Suppress clippy::arc_with_non_send_sync (#16298) 2024-08-15 11:46:43 -04:00
live_kit_server live_kit_server: Re-remove protocol submodule (#15317) 2024-07-26 21:10:56 -04:00
lsp chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
markdown Fix a panic when diagnostics contain multiple links (#16601) 2024-08-21 11:18:43 -06:00
markdown_preview markdown preview: Detect language of buffer correctly (#15961) 2024-08-08 11:53:37 +02:00
media Update Rust crate bindgen to 0.70.0 (#17024) 2024-08-28 22:12:49 -07:00
menu open picker (#14524) 2024-07-15 17:04:15 -06:00
multi_buffer Fix - being a word character for selections (#17171) 2024-08-30 12:34:23 -06:00
node_runtime windows: Fix extensions couldn't start if the path contained spaces (#15489) 2024-08-28 19:32:15 -07:00
notifications chore: Remove a bunch of unused structs (#16139) 2024-08-13 01:43:19 +02:00
ollama Ollama max_tokens settings (#17025) 2024-08-30 08:52:00 -04:00
open_ai OpenAI: Fix GPT-4. Only include max_tokens when max_output_tokens provided (#17168) 2024-08-30 14:57:50 -04:00
outline Handle buffer diff base updates and file renames properly for SSH projects (#14989) 2024-07-23 11:32:37 -07:00
outline_panel Display buffer/project search entries in the outline panel (#16589) 2024-08-25 21:40:02 +03:00
paths Improve dev experience for built-in prompts (#16413) 2024-08-17 12:28:53 -06:00
performance Add a setting to show time to first window draw and frames per second in status bar (#16422) 2024-08-18 15:22:19 -06:00
picker assistant: Add the "create your command" item (#16467) 2024-08-19 12:29:16 -03:00
prettier Lookup prettier more leniently (#14403) 2024-07-13 21:59:14 +03:00
project lsp: Watch paths outside of worktrees at language servers request (#17173) 2024-08-31 01:32:33 +02:00
project_panel project_panel: Add support for copy/paste between different worktrees (#15396) 2024-08-28 11:35:18 +03:00
project_symbols Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
proto Extract an LspStore object from Project, to prepare for language support over SSH (#17041) 2024-08-30 14:36:38 -07:00
quick_action_bar Improve Linux terminal keymap and context menu (#16845) 2024-08-26 01:01:46 +03:00
recent_projects zed: Use CLI env for lang servers, tasks, terminal (#17075) 2024-08-29 18:09:06 +02: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 Extract an LspStore object from Project, to prepare for language support over SSH (#17041) 2024-08-30 14:36:38 -07:00
remote_server Extract an LspStore object from Project, to prepare for language support over SSH (#17041) 2024-08-30 14:36:38 -07:00
repl repl: Make output buffer be readonly, never dirty (#17121) 2024-08-29 18:22:28 -07:00
rich_text chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
rope Skip over folded regions when iterating over multibuffer chunks (#15646) 2024-08-02 19:51:26 +02:00
rpc Apply rate limits in LLM service (#15997) 2024-08-08 15:46:33 -07:00
search project_search: Add ability to search only for opened files (#16580) 2024-08-28 21:41:29 -06:00
semantic_index Allow customization of the model used for tool calling (#15479) 2024-07-30 16:18:53 +02:00
semantic_version Extract SemanticVersion into its own crate (#9956) 2024-03-29 12:11:57 -04:00
session zed: Persist window stack order across restarts (#15419) 2024-07-29 17:05:56 +02:00
settings Don't rely on relative path for docs preprocessor (#16883) 2024-08-26 11:43:13 -04:00
settings_ui ui: Apply elevation outside SettingsContainer (#15346) 2024-07-27 14:00:03 -04:00
snippet Correct escaping in snippets (#14912) 2024-07-22 00:57:34 +02:00
snippet_provider lsp: Watch paths outside of worktrees at language servers request (#17173) 2024-08-31 01:32:33 +02:00
sqlez Update Rust crate sqlx to 0.8 [SECURITY] (#16791) 2024-08-28 21:08:15 -07:00
sqlez_macros Replace lazy_static with std::sync::LazyLock (#16066) 2024-08-20 14:27:33 -04:00
story story: Remove unneeded lib.name (#17156) 2024-08-30 09:23:45 -04:00
storybook Unify Story/StoryContainers (#17114) 2024-08-29 17:27:01 -04:00
sum_tree Restore "Avoid buffering line content to compute indent guides" (#15284) 2024-07-28 10:52:39 +02:00
supermaven windows: Fix supermaven (#16203) 2024-08-14 17:01:16 +03:00
supermaven_api windows: Fix supermaven (#16203) 2024-08-14 17:01:16 +03:00
tab_switcher Implement "join pane into next" (#16077) 2024-08-27 00:51:51 +03:00
task SSH remoting: terminal & tasks (#15321) 2024-07-28 22:45:00 -06:00
tasks_ui Rename is_local to is_local_or_ssh (#16717) 2024-08-22 21:32:51 -06:00
telemetry_events docs: Update telemetry documentation (#16628) 2024-08-21 20:24:35 -04:00
terminal zed: Use CLI env for lang servers, tasks, terminal (#17075) 2024-08-29 18:09:06 +02:00
terminal_view Update Rust crate itertools to v0.13.0 (#17048) 2024-08-28 22:13:35 -07:00
text assistant: Normalize line endings for prompts loaded from templates (#16808) 2024-08-26 10:34:20 -04:00
theme theme: Fallback to opaque color for title_bar.inactive_background (#16833) 2024-08-26 10:26:47 -04:00
theme_importer Hoist strum to workspace level (#15243) 2024-07-25 21:30:48 -04:00
theme_selector settings_ui: Add theme settings controls (#15115) 2024-07-24 16:25:52 -04:00
time_format Inline git blame (#10398) 2024-04-15 14:21:52 +02:00
title_bar Unify Story/StoryContainers (#17114) 2024-08-29 17:27:01 -04:00
ui Unify Story/StoryContainers (#17114) 2024-08-29 17:27:01 -04:00
ui_input Rename ui_text_field crate to ui_input (#13949) 2024-07-08 17:05:30 -04:00
util chore: Make some of the deps of gpui optional (#16986) 2024-08-28 10:05:50 +02:00
vcs_menu Adjust list item & pickers spacing (#14250) 2024-07-15 10:23:18 -03:00
vim Fix - being a word character for selections (#17171) 2024-08-30 12:34:23 -06:00
welcome zed: Use CLI env for lang servers, tasks, terminal (#17075) 2024-08-29 18:09:06 +02:00
workspace workspace: Fix weird behavior when save replaces the existing open file (#17123) 2024-08-30 15:12:42 +02:00
worktree lsp: Watch paths outside of worktrees at language servers request (#17173) 2024-08-31 01:32:33 +02:00
zed lsp: Watch paths outside of worktrees at language servers request (#17173) 2024-08-31 01:32:33 +02:00
zed_actions Improve Linux terminal keymap and context menu (#16845) 2024-08-26 01:01:46 +03:00