Code reference detail
context-model.ts
packages/extension/src/activity_bar_module/context-model.ts
| Idea | Status | Tags | Summary |
|---|---|---|---|
| any_file_scope | The active editor may be a requirement file or implementation file ( Python, TypeScript, etc. ). [current_file_context] must surface requirement links even when the file contains no block ideas. Signals for non-. rq files ( and. rq files without a caret idea ): - [file_reference_links]: `.rq` ideas whose outbound `file_reference` edges target this file path ( e. g. `["./apythonfile.py"]` ). - [folder_reference_links]: `.rq` ideas whose `file_reference` targets a parent folder of this file. - [comment_reference_links]: ideas resolved from `rq:[…]` tokens in this file's comments per [code_comment_refs.references_in_functional_code_comments]. - [git_context]: focus-centric git history ( recent commits, authors, branch ); working-tree dirty badge secondary. Focus behaviour: - `.rq` file with caret in a block → idea focus ( unchanged ). - Any file with linked requirements → file focus; [effective_center_id] defaults to the first linked requirement. - No links → file focus with empty related lists; graph / refs panes stay idle until a requirement is focused. Implementation: [context_model] uses [file_path_match] and `file_related_requirements` analyser; comment links are also resolved from live buffer text when indexed edges are absent. | ||
| context_scope | Reqlan sidebar and AI workflows reason about a composed [reqlan_context_model], not a single " current file " blob. Context applies to * * any workspace file * *, not only `.rq` sources — see [any_file_scope]. Context is built from orthogonal [context_dimensions] that the user can enable, pin, or collapse. The activity bar [activitybar.scope_pane] is the primary surface for inspecting and steering context; [activitybar.context_tray] holds the [manual_context] dimension. Token discipline per [features_ai.ai_integration]: show summaries and counts by default; expand a dimension only on intent. Parses per ["../../../reqlan rq/language/syntax.rq".reference_wikilink]. Decision-oriented v2 ( sources → signals → synthesis → views → consumers ) and show-don ' t-tell widgets: [context_scope_v2.context_scope_v2]. | ||
| implementation_priority | 1. [any_file_scope] types and [context_model] builder. 2. Host refresh for any workspace file; git / all-tab collection. 3. [scope_pane_design] non-. rq focus hero and grouped link panels. 4. [context_selection] + [activitybar.selection_pane]. 5. Lazy `loadFileLens` for file-list dimensions. 6. [ai_context_export]. 7. [graph_path_doc.graph_path_walk] ( future pane / Ideas Summary handoff ). | ||
| reqlan_context_model | Canonical composed context per [analytical_context_model]. Implementation: [context_model]. - [context_focus] is the single anchor ( idea, file, selection, or none ). - [context_dimensions] each contribute [context_contribution] records with counts and summary lines. - [context_footprint] merges enabled dimensions into deduped idea / file sets and an [effective_center_id] for graph / refs panes. - [current_file_slice] is the projection used when the current-file lens is expanded. Includes `isRqFile`, `referencingIdeas`, `commentLinkedIdeas`, `folderReferencingIdeas`, and optional `gitChange`. - [context_selection] when the user highlights a non-empty range spanning one or more `.rq` ideas ( [activitybar.selection_pane] ). - [global_hop_depth] and [dimension_hop_control] overrides on the model. Host increments `revision` when any dimension or hop depth changes; webview ignores stale posts by revision. |
Reference labels
../../../packages/extension/src/activity_bar_module/context-model.ts, context_model