zed icon indicating copy to clipboard operation
zed copied to clipboard

The copilot button is shown in Zed Preview 0.133.1 even it is disabled

Open failable opened this issue 1 year ago • 1 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

After upgrading to Zed Preview 0.133.1, the copilot button is shown in even it is disabled. This does not happen before upgrading.

Environment

Zed: v0.133.1 (Zed Preview) OS: macOS 14.4.1 Memory: 32 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

failable avatar Apr 25 '24 00:04 failable

The issue seems only happen when "languages" setting key exists.

failable avatar Apr 25 '24 00:04 failable

Cannot reproduce this, even when the "languages" key exists, could you share the specific "languages" settings you are using?

bennetbo avatar Apr 29 '24 10:04 bennetbo

@bennetbo Here you go.

  "languages": {
    "Python": {
      // "language_servers": ["pylsp", "!pyright"]
    }
  },
image

failable avatar Apr 29 '24 10:04 failable

Thanks, but still cannot reproduce, I tested on preview 0.133.3

image

Settings:

"features": {
    "copilot": false
  },
  "languages": {
    "Python": {
      // "language_servers": ["pylsp", "!pyright"]
    }
  }

How are you trying to disable copilot?

bennetbo avatar Apr 29 '24 10:04 bennetbo

By:

  "features": {
    "copilot": false
  },

And I am on Zed Preview 0.133.3 (f6c7d033579c4359ccb7d62f8130d0753e605273), the issue is still there.

failable avatar Apr 29 '24 10:04 failable

My whole config here

```json // Zed settings // // For information on how to configure Zed, see the Zed // documentation: https://zed.dev/docs/configuring-zed // // To see all of Zed's default settings without changing your // custom settings, run the `open default settings` command // from the command palette or from `Zed` application menu. { "show_wrap_guides": false, "projects_online_by_default": false, "theme": "One Light", "ui_font_size": 15, "buffer_font_family": "DM Mono", "buffer_font_size": 12, "buffer_line_height": "standard", "default_dock_anchor": "expanded", "cursor_blink": false, "confirm_quit": true, "always_treat_brackets_as_autoclosed": true, "show_completion_documentation": false, "hover_popover_enabled": false, "extend_comment_on_newline": false, "features": { "copilot": false }, "tabs": { "close_position": "left" }, "inlay_hints": { "enabled": false }, "collaboration_panel": { "button": false }, "chat_panel": { "button": false }, "notification_panel": { "button": false }, "assistant": { "version": "1", "button": false, "default_width": 360 }, "gutter": { "line_numbers": false, "code_actions": false, "folds": false }, "toolbar": { "breadcrumbs": false, "quick_actions": false },

"tab_bar": { "show_nav_history_buttons": false }, "task": { "show_status_indicator": false }, "git": { "inline_blame": { "enabled": false }, "git_gutter": "tracked_files" }, "project_panel": { "indent_size": 8, "button": false }, "scrollbar": { "show": "never" }, "calls": { "mute_on_join": true, "share_on_join": false }, "journal": { "hour_format": "hour24" }, // "languages": { // "Python": { // "language_servers": ["pylsp", "!pyright"] // } // }, "language_overrides": { "Python": { "format_on_save": "on", "formatter": { "external": { "command": "pyformat", "arguments": ["-"] } } } }, "lsp": { "rust-analyzer": { "initialization_options": { "checkOnSave": { "command": "clippy" }, "completion": { "snippets": { "custom": { "tokio::main": { "prefix": ["main_tokio"], "body": ["#[tokio::main]", "async fn main() {", "\t$0", "}"], "scope": "item" }, "todo!": { "prefix": ["t"], "body": ["todo!()$0"], "scope": "expr" }, "unimplemented!": { "prefix": ["u"], "body": ["unimplemented!()$0"], "scope": "expr" }, "vec!": { "prefix": ["v"], "body": ["vec![$0]"], "scope": "expr" }, "format!": { "prefix": ["f"], "body": ["format!("{}", $0);"], "scope": "expr" }, "write!": { "prefix": ["w"], "body": ["write!("{}", $0);"], "scope": "expr" }, "writeln!": { "prefix": ["wl"], "body": ["writeln!("{}", $0);"], "scope": "expr" }, "println!": { "prefix": ["p"], "body": ["println!("{}", $0);"], "scope": "expr" }, "println! (debug)": { "prefix": ["dp"], "body": ["println!("{:?}", $0);"], "scope": "expr" }, "println! (pretty)": { "prefix": ["dpp"], "body": ["println!("{:#?}", $0);"], "scope": "expr" }, "thread::spawn": { "prefix": ["spawn"], "body": ["thread::spawn(move || {", "\t$0", "});"], "requires": "std::thread", "scope": "expr" }, "AsRef<Path>": { "prefix": ["ap"], "body": ["AsRef<Path>$0"], "requires": "std::path::Path", "scope": "expr" }, "derive": { "prefix": ["d"], "body": ["#[derive(Clone, Debug, Default)]$0"], "scope": "item" }, "derive (serde)": { "prefix": ["ds"], "body": ["#[derive(Serialize, Deserialize)]$0"], "requires": ["serde::Serialize", "serde::Deserialize"], "scope": "item" }, "thiserror": { "prefix": ["te"], "body": [ "#[derive(Error, Debug)]", "pub enum ${1:Error} {", "\t$0", "}" ], "requires": "thiserror::Error", "scope": "item" } // "thiserror error": { // "prefix": [ // "e" // ], // "body": [ // "#[error("$0")]" // ], // "scope": "item" // } } } } } } }, "terminal": { "button": false, "blinking": "off", "line_height": "standard", "env": { "EDITOR": "zed --wait" } }, "telemetry": { "diagnostics": false, "metrics": false }, // // Fleet Light // "experimental.theme_overrides": { // "text.accent": "#a31d8d" // } // One Light "experimental.theme_overrides": { "status_bar.background": "#fafafa", "title_bar.background": "#fafafa", "tab_bar.background": "#f6f6f6", "tab.inactive_background": "#f6f6f6", "panel.background": "#fafafa", "border": "#ebebeb", "hint": "#bbbbbb", "editor.active_line.background": "#aaaaaa0f", "ghost_element.selected": "#f1f1f1", "ghost_element.hover": "#eaeaea", "ghost_element.active": "#dadada", "warning": "#ffa54fcc", "background": "#fafafa", "text": "#454545", "text.muted": "#aeaeae", "elevated_surface.background": "#f6f6f6", "border.variant": "#eaeaea", "modified": "#eac351" // "modified": "#f9d978" } // // Xcode // "experimental.theme_overrides": { // "status_bar.background": "#fdfdfd", // "title_bar.background": "#fdfdfd", // "tab_bar.background": "#fafafa", // "tab.inactive_background": "#fdfdfd", // "panel.background": "#fefefe", // "border": "#f0f0f0", // "hint": "#cdcdcd" // } }

</details>

failable avatar Apr 29 '24 10:04 failable

Looks like you have a syntax error in your settings, that is why zed is not picking up the copilot configuration correctly.

You need to escape " in your rust snippets:

Correct: "body": ["write!(\"{}\", $0);"], Incorrect: "body": ["write!("{}", $0);"],

bennetbo avatar Apr 29 '24 10:04 bennetbo

With the fixes mentioned above it works perfectly, I am gonna close this. If it's still not working for you feel free to reopen.

Fixed settings:

// Zed settings // // For information on how to configure Zed, see the Zed // documentation: https://zed.dev/docs/configuring-zed // // To see all of Zed's default settings without changing your // custom settings, run the `open default settings` command // from the command palette or from `Zed` application menu.
{
  "show_wrap_guides": false,
  "projects_online_by_default": false,
  "theme": "One Light",
  "ui_font_size": 15,
  "buffer_font_size": 12,
  "buffer_line_height": "standard",
  "default_dock_anchor": "expanded",
  "cursor_blink": false,
  "confirm_quit": true,
  "always_treat_brackets_as_autoclosed": true,
  "show_completion_documentation": false,
  "hover_popover_enabled": false,
  "extend_comment_on_newline": false,
  "features": { "copilot": false },
  "tabs": { "close_position": "left" },
  "inlay_hints": { "enabled": false },
  "collaboration_panel": { "button": false },
  "chat_panel": { "button": false },
  "notification_panel": { "button": false },
  "assistant": { "version": "1", "button": false, "default_width": 360 },
  "gutter": { "line_numbers": false, "code_actions": false, "folds": false },
  "toolbar": { "breadcrumbs": false, "quick_actions": false },
  "tab_bar": {
    "show_nav_history_buttons": false
  },
  "task": {
    "show_status_indicator": false
  },
  "git": {
    "inline_blame": {
      "enabled": false
    },
    "git_gutter": "tracked_files"
  },
  "project_panel": {
    "indent_size": 8,
    "button": false
  },
  "scrollbar": {
    "show": "never"
  },
  "calls": {
    "mute_on_join": true,
    "share_on_join": false
  },
  "journal": {
    "hour_format": "hour24"
  },
  // "languages": {
  // "Python": {
  // "language_servers": ["pylsp", "!pyright"]
  // }
  // },
  "language_overrides": {
    "Python": {
      "format_on_save": "on",
      "formatter": {
        "external": {
          "command": "pyformat",
          "arguments": ["-"]
        }
      }
    }
  },
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "checkOnSave": {
          "command": "clippy"
        },
        "completion": {
          "snippets": {
            "custom": {
              "tokio::main": {
                "prefix": ["main_tokio"],
                "body": ["#[tokio::main]", "async fn main() {", "\t$0", "}"],
                "scope": "item"
              },
              "todo!": {
                "prefix": ["t"],
                "body": ["todo!()$0"],
                "scope": "expr"
              },
              "unimplemented!": {
                "prefix": ["u"],
                "body": ["unimplemented!()$0"],
                "scope": "expr"
              },
              "vec!": {
                "prefix": ["v"],
                "body": ["vec![$0]"],
                "scope": "expr"
              },
              "format!": {
                "prefix": ["f"],
                "body": ["format!(\"{}\", $0);"],
                "scope": "expr"
              },
              "write!": {
                "prefix": ["w"],
                "body": ["write!(\"{}\", $0);"],
                "scope": "expr"
              },
              "writeln!": {
                "prefix": ["wl"],
                "body": ["writeln!(\"{}\", $0);"],
                "scope": "expr"
              },
              "println!": {
                "prefix": ["p"],
                "body": ["println!(\"{}\", $0);"],
                "scope": "expr"
              },
              "println! (debug)": {
                "prefix": ["dp"],
                "body": ["println!(\"{:?}\", $0);"],
                "scope": "expr"
              },
              "println! (pretty)": {
                "prefix": ["dpp"],
                "body": ["println!(\"{:#?}\", $0);"],
                "scope": "expr"
              },
              "thread::spawn": {
                "prefix": ["spawn"],
                "body": ["thread::spawn(move || {", "\t$0", "});"],
                "requires": "std::thread",
                "scope": "expr"
              },
              "AsRef": {
                "prefix": ["ap"],
                "body": ["AsRef$0"],
                "requires": "std::path::Path",
                "scope": "expr"
              },
              "derive": {
                "prefix": ["d"],
                "body": ["#[derive(Clone, Debug, Default)]$0"],
                "scope": "item"
              },
              "derive (serde)": {
                "prefix": ["ds"],
                "body": ["#[derive(Serialize, Deserialize)]$0"],
                "requires": ["serde::Serialize", "serde::Deserialize"],
                "scope": "item"
              },
              "thiserror": {
                "prefix": ["te"],
                "body": [
                  "#[derive(Error, Debug)]",
                  "pub enum ${1:Error} {",
                  "\t$0",
                  "}"
                ],
                "requires": "thiserror::Error",
                "scope": "item"
              }
              // "thiserror error": {
              // "prefix": [
              // "e"
              // ],
              // "body": [
              // "#[error("$0")]"
              // ],
              // "scope": "item"
              // }
            }
          }
        }
      }
    }
  },
  "terminal": {
    "button": false,
    "blinking": "off",
    "line_height": "standard",
    "env": {
      "EDITOR": "zed --wait"
    }
  },
  "telemetry": {
    "diagnostics": false,
    "metrics": false
  },
  // // Fleet Light
  // "experimental.theme_overrides": {
  // "text.accent": "#a31d8d"
  // }
  // One Light
  "experimental.theme_overrides": {
    "status_bar.background": "#fafafa",
    "title_bar.background": "#fafafa",
    "tab_bar.background": "#f6f6f6",
    "tab.inactive_background": "#f6f6f6",
    "panel.background": "#fafafa",
    "border": "#ebebeb",
    "hint": "#bbbbbb",
    "editor.active_line.background": "#aaaaaa0f",
    "ghost_element.selected": "#f1f1f1",
    "ghost_element.hover": "#eaeaea",
    "ghost_element.active": "#dadada",
    "warning": "#ffa54fcc",
    "background": "#fafafa",
    "text": "#454545",
    "text.muted": "#aeaeae",
    "elevated_surface.background": "#f6f6f6",
    "border.variant": "#eaeaea",
    "modified": "#eac351"
    // "modified": "#f9d978"
  }
  // // Xcode
  // "experimental.theme_overrides": {
  // "status_bar.background": "#fdfdfd",
  // "title_bar.background": "#fdfdfd",
  // "tab_bar.background": "#fafafa",
  // "tab.inactive_background": "#fdfdfd",
  // "panel.background": "#fefefe",
  // "border": "#f0f0f0",
  // "hint": "#cdcdcd"
  // }
}

bennetbo avatar Apr 29 '24 10:04 bennetbo

I have that in my config. Maybe that is some copy-paste issue of Github. I put it https://pastebin.com/TKU1vBaQ

image

failable avatar Apr 29 '24 10:04 failable

I don't have the reopen button...

image

failable avatar Apr 29 '24 10:04 failable

Well, again the settings from pastebin work perfectly for me, not sure what's causing this then. Do you have any local settings in a .zed folder, specified in your project?

bennetbo avatar Apr 29 '24 10:04 bennetbo

Minimal test config:

// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
  "features": {
    "copilot": false
  },
  "languages": {
    "Python": {
      "language_servers": ["pylsp", "!pyright"]
    }
  },
  "language_overrides": {
    "Python": {
      "format_on_save": "on",
      "formatter": {
        "external": {
          "command": "pyformat",
          "arguments": ["-"]
        }
      }
    }
  }
}
image

failable avatar Apr 29 '24 10:04 failable

Do you have any local settings in a .zed folder, specified in your project?

No, I don't. I have never used local configs in Zed.

The issue does not exist by removing either "languages" or "language_overrides".

failable avatar Apr 29 '24 10:04 failable

Can reproduce this now, not sure why it was working for me before. It seems like this is not only related to copilot though, as I can reproduce it for other settings that hide some kind of button, weird. Thanks for all the info, will take a look shortly!

bennetbo avatar Apr 29 '24 10:04 bennetbo

Im not really familiar with all the settings, but debugging this now I can see that zed is complaining that you defined "languages" multiple times, because "language_overrides" is only an alias for "languages". Seems like "language_overrides" was renamed to "languages" at some point. Merging the two settings together into a single value makes the copilot button disappear:

"languages": {
    "Python": {
      "format_on_save": "on",
      "formatter": {
        "external": {
          "command": "pyformat",
          "arguments": ["-"]
        }
      },
      "language_servers": ["pylsp", "!pyright"]
    }
  }

bennetbo avatar Apr 29 '24 10:04 bennetbo

Thanks, that seems to be the cause. The documentation somehow need to be fixed though.

failable avatar Apr 29 '24 12:04 failable