{"record":{"id":"e3f95a03236e04f8","repo":"BoundaryML/baml","slug":"internalerror-e3f95a","errorCode":"InternalError","errorMessage":"File {} was not present in the project","messagePattern":"File (.+?) was not present in the project","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_server/src/server/api/requests/hover.rs","lineNumber":44,"sourceCode":"        notifier: Notifier,\n        _requester: &mut Requester,\n        params: HoverParams,\n    ) -> Result<Option<types::Hover>> {\n        let url = &params.text_document_position_params.text_document.uri;\n        let path = url\n            .to_file_path()\n            .internal_error_msg(\"Could not convert URL to path\")?;\n        let Ok(project) = session.get_or_create_project(&path) else {\n            return Ok(None);\n        };\n\n        let document_key =\n            DocumentKey::from_url(project.lock().root_path(), url).internal_error()?;\n\n        let text_document_item = match project.lock().baml_project.files.get(&document_key) {\n            None => {\n                tracing::warn!(\"*** HOVER: Failed to find doc {:?}\", url);\n                Err(anyhow::anyhow!(\n                    \"File {} was not present in the project\",\n                    url\n                ))\n            }\n            Some(text_document) => Ok(TextDocumentItem {\n                uri: url.clone(),\n                language_id: \"BAML\".to_string(),\n                text: text_document.contents.clone(),\n                version: 1,\n            }),\n        }\n        .internal_error()?;\n        let position = params.text_document_position_params.position;\n        // Just swallow the error here, we dont want hover failures to show error notifs for a user.\n        let default_flags = vec![\"beta\".to_string()];\n        let hover = match project.lock().handle_hover_request(\n            &text_document_item,\n            &position,","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_server/src/server/api/requests/hover.rs#L26-L62","documentation":"The hover request handler converts the request URL to a DocumentKey and then looks it up in `baml_project.files`. If the document is absent from the project's file map, hover cannot proceed and this InternalError is raised after logging a warning. Same family as 1557 but for the hover request.","triggerScenarios":"textDocument/hover on a file whose DocumentKey is not present in `baml_project.files` — file outside baml_src, never opened/indexed, or hover fired before project load completed.","commonSituations":"Hovering over identifiers in a non-BAML or untracked file; hovering immediately after opening a workspace before indexing finishes; baml_src misconfiguration excluding the file.","solutions":["Ensure the file is inside baml_src and recognized as a .baml source.","Open/save the file so the server indexes it, then retry hover.","Wait for the project's initial load to complete before hovering.","Restart the language server if the in-memory file map is out of sync with disk."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Only hover in tracked .baml files inside baml_src\nif !url.as_str().contains(\"/baml_src/\") || !url.as_str().ends_with(\".baml\") {\n    return;\n}","typeGuard":null,"tryCatchPattern":"let doc = match project.lock().baml_project.files.get(&document_key) {\n    Some(d) => d,\n    None => return Ok(None), // untracked file: skip hover quietly\n};","preventionTips":["Keep hover targets inside baml_src .baml files.","Wait for the initial project index before hovering.","Restart the server if the file map drifts from disk."],"tags":["lsp","hover","file-not-found","baml"],"backgroundTag":"resource-not-found","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}