Module analysis

Module analysis 

Source
Expand description

Module responsible for analyzing the code surrounding the cursor for completion.

Structsยง

AnalysisResult ๐Ÿ”’
ExpansionResult ๐Ÿ”’

Functionsยง

analyze ๐Ÿ”’
Fill the completion context, this is what does semantic reasoning about the surrounding context of the completion location.
ancestors_in_file_compensated ๐Ÿ”’
classify_lifetime ๐Ÿ”’
classify_name ๐Ÿ”’
classify_name_ref ๐Ÿ”’
expand ๐Ÿ”’
expand_and_analyze ๐Ÿ”’
expand_maybe_stop ๐Ÿ”’
Expand attributes and macro calls at the current cursor position for both the original file and fake file repeatedly. As soon as one of the two expansions fail we stop so the original and speculative states stay in sync.
expected_type_and_name ๐Ÿ”’
Calculate the expected type and name of the cursor position.
fetch_immediate_impl_or_trait ๐Ÿ”’
find_node_in_file ๐Ÿ”’
Attempts to find node inside syntax via nodeโ€™s text range. If the fake identifier has been inserted after this node or inside of this node use the _compensated version instead.
find_node_in_file_compensated ๐Ÿ”’
Attempts to find node inside syntax via nodeโ€™s text range while compensating for the offset introduced by the fake ident. This is wrong if node comes before the insertion point! Use find_node_in_file instead.
find_opt_node_in_file ๐Ÿ”’
Attempts to find node inside syntax via nodeโ€™s text range. If the fake identifier has been inserted after this node or inside of this node use the _compensated version instead.
find_opt_node_in_file_compensated ๐Ÿ”’
Attempts to find node inside syntax via nodeโ€™s text range while compensating for the offset introduced by the fake ident.. This is wrong if node comes before the insertion point! Use find_node_in_file instead.
has_in_newline_expr_first ๐Ÿ”’
Similar to has_parens, heuristic sensing incomplete statement before ambiguous Expr
has_parens ๐Ÿ”’
When writing in the middle of some code the following situation commonly occurs (| denotes the cursor):
is_after_if_expr ๐Ÿ”’
is_in_block ๐Ÿ”’
is_in_breakable ๐Ÿ”’
is_in_token_of_for_loop ๐Ÿ”’
left_ancestors ๐Ÿ”’
next_non_trivia_sibling ๐Ÿ”’
next_non_trivia_token ๐Ÿ”’
path_or_use_tree_qualifier ๐Ÿ”’
pattern_context_for ๐Ÿ”’
prev_special_biased_token_at_trivia ๐Ÿ”’
token_at_offset_ignore_whitespace ๐Ÿ”’