diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index c2979d7..68a54b2 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -40,7 +40,7 @@ On any command that requires interaction with Github: - use the Zed user-level `settings.json` file - check if it's present; if not, exit with an error message - - attempt to deserialize the config file into the same Config struct that is used in the LSP server backend ("/lsp/settings_sync/initialization_options" json path) + - attempt to deserialize the config file into the same Config struct that is used in the LSP server backend ("/lsp/settings-sync/initialization_options" json path) - Commands: - `load` @@ -48,7 +48,7 @@ On any command that requires interaction with Github: - load them from the Gist and store under the user settings dir (Zed's `paths` crate) - if the file being loaded exists, ask a confirmation to overwrite it - `-f/--force` option to overwrite without any confirmation - - if a file is `settings.json` file, then overwrite "/lsp/settings_sync/initialization_options/github_token" JSON path in it with the current value of this node from the config file + - if a file is `settings.json` file, then overwrite "/lsp/settings-sync/initialization_options/github_token" JSON path in it with the current value of this node from the config file - `help` - help message generated by Clap diff --git a/Cargo.lock b/Cargo.lock index e05cc30..cbb1c8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4135,14 +4135,14 @@ dependencies = [ [[package]] name = "zed-settings-sync" -version = "0.0.1-alpha.5" +version = "0.0.1-alpha.6" dependencies = [ "zed_extension_api", ] [[package]] name = "zed-settings-sync-cli" -version = "0.0.1-alpha.5" +version = "0.0.1-alpha.6" dependencies = [ "anyhow", "assert_fs", @@ -4160,7 +4160,7 @@ dependencies = [ [[package]] name = "zed-settings-sync-lsp" -version = "0.0.1-alpha.5" +version = "0.0.1-alpha.6" dependencies = [ "anyhow", "assert_fs", diff --git a/Cargo.toml b/Cargo.toml index d681748..069b316 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zed-settings-sync" description = "A Zed editor extension for syncing settings files to a remote storage (currently, GitHub)" -version = "0.0.1-alpha.5" +version = "0.0.1-alpha.6" edition = "2024" license-file = "LICENSE.txt" repository = "https://github.com/vittorius/zed-settings-sync" diff --git a/README.md b/README.md index dbc9df1..002797b 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Until then, you can use the [dev installation mode](#dev-extension-installation) ```jsonc { "lsp": { - "settings_sync": { + "settings-sync": { "initialization_options": { "github_token": "gho_my-shiny-token", "gist_id": "deadbeefdeadbeefdeadbeefdeadbeef" @@ -83,7 +83,7 @@ Another approach could be swapping the keymap entries for zed: open setting ## Troubleshooting -- Open LSP logs (dev: open language server logs), find `settings_sync` LSP server instance running for the specific settings file, and inspect its log +- Open LSP logs (dev: open language server logs), find `settings-sync` LSP server instance running for the specific settings file, and inspect its log - File an [issue](https://github.com/vittorius/zed-settings-sync/issues/new) on Github ## Development diff --git a/cli/Cargo.toml b/cli/Cargo.toml index fa18030..165cf4d 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zed-settings-sync-cli" -description = "A CLI tool for Zed editor settings_sync extension" -version = "0.0.1-alpha.5" +description = "A CLI tool for Zed editor settings-sync extension" +version = "0.0.1-alpha.6" edition = "2024" [lints] diff --git a/common/src/config.rs b/common/src/config.rs index 608a131..842c127 100644 --- a/common/src/config.rs +++ b/common/src/config.rs @@ -48,9 +48,9 @@ impl Config { .ok_or(anyhow!("Settings file is empty"))?; let config = from_value( zed_settings - .pointer("/lsp/settings_sync/initialization_options") // TODO: make this pointer key shared among crates of this package + .pointer("/lsp/settings-sync/initialization_options") // TODO: make this pointer key shared among crates of this package .ok_or(anyhow!( - "Missing lsp.settings_sync.initialization_options key in settings tree" + "Missing lsp.settings-sync.initialization_options key in settings tree" ))? .clone(), )?; @@ -144,7 +144,7 @@ mod tests { r#" { "lsp": { - "settings_sync": { + "settings-sync": { "initialization_options": { "github_token": "your_github_token", "gist_id": "your_gist_id" @@ -195,7 +195,7 @@ mod tests { assert_eq!( config.unwrap_err().to_string(), - "Missing lsp.settings_sync.initialization_options key in settings tree" + "Missing lsp.settings-sync.initialization_options key in settings tree" ); Ok(()) @@ -209,7 +209,7 @@ mod tests { assert_eq!( config.unwrap_err().to_string(), - "Missing lsp.settings_sync.initialization_options key in settings tree" + "Missing lsp.settings-sync.initialization_options key in settings tree" ); Ok(()) @@ -222,7 +222,7 @@ mod tests { r#" { "lsp": { - "settings_sync": {} + "settings-sync": {} } }"#, )?; @@ -231,7 +231,7 @@ mod tests { assert_eq!( config.unwrap_err().to_string(), - "Missing lsp.settings_sync.initialization_options key in settings tree" + "Missing lsp.settings-sync.initialization_options key in settings tree" ); Ok(()) @@ -243,7 +243,7 @@ mod tests { r#" { "lsp": { - "settings_sync": { + "settings-sync": { "initialization_options": {} } } @@ -263,7 +263,7 @@ mod tests { r#" { "lsp": { - "settings_sync": { + "settings-sync": { "initialization_options": { "gist_id": "1234567890abcdef" } diff --git a/common/src/sync/client/github_client.rs b/common/src/sync/client/github_client.rs index cd7f4b8..adec351 100644 --- a/common/src/sync/client/github_client.rs +++ b/common/src/sync/client/github_client.rs @@ -144,13 +144,13 @@ fn set_github_token_config_value(root: &CstRootNode, value: String) -> Result<() .ok_or(Error::InvalidConfig( r#"Missing "lsp" configuration object"#.to_string(), ))? - .get("settings_sync") + .get("settings-sync") .ok_or(Error::InvalidConfig( - r#"Missing "settings_sync" key"#.to_string(), + r#"Missing "settings-sync" key"#.to_string(), ))? .object_value() .ok_or(Error::InvalidConfig( - r#"Missing "settings_sync" configuration object"#.to_string(), + r#"Missing "settings-sync" configuration object"#.to_string(), ))? .get("initialization_options") .ok_or(Error::InvalidConfig( diff --git a/extension.toml b/extension.toml index 586dbc4..a24d3c9 100644 --- a/extension.toml +++ b/extension.toml @@ -1,15 +1,15 @@ id = "settings-sync" name = "Settings Sync" -version = "0.0.1-alpha.5" +version = "0.0.1-alpha.6" schema_version = 1 authors = ["Viktor Zahorodnii "] description = "Never again be afraid of losing your precious Zed configuration" repository = "https://github.com/vittorius/zed-settings-sync" -[language_servers.settings_sync] +[language_servers.settings-sync] name = "Settings Sync LSP" languages = ["JSON", "JSONC"] -[language_servers.settings_sync.language_ids] +[language_servers.settings-sync.language_ids] "JSON" = "json" "JSONC" = "jsonc" diff --git a/lsp/Cargo.toml b/lsp/Cargo.toml index 9e0d479..96920f0 100644 --- a/lsp/Cargo.toml +++ b/lsp/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zed-settings-sync-lsp" -description = "An LSP server for Zed editor settings_sync extension" -version = "0.0.1-alpha.5" +description = "An LSP server for Zed editor settings-sync extension" +version = "0.0.1-alpha.6" edition = "2024" [lints]