Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hover on assignments to subrecords #1725

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]