-
Notifications
You must be signed in to change notification settings - Fork 238
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 #1785 from voodoos/at-origin-occurrences
At origin occurrences
- Loading branch information
Showing
6 changed files
with
71 additions
and
19 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,54 @@ | ||
$ cat >test.ml <<'EOF' | ||
> type t = { | ||
> label_a : int | ||
> } | ||
> | ||
> let v = { label_a = 42 } | ||
> let () = print_int v.label_a | ||
> EOF | ||
|
||
When cursor on the usage, all occurrences are highlighted | ||
$ $MERLIN single occurrences -identifier-at 6:25 -filename test.ml <test.ml | | ||
> jq '.value[].start.line' | ||
2 | ||
5 | ||
6 | ||
|
||
When cursor on the definition, occurrences are not highlighted | ||
$ $MERLIN single occurrences -identifier-at 2:5 -filename test.ml <test.ml | | ||
> jq '.value[].start.line' | ||
2 | ||
5 | ||
6 | ||
|
||
Same test for constructors: | ||
$ cat >test.ml <<'EOF' | ||
> type t = Constr_a of int | No_param | ||
> | ||
> let _ = Constr_a 42 | ||
> let _ = No_param | ||
> EOF | ||
|
||
When cursor on the usage, all occurrences are highlighted | ||
$ $MERLIN single occurrences -identifier-at 4:10 -filename test.ml <test.ml | | ||
> jq '.value[].start.line' | ||
1 | ||
4 | ||
|
||
When cursor on the definition, occurrences are not highlighted | ||
$ $MERLIN single occurrences -identifier-at 1:30 -filename test.ml <test.ml | | ||
> jq '.value[].start.line' | ||
1 | ||
4 | ||
|
||
When cursor on the usage, all occurrences are highlighted | ||
$ $MERLIN single occurrences -identifier-at 3:10 -filename test.ml <test.ml | | ||
> jq '.value[].start.line' | ||
1 | ||
3 | ||
|
||
When cursor on the definition, occurrences are not highlighted | ||
$ $MERLIN single occurrences -identifier-at 1:10 -filename test.ml <test.ml | | ||
> jq '.value[].start.line' | ||
1 | ||
3 |