{"record":{"id":"9860dfb4d1015aab","repo":"zed-industries/zed","slug":"cannot-format-prettier-is-not-allowed-for-languag","errorCode":null,"errorMessage":"Cannot format: prettier is not allowed for language {buffer_language:?}","messagePattern":"Cannot format: prettier is not allowed for language (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/prettier/src/prettier.rs","lineNumber":364,"sourceCode":"    }\n\n    pub async fn format(\n        &self,\n        buffer: &Entity<Buffer>,\n        buffer_path: Option<PathBuf>,\n        ignore_dir: Option<PathBuf>,\n        range_utf16: Option<Range<OffsetUtf16>>,\n        request_timeout: Duration,\n        cx: &mut AsyncApp,\n    ) -> anyhow::Result<Diff> {\n        match self {\n            Self::Real(local) => {\n                let params = buffer\n                    .update(cx, |buffer, cx| {\n                        let buffer_language = buffer.language().map(|language| language.as_ref());\n                        let language_settings = LanguageSettings::for_buffer(&buffer, cx);\n                        let prettier_settings = &language_settings.prettier;\n                        anyhow::ensure!(\n                            prettier_settings.allowed,\n                            \"Cannot format: prettier is not allowed for language {buffer_language:?}\"\n                        );\n                        let prettier_node_modules = self.prettier_dir().join(\"node_modules\");\n                        anyhow::ensure!(\n                            prettier_node_modules.is_dir(),\n                            \"Prettier node_modules dir does not exist: {prettier_node_modules:?}\"\n                        );\n                        let plugin_name_into_path = |plugin_name: &str| {\n                            let prettier_plugin_dir = prettier_node_modules.join(plugin_name);\n                            [\n                                prettier_plugin_dir.join(\"dist\").join(\"index.mjs\"),\n                                prettier_plugin_dir.join(\"dist\").join(\"index.js\"),\n                                prettier_plugin_dir.join(\"dist\").join(\"plugin.js\"),\n                                prettier_plugin_dir.join(\"src\").join(\"plugin.js\"),\n                                prettier_plugin_dir.join(\"lib\").join(\"index.js\"),\n                                prettier_plugin_dir.join(\"index.mjs\"),\n                                prettier_plugin_dir.join(\"index.js\"),","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/prettier/src/prettier.rs#L346-L382","documentation":"The buffer's language resolved to one for which prettier formatting is explicitly disallowed by configuration/registry, so format() refuses before building params. This is a policy guard: the language is recognized but prettier is not an allowed formatter for it.","triggerScenarios":"Thrown at crates/prettier/src/prettier.rs:364 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the language's native formatter instead of prettier for this file type","If prettier should be allowed, adjust the language settings that gate prettier availability"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}