Skip to main content

Module hover

Module hover 

Source

Functions§

class_hover_from_index
Build a hover for a class/interface/trait/enum found by short name in the workspace index.
class_hover_from_workspace_index
O(1) variant of class_hover_from_index: resolves word/fqn via WorkspaceIndexData::resolve_class_ref first, falling back to the full linear scan only when the index doesn’t resolve the class — preserves every edge case the scan covers (e.g. names the aggregate’s short-name map doesn’t disambiguate the same way), just skips the common-case cost.
docs_for_symbol_from_index
Return hover documentation for a symbol from a FileIndex slice.
docs_for_symbol_from_index_scoped
Like docs_for_symbol_from_index, but scoped to a class hint — see signature_for_symbol_from_index_scoped. Also skips the PHP-builtin fallback when a class hint is given, since a hint means the symbol is known to be a user-defined method, not a global builtin function.
extract_receiver_var_before_cursor
Extract the receiver variable from immediately before ->word or ?->word at the cursor’s exact column position. Uses the column rather than str::find() so multiple method calls on the same line are handled correctly.
extract_static_class_before_cursor
Extract the class name from immediately before :: at the cursor’s column.
format_params_str
hover_info_with_maps
Indexed variant: uses pre-computed SymbolMaps for the cross-file declaration lookup (path 4/5), eliminating repeated AST walks on stable files. find_class_doc gives mir-member hover and static-prop hover (path 2/3) the same O(1) workspace-index fast path, falling back to a linear other_docs scan only when it misses (index not ready, unsaved file, …). Named-arg hover still walks other_docs directly — it has no single resolved class to key a fast lookup on.
method_hover_from_index
Build a hover for a static method call found by class short name + method name in the workspace index. Used when the primary mir path cannot resolve a cross-file static call (e.g. Str::camel(…) where Str is only known through a use-import).
method_hover_from_workspace_index
O(1) variant of method_hover_from_index, same fallback contract as class_hover_from_workspace_index.
resolve_use_alias
Resolve a use-import alias to the short class name.
resolve_use_alias_fqn
Like resolve_use_alias, but also returns the full FQN the alias resolves to, so callers can disambiguate between same-named classes in different namespaces (e.g. many vendored Factory classes all locally aliased to FactoryContract) instead of matching on the short name alone.
signature_for_symbol_from_index
signature_for_symbol_from_index_scoped
Like signature_for_symbol_from_index, but when class_hint is given, only a method whose owning class matches it is considered — disambiguates same-named methods on unrelated classes (e.g. two classes both declaring save()) instead of returning whichever one is indexed first. A hint also skips the free-function search entirely, since a hint means the symbol is known to be a method.