1use zed_extension_api::{self as zed, Result};
2
3pub struct Rubocop {}
4
5impl Rubocop {
6 pub const LANGUAGE_SERVER_ID: &'static str = "rubocop";
7
8 pub fn new() -> Self {
9 Self {}
10 }
11
12 pub fn server_script_path(&mut self, worktree: &zed::Worktree) -> Result<String> {
13 let path = worktree.which("rubocop").ok_or_else(|| {
14 "rubocop must be installed manually. Install it with `gem install rubocop` or specify the 'binary' path to it via local settings.".to_string()
15 })?;
16
17 Ok(path)
18 }
19}