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

Add code action for inlining #847

Merged
merged 40 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
431cc21
start work on inline action
jfeser Aug 26, 2022
e2bbaf3
basic inlining works
jfeser Aug 30, 2022
6014689
fix special case with labeled args
jfeser Aug 30, 2022
42b2727
cleanup
jfeser Aug 30, 2022
3bb7c12
promote tests
jfeser Aug 30, 2022
4e4f2d1
extract the relevant part of parsetree instead of using untypedast
jfeser Sep 4, 2022
747b33c
fix bug with shadowing
jfeser Sep 4, 2022
d064021
refactor
jfeser Sep 4, 2022
f6839be
address comments
jfeser Sep 8, 2022
1076d8b
handle optional arguments correctly
jfeser Sep 8, 2022
4fc1e81
fix find_parsetree_loc
jfeser Sep 8, 2022
03458ee
use parsetree from before ppx expansion
jfeser Sep 12, 2022
7b7c262
strip merlin.loc attributes
jfeser Sep 12, 2022
d98d249
check for shadowing before inlining
jfeser Sep 12, 2022
ad5d6cf
refactor
jfeser Sep 12, 2022
12ffeaf
remove test code
jfeser Sep 12, 2022
1c35310
formatting
jfeser Sep 12, 2022
302e1a2
fix incorrect comment
jfeser Sep 15, 2022
2fe3356
perform beta reduction after inlining function
jfeser Sep 16, 2022
5f4c286
continue work on beta reduction
jfeser Sep 20, 2022
d27de8d
early exit from search for inline source
jfeser Sep 20, 2022
1c49c80
Merge branch 'inline' into inline-ext
jfeser Sep 20, 2022
32bc3e4
basic beta reduction now works on pre-ppx parsetree
jfeser Sep 20, 2022
90b2ccb
handle labeled arguments in beta reduce
jfeser Sep 20, 2022
8f06e84
fix inlining functions with constrained args
jfeser Sep 20, 2022
46daa9b
add tests for inlining action
jfeser Sep 21, 2022
022ba6c
start work on top level let support
jfeser Sep 21, 2022
9dcd43e
fix bugs related to optional arguments
jfeser Sep 21, 2022
35de944
beta reduce literal tuple arguments
jfeser Sep 21, 2022
a149f9a
add more tests
jfeser Sep 23, 2022
96478a9
remove test module
jfeser Sep 29, 2022
b5583a3
update changes
jfeser Sep 29, 2022
4e683ad
formatting
jfeser Sep 29, 2022
8dd4c09
add mli
jfeser Sep 30, 2022
61c087b
use raise_notrace
jfeser Oct 8, 2022
e3f4696
refactor to use Option.O in whole function
jfeser Oct 8, 2022
be28337
explain error value
jfeser Oct 8, 2022
7f82df8
extract reusable functions
jfeser Oct 10, 2022
dc9abcb
explain todos
jfeser Oct 10, 2022
51c4708
cleanup
jfeser Oct 10, 2022
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: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Features

- Code action for inlining let bindings within a module or expression. (#847)

- Tag "unused code" and "deprecated" warnings, allowing clients to better
display them. (#848)

Expand Down
1 change: 1 addition & 0 deletions ocaml-lsp-server/src/code_actions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ let compute server (params : CodeActionParams.t) =
; Action_add_rec.t
; Action_mark_remove_unused.mark
; Action_mark_remove_unused.remove
; Action_inline.t
]
in
List.concat
Expand Down
Loading