diff options
| author | William Boman <william@redwill.se> | 2022-09-14 14:40:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-14 12:40:38 +0000 |
| commit | 07d949a21aff4c8a379a36ac3e457027efe3a1fe (patch) | |
| tree | 647563e13e936095bc49b94979317c30ec4a5081 /lua/mason-registry/r-languageserver/init.lua | |
| parent | chore: update generated code (#416) (diff) | |
| download | mason-07d949a21aff4c8a379a36ac3e457027efe3a1fe.tar mason-07d949a21aff4c8a379a36ac3e457027efe3a1fe.tar.gz mason-07d949a21aff4c8a379a36ac3e457027efe3a1fe.tar.bz2 mason-07d949a21aff4c8a379a36ac3e457027efe3a1fe.tar.lz mason-07d949a21aff4c8a379a36ac3e457027efe3a1fe.tar.xz mason-07d949a21aff4c8a379a36ac3e457027efe3a1fe.tar.zst mason-07d949a21aff4c8a379a36ac3e457027efe3a1fe.zip | |
fix(r-languageserver): use github releases as version source (#417)
Diffstat (limited to 'lua/mason-registry/r-languageserver/init.lua')
| -rw-r--r-- | lua/mason-registry/r-languageserver/init.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lua/mason-registry/r-languageserver/init.lua b/lua/mason-registry/r-languageserver/init.lua index 10d576b8..fd7d0292 100644 --- a/lua/mason-registry/r-languageserver/init.lua +++ b/lua/mason-registry/r-languageserver/init.lua @@ -1,8 +1,11 @@ local Pkg = require "mason-core.package" local path = require "mason-core.path" +local github_client = require "mason-core.managers.github.client" +local github = require "mason-core.managers.github" ---@param install_dir string -local function create_install_script(install_dir) +---@param ref string +local function create_install_script(install_dir, ref) return ([[ options(langserver_library = %q); options(langserver_quiet = FALSE); @@ -32,10 +35,11 @@ loadNamespace("languageserversetup", lib.loc = rlsLib); languageserversetup::languageserver_install( fullReinstall = FALSE, confirmBeforeInstall = FALSE, - strictLibrary = TRUE + strictLibrary = TRUE, + ref = %q ); library("languageserver", lib.loc = rlsLib); -]]):format(install_dir) +]]):format(install_dir, ref) end ---@param install_dir string @@ -58,16 +62,17 @@ return Pkg.new { ---@async ---@param ctx InstallContext install = function(ctx) + local source = github.release_version { repo = "REditorSupport/languageserver" } + source.with_receipt() ctx.spawn.R { "--no-save", on_spawn = function(_, stdio) local stdin = stdio[1] - stdin:write(create_install_script(ctx.cwd:get())) + stdin:write(create_install_script(ctx.cwd:get(), source.release)) stdin:close() end, } ctx.fs:write_file("server.R", create_server_script(ctx.package:get_install_path())) - ctx.receipt:with_primary_source(ctx.receipt.r_package "languageserver") ctx:link_bin( "r-languageserver", |
