prettier.rs

 1pub use std::path::{Path, PathBuf};
 2pub use std::sync::Arc;
 3
 4use fs::Fs;
 5use gpui::ModelHandle;
 6use language::{Buffer, Diff};
 7
 8pub struct Prettier {
 9    _private: (),
10}
11
12type NodeRuntime = ();
13
14impl Prettier {
15    // This was taken from the prettier-vscode extension.
16    pub const CONFIG_FILE_NAMES: &'static [&'static str] = &[
17        ".prettierrc",
18        ".prettierrc.json",
19        ".prettierrc.json5",
20        ".prettierrc.yaml",
21        ".prettierrc.yml",
22        ".prettierrc.toml",
23        ".prettierrc.js",
24        ".prettierrc.cjs",
25        "package.json",
26        "prettier.config.js",
27        "prettier.config.cjs",
28        ".editorconfig",
29    ];
30
31    pub async fn locate(starting_path: Option<&Path>, fs: Arc<dyn Fs>) -> PathBuf {
32        todo!()
33    }
34
35    pub async fn start(prettier_path: &Path, node: Arc<NodeRuntime>) -> anyhow::Result<Self> {
36        todo!()
37    }
38
39    pub async fn format(&self, buffer: &ModelHandle<Buffer>) -> anyhow::Result<Diff> {
40        todo!()
41    }
42
43    pub async fn clear_cache(&self) -> anyhow::Result<()> {
44        todo!()
45    }
46}