Code reference detail
path_completion.rs
crates/reqlan-lsp/src/path_completion.rs
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| anonymous_reference_code_completion | Anonymous imports should share the same code completion e. g. ["@/reqlan rq/extension/language/syntax/features-syntax.rq"] should complete the same as `import "@/reqlan rq/extension/language/syntax/features-syntax.rq" as code_completion`. they should share the same code and logic | 0.060 | ||
| import_code_completion | done | Import path code completion for `import` / `from` strings ( and shared anonymous paths ). The Rust server is the default engine. The TypeScript provider remains for the node engine. [code_completion] [import_code_completion_explicit_extension] [import_code_completion_path_segments] [import_code_completion_substring_match] [import_code_completion_match_quality] [import_code_completion_ranking] [anonymous_reference_code_completion] [import_code_completion_auto_file_import] [import_code_completion_rendering] | 0.150 | |
| import_code_completion_explicit_extension | Completions insert paths with an explicit `.rq` extension. [implicit_file_extension] Hand-written imports may still omit the extension; completion prefers the written form with `.rq`. | 0.055 | ||
| import_code_completion_match_quality | Rank path candidates by match quality before [import_code_completion_ranking] proximity: an exact substring match outranks a separator-stripped substring match, which outranks an ordered character subsequence match. Within the subsequence tier, a match where every `/` - separated query chunk appears inside a path segment outranks a loose character subsequence. This keeps precise matches above coincidental subsequence matches, so the bounded result list keeps the intended target. [import_code_completion_substring_match] [import_code_completion_ranking] | 0.070 | ||
| import_code_completion_path_segments | In a folder context, show next path segments ( directories with a trailing `/` ). After `../`, offer `../path/` before nested `../path/file.rq`. | 0.055 | ||
| import_code_completion_prefix_aware_ranking | A query that starts with an import-root alias ranks that root ' s candidates before all others, before [import_code_completion_ranking] proximity. The typed prefix asserts the root; proximity must not fight that assertion. [import_code_completion_ranking] [import_code_completion_match_quality] | 0.036 | ||
| import_code_completion_ranking | Rank import path completions by directory proximity ( hop count from the completing file ' s directory to the candidate ' s directory ), then directories before files, then path alphabetically. Match-quality tiers from [import_code_completion_match_quality] apply before proximity. Example: typing `../` ranks `../close.rq` before `../../../path.rq`. Emit sortText for that order, and set filterText so the editor does not re-rank by label fuzzy score over proximity. | 0.078 | ||
| import_code_completion_substring_match | Filter path candidates by search within the path, not only a starts-with prefix. Typing `path` should match `../../parent/path.rq`. Typing `hellopath` should match `../../hello/inbetween/path/file.rq` ( characters matched in order across path segments ). | 0.064 | ||
| lsp_migration_remainder | in-progress | The default language server is [language_server_rust]. The Rust process serves the editor methods the product uses: sync, diagnostics, definition, highlight, links, hover, semantic tokens, inlay hints, code lens, completion, code actions, rename, references, document symbols, folding, and workspace symbols. Custom requests are file reference, wildcard reference, and reference-search site. The host pushes the inbound snapshot, settings, attribute catalog, name catalog, and bases. Import and file-path completion run in the Rust server ( [import_code_completion], [import_code_completion_rendering], [import_code_completion_auto_file_import] ). Triggers are `[`, `@`, `.`, `/`, and `"`. Import strings complete `.rq` files and directories. Anonymous bracket paths complete every file and directory, with the same ranking and alias rules. A cross-file idea shows its relative import path and inserts a from-import on accept when that name is not already imported. Move and delete text plans are native ( [refactor_symbol_move], [refactor_symbol_delete] ). The host passes open texts and index referencers. It does not build a Langium document. Barrel page planning is native. Document symbols and folding are flat idea lists. Semantic tokens include `keyword` ( `import`, `from`, `as` ) and file-symbol `method` spans. The theme maps `decorator`, `operator`, `keyword`, and `method` onto TextMate scopes. [lsp_file_watch] is the node document manager. The Rust server keeps no closed syntax tree. A neighbor read checks the file stamp. The index host watches `**/*.rq`. Do not port the Langium watch rebuild. `textDocument/selectionRange` grows with the parse ( ["../vsc-primitives.rq".selection_range] ). The activity bar ' s `selectionRange` is the editor selection. A definition link ' s `originSelectionRange` is the token under the caret. Rust text sync is incremental ( [lsp_incremental_sync] ). The node server keeps Langium incremental sync. Rust cancellation and work-done progress are [lsp_work_progress]. The node connection already accepts cancel tokens. Index and search progress stay on the extension host. The Rust parser applies relative body indent. The node process ( `packages/extension/src/language/main.ts` and the Langium providers ) is the fallback when the setting is `node` or the binary is missing. The extension host stays in TypeScript: the language client, command UI, index, webviews, and TextMate. Comment rename in non- `.rq` files is a host rename provider. It reads the comment text. It does not build a Langium document. | 0.140 | |
| lsp_work_progress | done | The Rust server honors `$/cancelRequest` and reports work-done progress. A cancel that arrives before its request returns error - 32800. The handler does not run. A cancel seen at a checkpoint aborts the walk. The response is that error. No success result follows. Hover, definition, highlight, links, semantic tokens, code lens, inlays, document symbols, folding, and selection range check cancel when the request ends. They do not advertise work-done progress. References, rename, completion, and workspace symbol advertise `workDoneProgress`. Each of those walks checks cancel per document, index, or directory. A catalog scan checks cancel every 128 names. A request that carries `workDoneToken` sends `$/progress` begin, report, and end on that token. A report is sent when the percentage changes. Repeated ticks at the same percentage send nothing. Begin waits 150 ms, so a fast request sends no progress. End runs on every exit, including cancel. The confirm pass has no client token. When the client allows work-done progress, the server creates a token and reports " Checking references " after the same delay. A client message that arrives during that walk puts the URI back on the confirm queue. The server publishes no diagnostics for that stale walk. The waiting message is handled next. A request therefore does not wait behind the rest of the confirm pass. Related: [language_server_rust], [lsp_migration_remainder]. | 0.126 | |
| code_completion_reentry_is_lossless | Re-entering a finished path and completing again must keep or deliberately replace the content, never mutate it unpredictably. The candidate equal to the current content ranks first. Candidates whose remainder continues the text after the cursor rank above other candidates of the same match tier. Implemented by ["../../../../crates/reqlan-lsp/src/path_completion.rs"] and ["../../../../packages/language/src/reqlan-path-completion.ts"], with the provider in ["../../../../packages/language/src/reqlan-completion-provider.ts"]. [code_completion_replaces_the_tail] ["../support/features-imports.rq".import_code_completion_ranking] | 0.036 | ||
| code_completion_replaces_the_tail | Completion inside an unfinished string or reference name replaces the whole token up to its closing character. Text after the cursor that continues the inserted value is kept, not duplicated; any other tail is consumed. A picked folder keeps a bare file name typed after the cursor: when the inserted value ends with `/` and the tail holds no further `/`, the tail is appended. Applies to anonymous paths ( `["…` ), bare references ( `[…` / `[[…` ), qualified-file idea names ( `["p.rq".…` ), and attribute keys and values ( `@key`, `@key: value` ), matching the import-path behaviour. Matching still uses the typed prefix before the cursor only. Accepting a completion at the end of an unclosed string appends the missing closing delimiter; only when nothing follows the cursor, so in-progress text is never trapped behind a quote. Implemented by ["../../../../crates/reqlan-lsp/src/path_completion.rs"], ["../../../../crates/reqlan-lsp/src/session/completion.rs"], ["../../../../crates/reqlan-lsp/src/analysis/completion.rs"], ["../../../../packages/language/src/reqlan-completion-context.ts"], and ["../../../../packages/language/src/reqlan-completion-provider.ts"]. ["./features-syntax.rq".code_completion] [reference_code_completion_objects] [attribute_code_completion_attribute_key] | 0.041 | ||
| completion_site_identifier_charset | Completion site detection must accept the full grammar identifier charset in every typed prefix: attribute keys, bare references, wikilinks, and qualified-file idea prefixes. The charset is the parser `ID` terminal, `[_a-zA-Z][\w-]*`, which includes the hyphen: ["../../../../packages/language/src/reqlan.langium"]. Site regexes must not encode a narrower charset than the parser `ID` terminal. Implemented by ["../../../../crates/reqlan-lsp/src/path_completion.rs"] and ["../../../../packages/language/src/reqlan-completion-context.ts"]. [reference_code_completion_objects] [attribute_code_completion_attribute_key] | 0.036 | ||
| reference_code_completion_objects | done | [reference_code_completion] must offer code completion for all valid reqlan references: - reqlan files ( `.rq` ) - ideas and ideasets in a reqlan file after a quoted path ( `["path".idea]` ) - ideasets and ideaset members ( `[ideaset.member]` ) - code files - folders, including folders that do not contain `.rq` files Import path completion stays limited to `.rq` files. Anonymous file-reference paths share ranking and alias logic with import paths, but they include every file and folder target. Bare dotted references ( `[ideaset.member]`, `[alias.member]` ) complete members in both engines. Members come from open documents and, for closed files, from the ideas index membership edges ( `ideaset_member` ) in the Rust server. The Node engine has no index access, so its bare `set.member` completion stays limited to open documents; `alias.member` reaches closed files in the Rust server through on-demand parse. Reference completion must not fire inside markdown link labels or main-description prose. Scanning every workspace file on each keystroke is too expensive: [reference_code_completion_performance]. | 0.056 | |
| reference_code_completion_performance | done | [reference_code_completion_objects] must stay interactive on large workspaces. Path completion must not re-walk the filesystem on every keystroke: cache directory listings and reuse them for import and anonymous file-reference completion. Ranking must precompute proximity keys rather than recomputing hop distance per comparator call. The Rust server keeps that ranked list for the listing TTL. A later keystroke filters the list. It does not rebuild relative paths or hop keys. Idea-graph ranking must reuse per-document adjacency across completion requests while document versions are unchanged. Anonymous file-reference completion may omit distant candidates after proximity ranking so the list stays bounded. Implemented by ["../../../../crates/reqlan-lsp/src/path_completion.rs"] ( `PathCompletionCache`, listing cache ), ["../../../../packages/language/src/reqlan-path-completion.ts"] ( `clearPathCompletionCaches`, listing cache, `sortPathCompletionCandidates` ), ["../../../../packages/language/src/reqlan-completion-provider.ts"], and ["../../../../packages/language/src/reqlan-completion-context.ts"]. [reference_code_completion] [reference_code_completion_objects] | 0.043 |
Reference labels
"../../../../crates/reqlan-lsp/src/path_completion.rs", "../../../../crates/reqlan-lsp/src/path_completion.rs:merge_tail_carries_a_bare_filename_tail"