Build hover content for `{{ }}` (escaped echo via `e()`).
(&self, start: Position, len: u32)
| 176 | |
| 177 | /// Build hover content for `{{ }}` (escaped echo via `e()`). |
| 178 | fn blade_e_hover(&self, start: Position, len: u32) -> Hover { |
| 179 | // Try to resolve the actual `e()` function from the project/stubs. |
| 180 | let empty_use_map = std::collections::HashMap::new(); |
| 181 | let loader = self.function_loader_with(&empty_use_map, &None); |
| 182 | let content = if let Some(func) = loader("e") { |
| 183 | crate::hover::hover_for_function(&func, None).contents |
| 184 | } else { |
| 185 | HoverContents::Markup(MarkupContent { |
| 186 | kind: MarkupKind::Markdown, |
| 187 | value: "Blade escaped echo. Output is passed through `e()` (`htmlspecialchars`).\n\n\ |
| 188 | ```php\n<?php\nfunction e(mixed $value, bool $doubleEncode = true): string;\n```" |
| 189 | .to_string(), |
| 190 | }) |
| 191 | }; |
| 192 | Hover { |
| 193 | contents: content, |
| 194 | range: Some(Range { |
| 195 | start, |
| 196 | end: Position { |
| 197 | line: start.line, |
| 198 | character: start.character + len, |
| 199 | }, |
| 200 | }), |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | #[cfg(test)] |
no test coverage detected