Try to offer known array shape keys when the cursor is inside `$var['` or `$var["`. Returns `None` when the cursor is not in an array-key context or when no shape keys could be resolved.
(
&self,
content: &str,
position: Position,
ctx: &FileContext,
)
| 868 | /// Returns `None` when the cursor is not in an array-key context or |
| 869 | /// when no shape keys could be resolved. |
| 870 | fn try_array_shape_completion( |
| 871 | &self, |
| 872 | content: &str, |
| 873 | position: Position, |
| 874 | ctx: &FileContext, |
| 875 | ) -> Option<CompletionResponse> { |
| 876 | let ak_ctx = crate::completion::array_shape::detect_array_key_context(content, position)?; |
| 877 | let items = self.build_array_key_completions(&ak_ctx, content, position, ctx); |
| 878 | if items.is_empty() { |
| 879 | None |
| 880 | } else { |
| 881 | Some(CompletionResponse::Array(items)) |
| 882 | } |
| 883 | } |
| 884 | |
| 885 | // ─── Strategy: member access completion ────────────────────────────── |
| 886 |
no test coverage detected