Skip to main content Module completion Copy item path Source CompletionCache Completion cache built from the AST. DotSegment A segment of a dot-expression chain. ScopeContext Scope context for scope-aware completion resolution.
When present, type resolution uses the scope chain at the cursor position
instead of the flat first-wins name_to_type map. ScopeRange A byte range identifying a scope-creating AST node. ScopedDeclaration A declaration found within a specific scope. TopLevelImportable A directly-declared top-level symbol that can be imported. AccessKind What kind of access precedes the dot. all_sol_import_paths Walk project_root recursively and return every .sol file as: append_auto_import_candidates_last Append auto-import candidates at the tail of completion results. 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 extract_top_level_importables_for_file Extract directly-declared importable top-level symbols from a file AST. find_innermost_scope Find the innermost scope node that contains the given byte position and file.
scope_ranges must be sorted by span size ascending (smallest first).
Returns the node_id of the smallest scope enclosing the position. 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 + static completions). get_static_completions Get static completions that never change (keywords, magic globals, global functions, units).
These are available immediately without an AST cache. handle_completion Handle a completion request. handle_completion_with_tail_candidates Handle a completion request with optional tail candidates. 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)] resolve_name_in_scope Resolve a variable name to its type by walking up the scope chain. top_level_importable_completion_candidates Convert cached top-level importable symbols into completion items.