-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1314 from ulugbekna/refactor-open-no-change
refactor-open: don't return useless edits
- Loading branch information
Showing
5 changed files
with
153 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
Can unqualify module located in the same file | ||
$ $MERLIN single refactor-open -action unqualify -position 4:6 <<EOF | ||
> module M = struct | ||
> let u = () | ||
> end | ||
> open M | ||
> let u = M.u | ||
> EOF | ||
{ | ||
"class": "return", | ||
"value": [ | ||
{ | ||
"start": { | ||
"line": 5, | ||
"col": 8 | ||
}, | ||
"end": { | ||
"line": 5, | ||
"col": 11 | ||
}, | ||
"content": "u" | ||
} | ||
], | ||
"notifications": [] | ||
} | ||
|
||
Can unqualify nested modules located in the same file | ||
|
||
$ $MERLIN single refactor-open -action unqualify -position 6:6 <<EOF | ||
> module M = struct | ||
> module N = struct | ||
> let u = () | ||
> end | ||
> end | ||
> open M.N | ||
> let u = M.N.u | ||
> EOF | ||
{ | ||
"class": "return", | ||
"value": [ | ||
{ | ||
"start": { | ||
"line": 7, | ||
"col": 8 | ||
}, | ||
"end": { | ||
"line": 7, | ||
"col": 13 | ||
}, | ||
"content": "u" | ||
} | ||
], | ||
"notifications": [] | ||
} | ||
|
||
Shouldn't return anything, as nothing to unqualify (for multiline identifiers) | ||
|
||
$ $MERLIN single refactor-open -action unqualify -position 1:6 <<EOF | ||
> open Unix | ||
> let f x = x. | ||
> tms_stime | ||
> EOF | ||
{ | ||
"class": "return", | ||
"value": [], | ||
"notifications": [] | ||
} | ||
|
||
FIXME shouldn't return anything, as nothing to unqualify (for multi-line identifiers) | ||
|
||
$ $MERLIN single refactor-open -action unqualify -position 6:6 <<EOF | ||
> module M = struct | ||
> module N = struct | ||
> let u = () | ||
> end | ||
> end | ||
> open M | ||
> let u = N. | ||
> u | ||
> EOF | ||
{ | ||
"class": "return", | ||
"value": [ | ||
{ | ||
"start": { | ||
"line": 7, | ||
"col": 8 | ||
}, | ||
"end": { | ||
"line": 8, | ||
"col": 1 | ||
}, | ||
"content": "N.u" | ||
} | ||
], | ||
"notifications": [] | ||
} | ||
|
||
|