Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ 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`
- enumerate all files with a `.json` extension in the Gist
- 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

Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -83,7 +83,7 @@ Another approach could be swapping the keymap entries for <kbd>zed: open setting

## Troubleshooting

- Open LSP logs (<kbd>dev: open language server logs</kbd>), find `settings_sync` LSP server instance running for the specific settings file, and inspect its log
- Open LSP logs (<kbd>dev: open language server logs</kbd>), 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
Expand Down
4 changes: 2 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
18 changes: 9 additions & 9 deletions common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)?;
Expand Down Expand Up @@ -144,7 +144,7 @@ mod tests {
r#"
{
"lsp": {
"settings_sync": {
"settings-sync": {
"initialization_options": {
"github_token": "your_github_token",
"gist_id": "your_gist_id"
Expand Down Expand Up @@ -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(())
Expand All @@ -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(())
Expand All @@ -222,7 +222,7 @@ mod tests {
r#"
{
"lsp": {
"settings_sync": {}
"settings-sync": {}
}
}"#,
)?;
Expand All @@ -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(())
Expand All @@ -243,7 +243,7 @@ mod tests {
r#"
{
"lsp": {
"settings_sync": {
"settings-sync": {
"initialization_options": {}
}
}
Expand All @@ -263,7 +263,7 @@ mod tests {
r#"
{
"lsp": {
"settings_sync": {
"settings-sync": {
"initialization_options": {
"gist_id": "1234567890abcdef"
}
Expand Down
6 changes: 3 additions & 3 deletions common/src/sync/client/github_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions extension.toml
Original file line number Diff line number Diff line change
@@ -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 <post.vittorius@gmail.com>"]
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"
4 changes: 2 additions & 2 deletions lsp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down