Skip to main content

Module completion

Module completion 

Source

Structs§

CompletionCache
Completion cache built from the AST.
DotSegment
A segment of a dot-expression chain.

Enums§

AccessKind
What kind of access precedes the dot.

Functions§

build_completion_cache
Build a CompletionCache from AST sources and contracts. contracts is the .contracts section of the compiler output (optional).
extract_identifier_before_dot
Extract the identifier before the cursor (the word before the dot). Returns just the last identifier name for backward compatibility.
extract_mapping_value_type
Extract the deepest value type from a mapping typeIdentifier. Peels off all t_mapping$_<key>_$_<value> layers and returns the innermost value type.
extract_node_id_from_type
Extract the trailing node id from a typeIdentifier string. e.g. t_struct$_PoolKey_$8887_storage_ptr → Some(8887) t_contract$_IHooks_$2248 → Some(2248) t_uint256 → None
get_chain_completions
Get completions by resolving a full dot-expression chain. This is the main entry point for dot-completions with chaining support.
get_dot_completions
Get completions for a dot-completion request by resolving the full expression chain.
get_general_completions
Get general completions (all known names).
handle_completion
Handle a completion request.
parse_dot_chain
Parse the expression chain before the dot into segments. e.g. poolManager.swap(key, params). → [(“poolManager”, Plain), (“swap”, Call)] _pools[poolId].fee. → [(“_pools”, Index), (“fee”, Plain)] msg. → [(“msg”, Plain)]