Skip to content

Commit

Permalink
Fix hover on assignments to subrecords (#1725)
Browse files Browse the repository at this point in the history
  • Loading branch information
jneem committed Nov 29, 2023
1 parent f4f866f commit 2c8cdfc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lsp/nls/src/usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl UsageLookup {
}
TraverseControl::ContinueWithScope(new_env)
}
Term::RecRecord(data, _interp_fields, _deps) => {
Term::RecRecord(data, ..) | Term::Record(data) => {
let mut new_env = env.clone();

// Records are recursive and the order of fields is unimportant, so define
Expand Down
9 changes: 8 additions & 1 deletion lsp/nls/tests/inputs/hover-cousin.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
{
foo = { bar = 2 },
blah = foo.bar,
baz.path.path = 2,
}
| {
foo | doc "outer" = {
bar | Number | doc "inner" | default = 3
}
},
baz.path | doc "longer path"
}
### [[request]]
### type = "Hover"
Expand All @@ -27,3 +29,8 @@
### type = "Hover"
### textDocument.uri = "file:///main.ncl"
### position = { line = 2, character = 14 }
###
### [[request]]
### type = "Hover"
### textDocument.uri = "file:///main.ncl"
### position = { line = 3, character = 6 }
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ expression: output
---
[bar, baz, foo, one, std]
[bar, baz, foo, std, two]
[bar, baz, foo, std, three]
[bar, baz, foo, quux, std, three]

Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ Dyn
```, ```nickel
Number
```, inner]
<3:6-3:10>[```nickel
Dyn
```, longer path]

0 comments on commit 2c8cdfc

Please sign in to comment.