Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Julow
Copy link
Contributor

@Julow Julow commented May 15, 2024

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:

vim --cmd "set rtp^=vim/merlin" src/analysis/occurrences.ml

Julow added 6 commits May 15, 2024 17:05
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant