Skip to main content

Module debug_gate

Module debug_gate 

Source
Expand description

Test-only hold points for blocking-pool work.

The responsiveness regression tests need to prove a notification handler’s synchronous work runs off the connection’s serve future. Requests can pin that with a pure ordering check (see assert_stays_responsive in the test harness), but a notification has no response to order against — earlier versions fell back to wall-clock budgets, which flaked on loaded CI runners. A gate makes the check deterministic instead: the test arms a named section, the handler’s blocking closure parks in pass until released, and the test asserts the server still answers a probe while the work is provably in flight. On a correct build that holds under any scheduling; on a regressed (inline) build the serve future itself parks, no later message is processed, and the probe times out — a hard failure, never a flake.

Production builds compile the whole mechanism out: without the test-hooks feature (enabled only for test targets, via the self dev-dependency in Cargo.toml) DebugGate is a zero-sized no-op and the hold/release custom methods are never registered, so a real client cannot arm anything.

Structs§

DebugGate

Constants§

GATE_CODE_ACTION_RESOLVE
Gate section around codeAction/resolve’s deferred action generation.
GATE_COMPLETION_RESOLVE
Gate section around completion_resolve’s all-indexes signature/doc lookup.
GATE_DID_CHANGE_WATCHED_FILES
Gate section around did_change_watched_files’ batched parse closure.
GATE_DID_CLOSE_DISK_SYNC
Gate section around did_close’s on-disk resynchronization.
GATE_DID_OPEN_PARSE
Gate section around did_open’s parse-diagnostics closure.
GATE_DID_SAVE_DIAGNOSTICS
Gate section around did_save’s diagnostics-recompute closure.
GATE_DOCUMENT_LINK
Gate section around document_link’s AST walk plus @link/@see scan.
GATE_DOCUMENT_SYMBOL
Gate section around document_symbol’s AST walk.
GATE_FOLDING_RANGE
Gate section around folding_range’s AST walk plus comment/region scan.
GATE_GOTO_DEFINITION
Gate section around goto_definition’s same-document/index fallback work.
GATE_GOTO_IMPLEMENTATION
Gate section around goto_implementation’s method-decl cursor check.
GATE_GOTO_TYPE_DEFINITION
Gate section around goto_type_definition’s exact-resolution chain.
GATE_INLAY_HINT_RESOLVE
Gate section around inlay_hint_resolve’s all-indexes doc lookup.
GATE_INLINE_VALUE
Gate section around inline_value’s range text scan.
GATE_LINKED_EDITING_RANGE
Gate section around linked_editing_range’s highlight/class-scoping walk.
GATE_MONIKER
Gate section around moniker’s AST member lookup.
GATE_ON_TYPE_FORMATTING
Gate section around on_type_formatting’s whole-document scan.
GATE_PREPARE_CALL_HIERARCHY
Gate section around prepare_call_hierarchy’s indexed-lookup closure.
GATE_PREPARE_RENAME
Gate section around prepare_rename’s keyword member-access check.
GATE_REFERENCES_VARIABLE
Gate section around references’ same-document variable walk.
GATE_RENAME_VARIABLE
Gate section around rename’s property-decl cursor check + variable rename.
GATE_SELECTION_RANGE
Gate section around selection_range’s AST-walk closure.
GATE_SEMANTIC_TOKENS_FULL
Gate section around semantic_tokens_full’s AST walk.
GATE_SEMANTIC_TOKENS_FULL_DELTA
Gate section around semantic_tokens_full_delta’s AST walk.
GATE_SEMANTIC_TOKENS_RANGE
Gate section around semantic_tokens_range’s AST walk.
GATE_TYPE_HIERARCHY
Gate section around type-hierarchy lookup/result construction.
GATE_USAGE_SYMBOL_RETRY
Gate section around the usage-symbol settle-wait in handle_references/ indexed_rename, held right after mir’s own per-file resolution first comes back empty (companion file not yet known) and before the wait-then-retry — lets a test force a companion declaring file to open while mir’s resolution attempt is still in flight, so the retry can observe mir resolving it correctly instead of falling through to the AST-heuristic FQN fallback.
GATE_WILL_DELETE_FILES
Gate section around will_delete_files’ use-edit batch closure.
GATE_WILL_RENAME_FILES
Gate section around will_rename_files’ use-edit batch closure.