Skip to main content

import_code_actions

Function import_code_actions 

Source
pub fn import_code_actions(
    doc: &DocumentState,
    range: Range,
    uri: &Url,
    ws: &dyn WorkspaceView,
) -> Vec<CodeActionOrCommand>
Expand description

AUTO-IMPORT quickfixes: for each unresolved reference in range that some project module publicly exports but this file does NOT import, offer an Import <Module>. action whose single edit inserts the statement in the right place (after existing imports, else before the first ## block). An ambiguous name (exported by several modules) offers one action per module. THE lever — the compiler error becomes a one-click fix before a build is ever run.