-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
feat(diagnostics): focus preview window when invoking commands again with current
argument
#607
Conversation
Review ChecklistDoes this PR follow the Contribution Guidelines? Following is a partial checklist: Proper conventional commit scoping:
If applicable:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🙏
- I generally avoid breaking changes until I bump the minimum required Nvim version. This will have to be kept backward compatible for now.
If something is to be removed with the next major version bump and it has an alternative, it can be marked as deprecated withvim.deprecate
. - The diff appears to only show deletions. Did something not get staged?
- Note (for when/if command arguments are removed): The commit prefix would have to be
feat!
, notrefactor
. A refactor does not change behaviour or features.!
indicates a breaking change. See https://conventionalcommits.org.
|
The commit logs have been amended, but for the deprecation part, If you would permit, I can open up another PR adding these warnings to users. My rationale being that it would be easier to merge this one once you bump the major version. ( but I don't have much experience with nvim plugin's deprecation process, please correct me if I'm wrong) |
Sorry if I wasn't clear in my last comment. |
Sorry for the misunderstanding, and taking your time to explain the process. I have updated the PR according to your specifications, linted according to your contribution guidelines, and tested manually since busted doesn't work on my machine. (also I hope it's not introducing any complexities to your code since it basically changed some parameters back to default, and moved two function calls around) |
This would cover my use case (thanks in advance!), and for the deprecation and remove part, I can work on it later. I personally would like to remove that argument because:
|
The current diff only shows deletions plus two Regarding the commands, I would suggest three arguments: Also: From what I can tell from this PRs description, you appear to be working on two different features:
Please split them into separate PRs, with appropriate titles (so they are easier to grok and so that each feature gets an entry in the changelog). The focus feature is not as simple as what I can see in the current diff. If called with a |
This IS right, as I have already stated many times before, please see the commit message:
I removed the your parameter I have to admit I am new to the nvim plugin scene, however, I submitted this PR with good faith with the goal of making it more consistent with current nvim lsp integration. As I have stated before, if you don't trust me, you can test it your self.
My initial PR is indeed doing this, however since you said:
I have changed it to only include the focus feature I have mentioned, with NO changes to any arguments. Also, as I have stated above, I think the cycle argument is un-necessary, (Please see my comment above), and I can help you add a obselete message, and clean up the code. However, I have no intention on adding more stuff. |
This comment was marked as resolved.
This comment was marked as resolved.
:rustLsp renderDiagnoistics current
and :rustLsp explainError current
again will focus the hover popup
You stated, "Breaking changes to user-side and technical info are documented in my commit messages.". Please keep in mind that I maintain this plugin (which includes reviewing PRs) in my free time. I am quite busy right now and will test your PR later. |
First of all, I'm extremely sorry for the misunderstanding and blaming you because I honestly thought you are ignoring my commit messages.
Because 1. it's already explained in the commit, and 2. github PR description is not embedded in git, so someone cloning or forking the git repository is unable to see the PR description attached to the commits. However, I see this is a personal perference, so from now on for any future PRs I will also attach description in PR.
Well, the title was my fault, I'm not a native English speaker and since the PR was supposed to have other stuff, which you rejected, and I updated the code but forgot to update it led me to do this, I hope the current title is descriptive enough. :)
I really appreciate your effort, and I had been a happy user for months, which led me wanting to contribute to your repo :).
Well that was caused by our misunderstanding, and I believe I have hopefully kept my language direct and plain. In the future I will take it in mind and try my best to keep my language concise.
Thank you for taking your time to maintain this and explaining your thoughts to me. I apologize again for taking up your free time, and please take the review slow, I'm not in a hurry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave it a test drive and it seems to be working nicely.
Thanks for the contribution 🙏
:rustLsp renderDiagnoistics current
and :rustLsp explainError current
again will focus the hover popupcurrent
argument
current
argumentcurrent
argument
According to neovim's documentation for vim.lsp.util.open_floating_preview: > If `true`, and if {focusable} is also `true`, focus an existing floating > window with the same {focus_id} > (default: `true`) > @field focus? boolean Removing the focus=false, and removing call to close_hover enable users to enter the hover.
Update: updated the description according mrcjkb's newest requirements.
As the title said, running the commands twice will focus the pop up instead of closing the hover and opening it again.
According to neovim's documentation for
vim.lsp.util.open_floating_preview:
Removing the focus=false, and removing call to close_hover enable users
to enter the hover.
I removed the your parameter focus=false, so that nvim will use the default parameter focus=true, then when calling the open_floating_preview twice, it would focus an existing floating window with the same {focus_id}.
If you have any other questions or understanding the code, please run
:h vim.lsp.util.open_floating_preview()
or check outruntime/lua/vim/lsp/util.lua:1520
in neovim's source code for their implementation.