-
Notifications
You must be signed in to change notification settings - Fork 233
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
fix same file documentation bug #1265
Merged
Merged
Conversation
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
for lookups of documentation for values defined in the same file, merlin will not return documentation for any but the last documented definition.
in the same file are now available
ulugbekna
force-pushed
the
fix-same-file-comments
branch
from
March 2, 2021 07:57
befd23e
to
8fe7ec2
Compare
Thanks, these changes look good to me. It might just be a mistake; or the comments list was previously in the wrong order ? Or I am also curious about the role of |
Thanks Ulysse!
In retrospective, I should've probably added tests to show that there are
no regressions. I have tested manually however if that counts :p
…On Mon, Mar 15, 2021, 15:24 Ulysse ***@***.***> wrote:
Thanks, these changes look good to me.
I wonder why these List.rev was used in the first place, @trefis
<https://github.com/trefis> ?
It might just be a mistake; or the comments list was previously in the
wrong order ? Or Ocamldoc.associate_comment was too aggressively
optimized at some point...
I am also curious about the role of File_switching.where_am_i () ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1265 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4YR656UC3RRMJ6MIB5CALTDXN5LANCNFSM4XLH2TPQ>
.
|
It's never to late to add tests 🙂 |
voodoos
added a commit
that referenced
this pull request
Apr 12, 2021
* Merge pull request #1265 from ulugbekna/fix-same-file-comments * Add more doc-related tests
voodoos
added a commit
that referenced
this pull request
Apr 12, 2021
* Merge pull request #1265 from ulugbekna/fix-same-file-comments * Add more doc-related tests
This was
linked to
issues
Apr 12, 2021
This was
unlinked from
issues
Apr 12, 2021
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Apr 13, 2021
CHANGES: Tue Apr 12 11:44:22 AM CET 2021 + merlin binary - external configuration reading: + use relative paths to communicate with Dune when possible. This solves issues related to symlinks on Unix and improve Windows support (ocaml/merlin#1271, fixes ocaml/merlin#1288) + make the `workdir` configuration value when using the `dune ocaml-merlin` configuration provider the same as when using `dot-merlin-reader` so that ppxes behaves in the same way as before (ocaml/merlin#1284, fixes ocaml/dune#4479, discussion in ocaml/merlin#1292) - destruct: + improve prefixing of generated constructors in Destruct by filtering opened modules (ocaml/merlin#1277) + make the destruct command more resilient to ill-typed expressions and when called without nodes (ocaml/merlin#1304, fixes ocaml/merlin#1300) - reintroduce some record recovery and improve completion (ocaml/merlin#1276) - introduce a new AST node for holes (`_`), allow correct typing of these holes and add a new `holes` command that returns the locations of all holes in the current file along with their types (ocaml/merlin#1242, ocaml/merlin#1289) - Mppx: don't restore cookies after invocation. Ppx are invoked only once so there is no need to manage cookies. This small change should increase performance and should not change any other behavior (ocaml/merlin#1309) - Windows: system command variant: do not open a window console when launching a ppx (ocaml/merlin#1270, fixes ocaml/merlin#714) - fix same file documentation bug (ocaml/merlin#1265 by @ulugbekna, fixes ocaml/merlin#1261) + editor modes - vim: Add `MerlinNextHole` and `MerlinPreviousHole` commands to navigate between holes. Jump to the first hole after destruct (ocaml/merlin#1287, ocaml/merlin#1303) - emacs: Add `merlin-next-hole` and `merlin-previous-hole` commands to navigate holes. Jump to the first hole after calling destruct. (ocaml/merlin#1291) - emacs: modernization of the elisp code and conformance with coding guidelines (ocaml/merlin#1247, ocaml/merlin#1310 by Steve Purcell ) - vim & emacs : new client-side "merlin use package" commands, restoring previous behavior (ocaml/merlin#1272, fixes ocaml/merlin#1191) + test suite - cover constructor disambiguation and record fields (ocaml/merlin#1276) - cover the new `holes` command and AST node (ocaml/merlin#1242, ocaml/merlin#1289) - cover the document fix (ocaml/merlin#1265, ocaml/merlin#1315)
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Apr 13, 2021
CHANGES: Tue Apr 12 11:44:22 AM CET 2021 + merlin binary - external configuration reading: + use relative paths to communicate with Dune when possible. This solves issues related to symlinks on Unix and improve Windows support (ocaml/merlin#1271, fixes ocaml/merlin#1288) + make the `workdir` configuration value when using the `dune ocaml-merlin` configuration provider the same as when using `dot-merlin-reader` so that ppxes behaves in the same way as before (ocaml/merlin#1284, fixes ocaml/dune#4479, discussion in ocaml/merlin#1292) - destruct: + improve prefixing of generated constructors in Destruct by filtering opened modules (ocaml/merlin#1277) + make the destruct command more resilient to ill-typed expressions and when called without nodes (ocaml/merlin#1304, fixes ocaml/merlin#1300) - reintroduce some record recovery and improve completion (ocaml/merlin#1276) - introduce a new AST node for holes (`_`), allow correct typing of these holes and add a new `holes` command that returns the locations of all holes in the current file along with their types (ocaml/merlin#1242, ocaml/merlin#1289) - Mppx: don't restore cookies after invocation. Ppx are invoked only once so there is no need to manage cookies. This small change should increase performance and should not change any other behavior (ocaml/merlin#1309) - Windows: system command variant: do not open a window console when launching a ppx (ocaml/merlin#1270, fixes ocaml/merlin#714) - fix same file documentation bug (ocaml/merlin#1265 by @ulugbekna, fixes ocaml/merlin#1261) + editor modes - vim: Add `MerlinNextHole` and `MerlinPreviousHole` commands to navigate between holes. Jump to the first hole after destruct (ocaml/merlin#1287, ocaml/merlin#1303) - emacs: Add `merlin-next-hole` and `merlin-previous-hole` commands to navigate holes. Jump to the first hole after calling destruct. (ocaml/merlin#1291) - emacs: modernization of the elisp code and conformance with coding guidelines (ocaml/merlin#1247, ocaml/merlin#1310 by Steve Purcell ) - vim & emacs : new client-side "merlin use package" commands, restoring previous behavior (ocaml/merlin#1272, fixes ocaml/merlin#1191) + test suite - cover constructor disambiguation and record fields (ocaml/merlin#1276) - cover the new `holes` command and AST node (ocaml/merlin#1242, ocaml/merlin#1289) - cover the document fix (ocaml/merlin#1265, ocaml/merlin#1315)
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Apr 13, 2021
CHANGES: Tue Apr 12 11:44:22 AM CET 2021 + merlin binary - external configuration reading: + use relative paths to communicate with Dune when possible. This solves issues related to symlinks on Unix and improve Windows support (ocaml/merlin#1271, fixes ocaml/merlin#1288) + make the `workdir` configuration value when using the `dune ocaml-merlin` configuration provider the same as when using `dot-merlin-reader` so that ppxes behaves in the same way as before (ocaml/merlin#1284, fixes ocaml/dune#4479, discussion in ocaml/merlin#1292) - destruct: + improve prefixing of generated constructors in Destruct by filtering opened modules (ocaml/merlin#1277) + make the destruct command more resilient to ill-typed expressions and when called without nodes (ocaml/merlin#1304, fixes ocaml/merlin#1300) - reintroduce some record recovery and improve completion (ocaml/merlin#1276) - introduce a new AST node for holes (`_`), allow correct typing of these holes and add a new `holes` command that returns the locations of all holes in the current file along with their types (ocaml/merlin#1242, ocaml/merlin#1289) - Mppx: don't restore cookies after invocation. Ppx are invoked only once so there is no need to manage cookies. This small change should increase performance and should not change any other behavior (ocaml/merlin#1309) - Windows: system command variant: do not open a window console when launching a ppx (ocaml/merlin#1270, fixes ocaml/merlin#714) - fix same file documentation bug (ocaml/merlin#1265 by @ulugbekna, fixes ocaml/merlin#1261) + editor modes - vim: Add `MerlinNextHole` and `MerlinPreviousHole` commands to navigate between holes. Jump to the first hole after destruct (ocaml/merlin#1287, ocaml/merlin#1303) - emacs: Add `merlin-next-hole` and `merlin-previous-hole` commands to navigate holes. Jump to the first hole after calling destruct. (ocaml/merlin#1291) - emacs: modernization of the elisp code and conformance with coding guidelines (ocaml/merlin#1247, ocaml/merlin#1310 by Steve Purcell ) - vim & emacs : new client-side "merlin use package" commands, restoring previous behavior (ocaml/merlin#1272, fixes ocaml/merlin#1191) + test suite - cover constructor disambiguation and record fields (ocaml/merlin#1276) - cover the new `holes` command and AST node (ocaml/merlin#1242, ocaml/merlin#1289) - cover the document fix (ocaml/merlin#1265, ocaml/merlin#1315)
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Apr 13, 2021
CHANGES: Tue Apr 12 11:44:22 AM CET 2021 + merlin binary - external configuration reading: + use relative paths to communicate with Dune when possible. This solves issues related to symlinks on Unix and improve Windows support (ocaml/merlin#1271, fixes ocaml/merlin#1288) + make the `workdir` configuration value when using the `dune ocaml-merlin` configuration provider the same as when using `dot-merlin-reader` so that ppxes behaves in the same way as before (ocaml/merlin#1284, fixes ocaml/dune#4479, discussion in ocaml/merlin#1292) - destruct: + improve prefixing of generated constructors in Destruct by filtering opened modules (ocaml/merlin#1277) + make the destruct command more resilient to ill-typed expressions and when called without nodes (ocaml/merlin#1304, fixes ocaml/merlin#1300) - reintroduce some record recovery and improve completion (ocaml/merlin#1276) - introduce a new AST node for holes (`_`), allow correct typing of these holes and add a new `holes` command that returns the locations of all holes in the current file along with their types (ocaml/merlin#1242, ocaml/merlin#1289) - Mppx: don't restore cookies after invocation. Ppx are invoked only once so there is no need to manage cookies. This small change should increase performance and should not change any other behavior (ocaml/merlin#1309) - Windows: system command variant: do not open a window console when launching a ppx (ocaml/merlin#1270, fixes ocaml/merlin#714) - fix same file documentation bug (ocaml/merlin#1265 by @ulugbekna, fixes ocaml/merlin#1261) + editor modes - vim: Add `MerlinNextHole` and `MerlinPreviousHole` commands to navigate between holes. Jump to the first hole after destruct (ocaml/merlin#1287, ocaml/merlin#1303) - emacs: Add `merlin-next-hole` and `merlin-previous-hole` commands to navigate holes. Jump to the first hole after calling destruct. (ocaml/merlin#1291) - emacs: modernization of the elisp code and conformance with coding guidelines (ocaml/merlin#1247, ocaml/merlin#1310 by Steve Purcell ) - vim & emacs : new client-side "merlin use package" commands, restoring previous behavior (ocaml/merlin#1272, fixes ocaml/merlin#1191) + test suite - cover constructor disambiguation and record fields (ocaml/merlin#1276) - cover the new `holes` command and AST node (ocaml/merlin#1242, ocaml/merlin#1289) - cover the document fix (ocaml/merlin#1265, ocaml/merlin#1315)
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Apr 13, 2021
CHANGES: Tue Apr 12 11:44:22 AM CET 2021 + merlin binary - external configuration reading: + use relative paths to communicate with Dune when possible. This solves issues related to symlinks on Unix and improve Windows support (ocaml/merlin#1271, fixes ocaml/merlin#1288) + make the `workdir` configuration value when using the `dune ocaml-merlin` configuration provider the same as when using `dot-merlin-reader` so that ppxes behaves in the same way as before (ocaml/merlin#1284, fixes ocaml/dune#4479, discussion in ocaml/merlin#1292) - destruct: make the destruct command more resilient to ill-typed expressions and when called without nodes (ocaml/merlin#1304, fixes ocaml/merlin#1300) - Mppx: don't restore cookies after invocation. Ppx are invoked only once so there is no need to manage cookies. This small change should increase performance and should not change any other behavior (ocaml/merlin#1309) - windows: + system command variant: do not open a window console when launching a ppx (ocaml/merlin#1270, fixes ocaml/merlin#714) + fix Emacs hanging when starting Merlin (ocaml/merlin#1263) + fix path canonicalization (ocaml/merlin#1254) - fix same file documentation bug (ocaml/merlin#1265 by @ulugbekna, fixes ocaml/merlin#1261) + editor modes - emacs: + modernization of the elisp code and conformance with coding guidelines (ocaml/merlin#1247, ocaml/merlin#1310 by Steve Purcell ) + use opam var where applicable (ocaml/merlin#1310) + fix "wrong number of argument" (ocaml/merlin#1250 by @atharvashukla, fixes ocaml/merlin#1234) + fix for Neovim's CursorMoved semantics (ocaml/merlin#1213 by @ddickstein) - vim & emacs : new client-side "merlin use package" commands, restoring previous behavior (ocaml/merlin#1272, fixes ocaml/merlin#1191) + test suite - cover the document fix (ocaml/merlin#1265, ocaml/merlin#1315)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi!
Fixes #1261
tl;dr
Ocamldoc.associate_comment
needs a list of doc-comments from the start to the end of file (non-decreasing positions of comments), butLocate.get_doc
returned the comments from the end to the start of the file (non-increasing positions of comments). The last doc-comment was available because the last elem of non-decr list = head of non-incr list.More detailed:
Ocamldoc.associate_comment
takes a list of doc-comments (with their positions) from a file and compares positions of those comments with the positionp
of the cursor. If a doc-commentd
with positionp1
hasp1 > p
(ie documentation occurs later in the file thanp
), it considered there the list doesn't contain documentation for positionp
. (see code)Since
Locate.get_doc
was returningList.rev comments
, it returned doc-comments in a non-decreasing order, which meant that head of the list would have position "larger" thanp
causing theassociate_comment
returnNone
.