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

🐛 Windows: allow binary without extension #3093

Merged
merged 2 commits into from
May 14, 2024

Conversation

ras0q
Copy link
Contributor

@ras0q ras0q commented May 9, 2024

Description

In Windows, if only rg without extension is installed and rg.exe is not for some reason, checkhealth had failed previously.
This PR allows binaries without extensions to be recognised in Windows.

FIXME: In Windows environment, io.popen(binary .. " --version") does not return any outputs. How can I fix it?

Checking external dependencies ~
- OK rg: found 
- OK fd: found 

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list relevant details about your configuration

  • confirm that binaries without extensions are recognised in Windows

Configuration:

  • Neovim version (nvim --version): v0.9.5
  • Operating system and version: Windows 11

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

Copy link
Contributor

@jamestrew jamestrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's kinda weird that we need to check for vim.fn.executable("rg.exe") even when rg is installed.

lua/telescope/health.lua Outdated Show resolved Hide resolved
@ras0q ras0q closed this May 12, 2024
@ras0q ras0q deleted the fix/windows-check-binary branch May 12, 2024 15:22
@ras0q ras0q restored the fix/windows-check-binary branch May 12, 2024 15:22
@ras0q
Copy link
Contributor Author

ras0q commented May 12, 2024

Sorry, I deleted the branch by mistake. I've reopened the PR.

@ras0q ras0q reopened this May 12, 2024
Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>
@ras0q
Copy link
Contributor Author

ras0q commented May 12, 2024

Thank you for review!

we need to check for vim.fn.executable("rg.exe") even when rg is installed.

I believe I wrote it to check for rg.exe only if rg was not found, is this code correct?

@jamestrew
Copy link
Contributor

I believe I wrote it to check for rg.exe only if rg was not found, is this code correct?

yes, I think this is ok.
before I merge, I'd like it if you can try my suggestion. Maybe this can help with the issue of not getting the version number.

@jamestrew jamestrew merged commit 29fddf7 into nvim-telescope:master May 14, 2024
9 checks passed
@jamestrew
Copy link
Contributor

thanks!

Conni2461 pushed a commit that referenced this pull request May 20, 2024
* 🐛 Windows: allow binary without extension

* show `(unknown version)` if parse failed

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>

---------

Co-authored-by: ras0q <ras0q@users.noreply.github.com>
Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>
(cherry picked from commit 29fddf7)
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

2 participants