diff --git a/doc/mason.txt b/doc/mason.txt index a30f1510..a2c2359a 100644 --- a/doc/mason.txt +++ b/doc/mason.txt @@ -14,11 +14,15 @@ the `server.cmd` setting (see |rustaceanvim.config| and |RustaceanLspClientOpts| server = { cmd = function() local mason_registry = require('mason-registry') - local ra_binary = mason_registry.is_installed('rust-analyzer') - -- This may need to be tweaked, depending on the operating system. - and mason_registry.get_package('rust-analyzer'):get_install_path() .. "/rust-analyzer" - or "rust-analyzer" - return { ra_binary } -- You can add args to the list, such as '--log-file' + if mason_registry.is_installed('rust-analyzer') then + -- This may need to be tweaked depending on the operating system. + local ra = mason_registry.get_package('rust-analyzer') + local ra_filename = ra:get_receipt():get().links.bin['rust-analyzer'] + return { ('%s/%s'):format(ra:get_install_path(), ra_filename or 'rust-analyzer') } + else + -- global installation + return { 'rust-analyzer' } + end end, }, }