TODO §67: sticky scroll pins every layer's header (VS Code follows the folding ranges, ten lines deep)
configurationDefaults for verilog and systemverilog: editor.stickyScroll.defaultModel = foldingProviderModel and editor.stickyScroll.maxLineCount = 10. The outline model pinned only the module header; the server's folds already start on each layer's first line. A folding test pins the owner's example (module, always, case, case item, if). Not yet seen in a running VS Code. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
1 parent
ea586d29bc
commit
3132c24b21
4 files changed
+61
-2
No files matched your search
@@ -7172,3 +7172,24 @@ parser and the CLI's `--lines` are not touched.
|
||||
`generate`, inside a function), off-grid and tab indentation, partial
|
||||
selections, comments, fences, broken files, masked-corruption attacks on
|
||||
the splice.
|
||||
|
||||
## 67. Sticky scroll shows every layer (planned 2026-11-11, owner's order)
|
||||
|
||||
VS Code pinned only the module header, because sticky scroll follows the
|
||||
document-symbol outline by default and the outline stops at declarations.
|
||||
The server's folding ranges already carry every `begin`/`end`, `case`,
|
||||
`fork`, `generate` and function — one fold per layer, starting on its header
|
||||
line.
|
||||
|
||||
- [x] `editors/vscode/package.json` `configurationDefaults` for both language
|
||||
ids: `editor.stickyScroll.defaultModel` = `foldingProviderModel` and
|
||||
`editor.stickyScroll.maxLineCount` = 10 (VS Code's default of 5 is the
|
||||
owner's example exactly, with nothing to spare). A user's own setting
|
||||
still wins.
|
||||
- [x] `crates/lucisv_server/src/folding.rs`: a test pinning that each layer
|
||||
of the owner's example (module, `always`, `case`, case item, `if`)
|
||||
starts a fold on its header line.
|
||||
- [ ] Seen in a running VS Code (owner).
|
||||
- Known limit: a layer with no `begin` (a one-statement `if`, a case item
|
||||
without `begin`) has no fold and so no pinned line; a `begin` written on
|
||||
its own line pins that `begin` line, not the `always` above it.
|
||||
@@ -148,6 +148,39 @@ mod tests {
|
||||
assert_eq!(folds(text), vec![(0, 5, "region"), (1, 4, "region"), (2, 3, "region")]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_layer_a_reader_is_inside_starts_a_fold_on_its_header_line() {
|
||||
// VS Code's sticky scroll is told (the extension's
|
||||
// `editor.stickyScroll.defaultModel`) to pin the first line of every
|
||||
// fold around the top of the viewport. So the header of each layer —
|
||||
// module, `always`, `case`, the case item, the `if` — must be a fold's
|
||||
// start line, and each fold must reach the innermost statement.
|
||||
let text = concat!(
|
||||
"module m (\n", // 0
|
||||
" input a\n", // 1
|
||||
");\n", // 2
|
||||
" always @(*) begin\n", // 3
|
||||
" case (st)\n", // 4
|
||||
" st_1: begin\n", // 5
|
||||
" if (cond_1) begin\n", // 6
|
||||
" x = 1;\n", // 7
|
||||
" y = 2;\n", // 8
|
||||
" end\n", // 9
|
||||
" end\n", // 10
|
||||
" endcase\n", // 11
|
||||
" end\n", // 12
|
||||
"endmodule\n", // 13
|
||||
);
|
||||
let ranges = folds(text);
|
||||
for header in [0, 3, 4, 5, 6] {
|
||||
let fold = ranges.iter().find(|(start, _, _)| *start == header);
|
||||
let Some((_, end, _)) = fold else {
|
||||
panic!("no fold starts on line {header}: {ranges:?}")
|
||||
};
|
||||
assert!(*end >= 8, "the fold from line {header} must cover line 8, got {ranges:?}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_scope_that_opens_and_closes_on_one_line_folds_nothing() {
|
||||
// `end_line <= start_line` means there is no hidden line to gain.
|
||||
|
||||
@@ -142,6 +142,7 @@ enabling both paths formats twice.
|
||||
| Document and workspace symbols | Hierarchical outline plus indexed symbol search across the design |
|
||||
| Include links | Resolvable `` `include`` paths become clickable using local and filelist `+incdir+` search rules |
|
||||
| Folding | Modules, classes, blocks, regions, and multiline comments fold on syntax-aware boundaries |
|
||||
| Sticky scroll | The first line of every block you are inside — the module, the `always`, the `case`, the case item, the `if` — stays pinned at the top of the editor, up to ten lines deep |
|
||||
| Inlay hints | Adds port and parameter names to ordered instantiations without guessing at ambiguous sites |
|
||||
| Code lenses | Shows the workspace-wide instantiation count above every module/interface; click to jump to a site |
|
||||
| Call hierarchy | Incoming calls answer “who instantiates this?”; outgoing calls answer “what does this instantiate?” |
|
||||
|
||||
@@ -192,10 +192,14 @@
|
||||
},
|
||||
"configurationDefaults": {
|
||||
"[verilog]": {
|
||||
"editor.defaultColorDecorators": "never"
|
||||
"editor.defaultColorDecorators": "never",
|
||||
"editor.stickyScroll.defaultModel": "foldingProviderModel",
|
||||
"editor.stickyScroll.maxLineCount": 10
|
||||
},
|
||||
"[systemverilog]": {
|
||||
"editor.defaultColorDecorators": "never"
|
||||
"editor.defaultColorDecorators": "never",
|
||||
"editor.stickyScroll.defaultModel": "foldingProviderModel",
|
||||
"editor.stickyScroll.maxLineCount": 10
|
||||
}
|
||||
},
|
||||
"languages": [
|
||||
|
||||
Reference in new issue
Block a user