-
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
Vim: Project-wide Occurrences #1767
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
This avoids loading a different version of the plugin or loading the installed plugin while developing locally.
The new command :MerlinOccurrencesProjectWide acts similarly to :MerlinOccurrences except that: - It uses project-wide occurrences. - It uses the quickfix list instead of the location list. - It doesn't show text extract in the list.
from other computations. This function is likely to be reused later.
Files containing occurrences are read in a first step and lines containing an occurrence are kept in memory. Vim potentially has open buffers for some of these files but this couldn't be used reliably as unused buffers would be emptied of their content. We don't open new buffers as that could trigger expensive function in plugins and would use more memory.
voodoos
force-pushed
the
vim_projectwideoccurrences_m
branch
from
June 4, 2024 15:36
307c450
to
db463ee
Compare
21 tasks
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Jun 18, 2024
CHANGES: Tue Jun 18 12:00:42 CEST 2024 + merlin binary - Support project-wide occurrences queries using index files (ocaml/merlin#1766) - The file format is described in library `Merlin_lib.index_format` - Two new configuration directives are introduced: - `SOURCE_ROOT` that is used to resolve relative paths found in the indexes. - `INDEX` that is used to declare the list of index files Merlin should use when looking for occurrences. - A new `UNIT_NAME` configuration directive that can be used to tell Merlin the correct name of the current unit in the presence of wrapping (ocaml/merlin#1776) - Perform incremental indexation of the buffer when typing. (ocaml/merlin#1777) - `merlin-lib.commands`: Add a `find_command_opt`` alternative to `find_command` that does not raise (ocaml/merlin#1778) - Prevent uid clashes by not returning PWO for defs located in the current interface file (ocaml/merlin#1781) - Reset uid counters when restoring the typer cache so that uids are stable across re-typing (ocaml/merlin#1779) - Improve the behavior on occurrences when the cursor is on a label / constructor declaration (ocaml/merlin#1785) + editor modes - emacs: add basic support for project-wide occurrences (ocaml/merlin#1766) - vim: add basic support for project-wide occurrences (ocaml/merlin#1767, @Julow)
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Jun 18, 2024
CHANGES: Tue Jun 18 12:00:42 CEST 2024 + merlin binary - Support project-wide occurrences queries using index files (ocaml/merlin#1766) - The file format is described in library `Merlin_lib.index_format` - Two new configuration directives are introduced: - `SOURCE_ROOT` that is used to resolve relative paths found in the indexes. - `INDEX` that is used to declare the list of index files Merlin should use when looking for occurrences. - A new `UNIT_NAME` configuration directive that can be used to tell Merlin the correct name of the current unit in the presence of wrapping (ocaml/merlin#1776) - Perform incremental indexation of the buffer when typing. (ocaml/merlin#1777) - `merlin-lib.commands`: Add a `find_command_opt`` alternative to `find_command` that does not raise (ocaml/merlin#1778) - Prevent uid clashes by not returning PWO for defs located in the current interface file (ocaml/merlin#1781) - Reset uid counters when restoring the typer cache so that uids are stable across re-typing (ocaml/merlin#1779) - Improve the behavior on occurrences when the cursor is on a label / constructor declaration (ocaml/merlin#1785) + editor modes - emacs: add basic support for project-wide occurrences (ocaml/merlin#1766) - vim: add basic support for project-wide occurrences (ocaml/merlin#1767, @Julow) [new release] ocaml-index (1.0) CHANGES: ### Added - Initial release. - The `aggregate`` command that finishes reduction of shapes in cmt files and store the output in a single index file. - The `stats` command that prints information about an index file. - The `dump` command that prints all locs of an index.
voodoos
added a commit
to voodoos/opam-repository
that referenced
this pull request
Jun 18, 2024
CHANGES: Tue Jun 18 12:00:42 CEST 2024 + merlin binary - Support project-wide occurrences queries using index files (ocaml/merlin#1766) - The file format is described in library `Merlin_lib.index_format` - Two new configuration directives are introduced: - `SOURCE_ROOT` that is used to resolve relative paths found in the indexes. - `INDEX` that is used to declare the list of index files Merlin should use when looking for occurrences. - A new `UNIT_NAME` configuration directive that can be used to tell Merlin the correct name of the current unit in the presence of wrapping (ocaml/merlin#1776) - Perform incremental indexation of the buffer when typing. (ocaml/merlin#1777) - `merlin-lib.commands`: Add a `find_command_opt`` alternative to `find_command` that does not raise (ocaml/merlin#1778) - Prevent uid clashes by not returning PWO for defs located in the current interface file (ocaml/merlin#1781) - Reset uid counters when restoring the typer cache so that uids are stable across re-typing (ocaml/merlin#1779) - Improve the behavior on occurrences when the cursor is on a label / constructor declaration (ocaml/merlin#1785) + editor modes - emacs: add basic support for project-wide occurrences (ocaml/merlin#1766) - vim: add basic support for project-wide occurrences (ocaml/merlin#1767, @Julow) [new release] ocaml-index (1.0) CHANGES: ### Added - Initial release. - The `aggregate`` command that finishes reduction of shapes in cmt files and store the output in a single index file. - The `stats` command that prints information about an index file. - The `dump` command that prints all locs of an index.
avsm
pushed a commit
to avsm/opam-repository
that referenced
this pull request
Sep 5, 2024
CHANGES: Tue Jun 18 12:00:42 CEST 2024 + merlin binary - Support project-wide occurrences queries using index files (ocaml/merlin#1766) - The file format is described in library `Merlin_lib.index_format` - Two new configuration directives are introduced: - `SOURCE_ROOT` that is used to resolve relative paths found in the indexes. - `INDEX` that is used to declare the list of index files Merlin should use when looking for occurrences. - A new `UNIT_NAME` configuration directive that can be used to tell Merlin the correct name of the current unit in the presence of wrapping (ocaml/merlin#1776) - Perform incremental indexation of the buffer when typing. (ocaml/merlin#1777) - `merlin-lib.commands`: Add a `find_command_opt`` alternative to `find_command` that does not raise (ocaml/merlin#1778) - Prevent uid clashes by not returning PWO for defs located in the current interface file (ocaml/merlin#1781) - Reset uid counters when restoring the typer cache so that uids are stable across re-typing (ocaml/merlin#1779) - Improve the behavior on occurrences when the cursor is on a label / constructor declaration (ocaml/merlin#1785) + editor modes - emacs: add basic support for project-wide occurrences (ocaml/merlin#1766) - vim: add basic support for project-wide occurrences (ocaml/merlin#1767, @Julow) [new release] ocaml-index (1.0) CHANGES: ### Added - Initial release. - The `aggregate`` command that finishes reduction of shapes in cmt files and store the output in a single index file. - The `stats` command that prints information about an index file. - The `dump` command that prints all locs of an index.
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.
This adds the
:MerlinOccurrencesProjectWide
command, that is very similar to:MerlinOccurrences
command but passes the -scope project flag and uses the quickfix list instead of the location list.Project-wide renames are not implemented and I don't think can be implemented easily. The substitution is done on Vim's side and opening an unbounded number of buffers could interact badly with plugins or different Vim configurations.
Perhaps project-wide renaming could be implemented by Merlin ?
Project-wide incremental search and rename are not implemented but could be in the future.
The same patch based on top of merlin with occurrences can be tested here: voodoos#11
To test this, I do: