Prepare to sync other kinds of settings (#18616)

This PR does not change how things work for settings, but lays the
ground work for the future functionality.
After this change, Zed is prepared to sync more than just
`settings.json` files from local worktree and user config.

* ssh tasks

Part of this work is to streamline the task sync mechanism.
Instead of having an extra set of requests to fetch the task contents
from the server (as remote-via-collab does now and does not cover all
sync cases), we want to reuse the existing mechanism for synchronizing
user and local settings.

* editorconfig

Part of the task is to sync .editorconfig file changes to everyone which
involves sending and storing those configs.


Both ssh (and remove-over-collab) .zed/tasks.json and .editorconfig
files behave similar to .zed/settings.json local files: they belong to a
certain path in a certain worktree; may update over time, changing Zed's
functionality; can be merged hierarchically.
Settings sync follows the same "config file changed -> send to watchers
-> parse and merge locally and on watchers" path that's needed for both
new kinds of files, ergo the messaging layer is extended to send more
types of settings for future watch & parse and merge impls to follow.

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2024-10-02 22:00:40 +03:00 committed by GitHub
parent 7c4615519b
commit 778dedec6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 221 additions and 73 deletions

View file

@ -642,6 +642,13 @@ message UpdateWorktreeSettings {
uint64 worktree_id = 2;
string path = 3;
optional string content = 4;
optional LocalSettingsKind kind = 5;
}
enum LocalSettingsKind {
Settings = 0;
Tasks = 1;
Editorconfig = 2;
}
message CreateProjectEntry {
@ -2487,6 +2494,12 @@ message AddWorktreeResponse {
message UpdateUserSettings {
uint64 project_id = 1;
string content = 2;
optional Kind kind = 3;
enum Kind {
Settings = 0;
Tasks = 1;
}
}
message CheckFileExists {