-
Notifications
You must be signed in to change notification settings - Fork 246
Add a new command to extract expression into a fresh let binding #1948
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
Open
Tim-ats-d
wants to merge
34
commits into
ocaml:main
Choose a base branch
from
Tim-ats-d:refactor-extraction
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
24319eb
Add change entry.
Tim-ats-d a7a3729
Add a new command to extract expression into a fresh let binding.
Tim-ats-d 500487f
Merge branch 'main' into refactor-extraction
Tim-ats-d 1595bf4
Code quality.
Tim-ats-d d2d6e08
Add a function to determine if an expression is extractable inside a …
Tim-ats-d 38055ff
More tests.
Tim-ats-d f388319
Attempt to fix a bug with binding belonging to a module.
Tim-ats-d 1795632
Add change entry.
Tim-ats-d aee93b0
Add another test.
Tim-ats-d 7f90f47
Fix generation for parameter that appears twice, parenthised generat…
Tim-ats-d baedfc7
Code quality.
Tim-ats-d 3627558
Replace location heuristic by a proper analysis.
Tim-ats-d 195ed6d
Remove path of value living in a module inside extracted expression.
Tim-ats-d af58896
Make extraction works in submodule.
Tim-ats-d b064a8b
Clean up expression before printing.
Tim-ats-d f3db927
Generate a suffix when a name is given and already used in current sc…
Tim-ats-d 7551d2f
Fix a test.
Tim-ats-d d1d3c11
Take Ulysse's comments into account.
Tim-ats-d bc4e53d
Merge branch 'main' into refactor-extraction
Tim-ats-d c50af5b
Remove function type declaration.
Tim-ats-d 28a421e
Fix constant extraction nested in a modules.
Tim-ats-d 7fe97e7
Last fixes.
Tim-ats-d 32f03f0
WIP.
Tim-ats-d daf74d9
Reproduce a bug.
Tim-ats-d 7a00505
Merge branch 'state-of-work' into refactor-extraction
Tim-ats-d 3ec6dcc
Last fixes.
Tim-ats-d d314db6
Fix CLI doc and typos.
Tim-ats-d 11805ba
Clean up.
Tim-ats-d d3f6bdf
Add FIXME tests.
Tim-ats-d 68b02e7
Fix PR nb.
Tim-ats-d fc8c063
Ensure minimality for refactor issue examples.
Tim-ats-d 86cf319
Fix the path names in extractions
voodoos ee60e2d
Revert "Fix the path names in extractions"
voodoos 9bb9388
Attempt #2 at fixing pathed param names
voodoos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,5 +1,21 @@ | ||
open Std | ||
|
||
open Parsetree | ||
|
||
type nonrec constant_desc = constant_desc | ||
|
||
let constant_desc c = c.pconst_desc | ||
|
||
let filter_merlin_attr = | ||
let default = Ast_mapper.default_mapper in | ||
let keep attr = | ||
let { Location.txt; _ }, _ = Ast_helper.Attr.as_tuple attr in | ||
not (Std.String.is_prefixed ~by:"merlin." txt) | ||
in | ||
let attributes mapper attrs = | ||
default.Ast_mapper.attributes mapper (List.filter ~f:keep attrs) | ||
in | ||
{ default with Ast_mapper.attributes } | ||
|
||
let expr_remove_merlin_attributes expr = | ||
filter_merlin_attr.Ast_mapper.expr filter_merlin_attr expr |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.