-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better LSP hover interaction in stack-or-heap (#116)
* add tests of behaviors we plan to change Signed-off-by: David Vulakh <[email protected]> * implement [let]-bound function support Signed-off-by: David Vulakh <[email protected]> * implement restricted constructor location gated behind [-lsp-compat] flag Signed-off-by: David Vulakh <[email protected]> * clean up reported location for let-bound functions report the entire value binding when not in the lsp-compat regime also move all the lsp-compat tests to a separate file to group them together Signed-off-by: David Vulakh <[email protected]> * sundry cleanup clean up some artifacts of intermediate states to make the total PR diff cleaner Signed-off-by: David Vulakh <[email protected]> * pr comments Signed-off-by: David Vulakh <[email protected]> * make fmt Signed-off-by: David Vulakh <[email protected]> --------- Signed-off-by: David Vulakh <[email protected]>
- Loading branch information
Showing
8 changed files
with
285 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
(* Cursor on the constructor itself (we treat this case specially to improve LSP | ||
compatibility) *) | ||
|
||
let f g x y = | ||
let z = x + y in | ||
Some (g z) | ||
(* ^ *) | ||
;; | ||
|
||
let f g x y = | ||
let z = x + y in | ||
exclave_ Some (g z) | ||
(* ^ *) | ||
;; | ||
|
||
let f g x y = | ||
let z = Some (g x) in | ||
(* ^ *) | ||
y | ||
;; | ||
|
||
(* Pattern of a [let]-bound function (we treat this case specially to improve LSP | ||
compatibility) *) | ||
|
||
let f g x y = | ||
(* ^ *) | ||
let z = x + y in | ||
exclave_ Some (g z) | ||
and h g x y = | ||
(* ^ *) | ||
let z = x + y in | ||
exclave_ Some (g z) | ||
;; | ||
|
||
let ignore (local_ _) = () | ||
|
||
let () = | ||
let f g x y = | ||
(* ^ *) | ||
let z = x + y in | ||
exclave_ Some (g z) | ||
and h g x y = | ||
(* ^ *) | ||
let z = x + y in | ||
exclave_ Some (g z) | ||
in | ||
ignore f; | ||
ignore h | ||
|
||
(* Ensure other [let]-bound patterns aren't treated this way *) | ||
|
||
let x = Some 5 | ||
(* ^ *) |
Oops, something went wrong.