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

This allows this plugin to work with codeium enterprise #36

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

LeonardoMor
Copy link
Contributor

@LeonardoMor LeonardoMor commented Sep 15, 2024

While looking at #35, I realized that the even if the language server binary was downloaded and extracted correctly, this was not going to work.

The problem was that the final url to the API was not formatted correctly.

To handle the binary situation, I added a check, if it fails then the binary is downloaded from GitHub.

Both these issues have been fixed here.

Tested both with and without codeium enterprise. As far as I can tell all functionality remains the same.

Ouput of :checkhealth neocodeium:


==============================================================================
neocodeium: require("neocodeium.health").check()

System information: ~
- *linux* *(x64)*
  If it is not correctly detected, then consider to report a bug at
  https://github.com/monkoose/neocodeium/issues

Checks: ~
- OK *curl* is installed
- OK *API* *key* is present
- OK *Server* *binary* exists: ~/.codeium/bin/1.14.12/language_server_linux_x64
- OK *Server* is running on port 43177 with pid 1685253

Commits:

LeonardoMor and others added 3 commits September 14, 2024 19:03
Fallback to the GitHub url if the url formed with the given portal is
not valid.
local valid_url = vim.system(
{ "curl", "--head", "--silent", "--fail", url },
{ stdout = false }
)
Copy link
Owner

Choose a reason for hiding this comment

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

I think this block is skipped without ):wait() and url changed after

vim.system(
{ "curl", "-Lo", self.path .. ".gz", url },
{ stdout = false },
vim.schedule_wrap(function(o)
if o.code ~= 0 then
echo.error("failed to download binary\n" .. o.stderr)
return
end
if callback then
callback()
end
end)
)
end

@monkoose monkoose merged commit 1ad72b9 into monkoose:main Sep 16, 2024
2 checks passed
@LeonardoMor LeonardoMor deleted the enterprise_fix branch September 16, 2024 06:30
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.

NeoCodeium: failed to extract binary on enterprise
2 participants