Code reference detail
path-resolve.test.ts
packages/language/test/path-resolve.test.ts
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| base | A base is a container for ideas, ideasets, and files. It forms the boundary of one ideas graph and is consumed by the CLI and the extension. Marker: a directory is a base only when it owns a `.reqlan` folder ( [app_memory_doc.application_memory] ). No bare workspace folder is treated as a base until the user creates `.reqlan` there ( [create_base_onboarding] ). Aligns with [ontology_base]. Discovery and registry: [base_discovery], [base_registry]. Marker path helpers: [application_memory_impl]. | 0.322 | ||
| base_configuration | Base configuration is distinct from, but related to, [extension_configuration]. Optional settings live at `<base>/.reqlan/config.json` ( one config per base ). For an `.rq` file, the applying base is the nearest ancestor that owns `.reqlan`; that base's config applies when present. See [extension_configuration.configuration_location]; resolved by [path_resolve]. | 0.087 | ||
| configuration_import_roots | `importRoots` is an optional array of alias-to-directory mappings in `.reqlan/config.json`. Each mapping has: - `alias` ( required non-empty string ): prefix before `/` in aliased import paths. - `root` ( optional non-empty string ): directory for that alias. A relative `root` resolves against the base root ( the parent of `.reqlan` ), not against the `.reqlan` directory. An absolute path or `file://` URI is used as that alias' import-root directory directly. When `root` is omitted for a mapping, that alias uses the workspace folder that contains the `.rq` file. When `importRoots` is omitted, empty, or has no valid entries, the default is one mapping with alias `importRootAlias` from ["../../../packages/analytical/src/core/defaults.json"] and no explicit root. When several aliases could match a path, the longest alias wins. Invalid or unreadable JSON, and a non-array `importRoots` value, fall back to defaults ( or no loaded config for discovery, then defaults at resolve time ). Language path forms and `@/` shorthand: ["../../language/imports.rq".import_paths] and ["../../language/imports.rq".configuration_import_root_alias]. Comment references in source files use the same mappings: ["../language/comment-references/functional-code-comment-references.rq".comment_reference_import_root_alias]. Schema: [configuration_schema_file]. Applying file discovery: [configuration_location]. Editor completion of aliased import paths: ["../language/syntax/features-syntax.rq".code_completion]. | 0.167 | ||
| configuration_location | An optional `.reqlan/config.json` may appear under a base's `.reqlan` directory. For a given `.rq` file, the applying base is the nearest ancestor directory that owns a `.reqlan` folder. The applying config is that base's `.reqlan/config.json` when present. If the owning base has no `config.json`, or no owning base is found, defaults from [configuration_import_roots] apply. A child base does not inherit a parent base's config. | 0.190 | ||
| comment_reference_import_root_alias | done | Qualified comment references use the same path forms as imports, including import-root aliases such as `@/`. `rq:["@/path/relative/to/import/root.rq".idea]` resolves against the alias's import-root directory ( workspace folder by default ), not the source file directory. `@reqs` without a following `/` is not an alias. Configured aliases and roots follow ["../../../language/imports.rq".configuration_import_root_alias] and ["../../host/configuration.rq".configuration_import_roots]. The language server applies this when resolving comment references in `.rq` files. The extension applies the same core resolver for `rq:[…]` links in non- `.rq` source. Related: ["../../../language/syntax.rq".comment_reference], [references_in_functional_code_comments], ["../../../language/imports.rq".import_paths]. | 0.235 | |
| references_in_functional_code_comments | done | Comments in functional code should be able to reference reqlan ideas using the an `rq:` prefixed to an idea: `rq:[idea]` as demonstrated in python, but actually applicable to any language's comment context: Editor hosts are every language except [comment_reference_language_blocklist]. With the rust language server, a resolved `rq:[…]` site is Ctrl + click navigable via go-to-definition. File document links stay out of the editor ( ["../syntax/features-syntax-highlighting.rq".editor_reference_activation] ). Comment `rq:[…]` sites use TextMate `meta.link.reqlan markup.underline` so the resting editor shows they are link-shaped ( [comment_reference_resting_underline] ). After that goto, Alt + Left restores the comment-host caret ( [comment_reference_navigate_back] ). Missing ideas keep the error underline and have no definition target. Relates to ["../../mutation/refactor_support.rq".comment_reference_refactor_support], [comment_reference_import_root_alias], ["../support/language-server-rust.rq".language_server_rust], ["../syntax/features-syntax-highlighting.rq".editor_reference_activation]. | 0.300 | |
| configuration_import_root_alias | An import path may start with an alias string, then `/`, then a relative path under that alias's import-root directory. Default alias string: `@`, written as `@/` plus a path relative to the import root. Default import-root directory: the workspace folder that contains the `.rq` file ( not the document directory ). The path after `/` is joined to that alias's import-root directory; the alias itself must be followed by `/` ( e. g. `@reqs` is not aliased ). Alias strings and import-root directories are configured as [configuration.configuration_import_roots] in the applying `.reqlan/config.json` from [configuration.configuration_location]. A configured relative `root` resolves against the base root ( parent of `.reqlan` ); an omitted `root` keeps the workspace-folder default. When several configured aliases could match a path, the longest alias wins. Related path forms: [import_paths], ["../extension/language/comment-references/functional-code-comment-references.rq".comment_reference_import_root_alias]. Completion: ["../extension/language/syntax/features-syntax.rq".code_completion]. File references and the language server use the same locate rule as ["../core_analysis/check.rq".check]: load `importRoots` from the applying `.reqlan/config.json` for the source file ( [configuration.configuration_location] ), then `resolve_rq_path` and join the workspace when the result is relative — including paths with spaces such as `["@/my file.ts"]`. | 0.296 | ||
| import_keywords | The keywords import, from, and as are reserved for import statements. Import keywords may also appear as ordinary words in idea body text when not at statement start. | 0.047 | ||
| file_suffix | Reqlan requirement documents use the. rq file suffix. | 0.052 | ||
| reference_file | References may target arbitrary files, not only. rq files. File reference syntax uses a bracketed quoted path. A relative path resolves from the document directory. When that path climbs with `..` and the file is not there, the same path is tried from each ancestor directory up to the workspace folder. The document-directory file wins when it exists. Line or line-range references append `L#n` or `L#n-m` after the path inside the brackets. Test-name references append `:` and the test title after the path ( for example `./app.test.ts:lists items` ). The first `:` after the path starts the title; later `:` characters stay in the title ( `e2e: …` ). `://` and a Windows drive `C:` / `C:/` are part of the path, not a test suffix. Symbol references append a dot-separated symbol path after the quoted file path. Quoted body text is not a file reference: ["../reference_types.rq".reference_edgecase]. | 0.266 | ||
| configuration | done | There are multiple scopes for configuration: at the [base] level and at the [extension] level. Base config: ["./extension/host/configuration.rq".configuration_location] ( `<base>/.reqlan/config.json` ). Base vs extension split: ["./bases/base.rq".base_configuration]. | 0.040 | |
| idea | done | A reqlan core unit is an idea. Syntax: ["./language/syntax.rq".simple_idea], ["./language/syntax.rq".block_idea]. Grammar: [reqlan_grammar] `Idea` / `OneLinerIdea`; index records: [analytical_types] `IdeaRecord`. Extract: [idea_extractor], [rust_extract]; AST: [rust_ast]. Product surface: [ideas_summary_tabs] Ideas tab per ["./extension/workspace-summary/ideas_summary/webview.rq".ontology_aligned_tabs]. | 0.110 |
Reference labels
"../../../../packages/language/test/path-resolve.test.ts:pathResolveContextFromWorkspaceFolders picks the longest matching folder", "../../../../packages/language/test/path-resolve.test.ts:resolveAuthoredFsPath joins aliased remainder to the workspace folder", "../../../packages/language/test/path-resolve.test.ts:loads importRoots list from nearest base config", "../../../packages/language/test/path-resolve.test.ts:resolves using config importRoots mapping", "../../../packages/language/test/path-resolve.test.ts:rewrite leaves aliased paths unchanged", "../../../packages/language/test/path-resolve.test.ts:toDirectoryUri does not parse a drive letter as a URI scheme", "../../packages/language/test/path-resolve.test.ts:a climbing relative path resolves from an ancestor directory", "../../packages/language/test/path-resolve.test.ts:a file next to the document wins over an ancestor", "../../packages/language/test/path-resolve.test.ts:leaves non-aliased relative paths document-relative", "../../packages/language/test/path-resolve.test.ts:loads importRoots list from nearest base config", "../../packages/language/test/path-resolve.test.ts:matchImportRootAlias requires alias then slash", "../../packages/language/test/path-resolve.test.ts:resolves import-root alias against the workspace folder", "../../packages/language/test/path-resolve.test.ts:resolves using config importRoots mapping", "../../packages/language/test/path-resolve.test.ts:rewrite leaves aliased paths unchanged", "../packages/language/test/path-resolve.test.ts:loads importRoots list from nearest base config", ../../../../packages/language/test/path-resolve.test.ts:pathResolveContextFromWorkspaceFolders picks the longest matching folder, ../../../../packages/language/test/path-resolve.test.ts:resolveAuthoredFsPath joins aliased remainder to the workspace folder, ../../../packages/language/test/path-resolve.test.ts:loads importRoots list from nearest base config, ../../../packages/language/test/path-resolve.test.ts:resolves using config importRoots mapping, ../../../packages/language/test/path-resolve.test.ts:rewrite leaves aliased paths unchanged, ../../../packages/language/test/path-resolve.test.ts:toDirectoryUri does not parse a drive letter as a URI scheme, ../../packages/language/test/path-resolve.test.ts:a climbing relative path resolves from an ancestor directory, ../../packages/language/test/path-resolve.test.ts:a file next to the document wins over an ancestor, ../../packages/language/test/path-resolve.test.ts:leaves non-aliased relative paths document-relative, ../../packages/language/test/path-resolve.test.ts:loads importRoots list from nearest base config, ../../packages/language/test/path-resolve.test.ts:matchImportRootAlias requires alias then slash, ../../packages/language/test/path-resolve.test.ts:resolves import-root alias against the workspace folder, ../../packages/language/test/path-resolve.test.ts:resolves using config importRoots mapping, ../../packages/language/test/path-resolve.test.ts:rewrite leaves aliased paths unchanged, ../packages/language/test/path-resolve.test.ts:loads importRoots list from nearest base config