Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMcCulloh committed Sep 27, 2023
1 parent 6d29256 commit 466b065
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions libs/wingc/src/lsp/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ impl<'a> Visit<'a> for HoverVisitor<'a> {
self.visit_symbol(&node.name);

self.visit_function_definition(&node.initializer);
self.visit_function_definition(&node.inflight_initializer);

let scope = if let FunctionBody::Statements(statements) = &node.initializer.body {
statements
Expand Down Expand Up @@ -777,6 +778,26 @@ j.get("hello").get("world");
r#"
{ hi: { inner: [1, 2, 3] } }
//^
"#
);

test_hover_list!(
inflight_init,
r#"
struct Data {
field: str;
}
class T {
init() {
Data { field: "" };
}
inflight init() {
Data { field: "" };
//^
}
}
"#
);
}
14 changes: 14 additions & 0 deletions libs/wingc/src/lsp/snapshots/hovers/inflight_init.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
source: libs/wingc/src/lsp/hover.rs
---
contents:
kind: markdown
value: "```wing\nstruct Data\n```\n---\n### Fields\n- `field` — str"
range:
start:
line: 11
character: 2
end:
line: 11
character: 6

0 comments on commit 466b065

Please sign in to comment.