{"record":{"id":"fd458193239e69c3","repo":"zed-industries/zed","slug":"cannot-expand-emmet-abbreviations-with-the-serv","errorCode":null,"errorMessage":"cannot expand Emmet abbreviations with the {} server","messagePattern":"cannot expand Emmet abbreviations with the (.+?) server","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/project/src/lsp_store/emmet_ext.rs","lineNumber":95,"sourceCode":"        \"Expand Emmet abbreviation\"\n    }\n\n    fn check_capabilities(&self, _: AdapterServerCapabilities) -> bool {\n        true\n    }\n\n    fn language_server_to_query(&self) -> LanguageServerToQuery {\n        LanguageServerToQuery::Other(self.server_id)\n    }\n\n    fn to_lsp(\n        &self,\n        _: &Path,\n        _: &Buffer,\n        server: &Arc<LanguageServer>,\n        _: &App,\n    ) -> Result<ExpandAbbreviationParams> {\n        anyhow::ensure!(\n            server.name() == EMMET_SERVER_NAME,\n            \"cannot expand Emmet abbreviations with the {} server\",\n            server.name()\n        );\n        let multiline = self.text.as_ref().is_some_and(|text| text.len() > 1);\n        Ok(ExpandAbbreviationParams {\n            abbreviation: self.abbreviation.clone(),\n            language: self.language.clone(),\n            options: ExpandAbbreviationOptions {\n                text: self.text.clone(),\n                options: EmmetOutputOptions {\n                    indent: self.indent.clone(),\n                    base_indent: self.base_indent.clone(),\n                    comment_enabled: self.comment_filter.then_some(true),\n                    bem_enabled: self.bem_filter.then_some(true),\n                    inline_break: multiline.then_some(1),\n                },\n            },","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/project/src/lsp_store/emmet_ext.rs#L77-L113","documentation":"Precondition check (anyhow::ensure!) in to_lsp for the ExpandAbbreviation action: it fires when the request is routed to a language server whose name is not the Emmet server. Only the dedicated Emmet language server supports abbreviation expansion, so dispatching to any other server (e.g. a regular LSP like typescript-language-server) fails here with the offending server's name interpolated into the message.","triggerScenarios":"Thrown at crates/project/src/lsp_store/emmet_ext.rs:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the Emmet extension/server is installed and running so the action is dispatched to a server named 'emmet-language-server'","Check language server configuration to make sure Emmet is enabled for the relevant file type and other servers don't intercept the expansion request","Verify the server name returned by server.name() matches the expected EMMET_SERVER_NAME constant"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-09-05T10:33:00.413Z","contentChangedAt":"2026-09-05T10:33:00.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}