Git Product home page Git Product logo

Comments (7)

jqno avatar jqno commented on July 28, 2024 1

Ah, my bad. I came from a setup without lspinstaller where the full path was handled by the script instead of the config object.
Since I use https://github.com/mfussenegger/nvim-jdtls, I still need to explicitly pass a workspace, and I forgot to update the cmd in the lua config.

Thanks for the quick and helpful response!

from nvim-lspinstall.

jqno avatar jqno commented on July 28, 2024 1

I'm using nvim-jdtls, so I can't use lspconfig's setup function for Java. I have to give it a config object, so I still have to define a cmd key. I've kept what I have, but changed the workspace parameter so that it now contains a full path.

I was unable to figure out how to get the config object including the cmd key from lspinstall, and use that as a basis. I'm still finding my way around Lua and Neovim's APIs 😅. So I figured I'd just hard code it for now and improve it later.

Is there a good way to get that config object, and/or a nice/official way to get the location of a language server for a given language? Right now I'm doing this: https://github.com/jqno/dotfiles/blob/4142375cd0961e1442f42128289acb7bc43c06aa/nvim/lua/filetypes/java.lua#L29

from nvim-lspinstall.

kabouzeid avatar kabouzeid commented on July 28, 2024 1

require'lspinstall/servers'.java.default_config

from nvim-lspinstall.

jqno avatar jqno commented on July 28, 2024

Also, now that I'm here: the script calls a command called die in two places, but my machine (a freshly installed Ubuntu 21.04) doesn't recognise it, and I can't find it via apt either. Googling it seems to turn up a lot of false positives about processes dying and whatnot. What do I need to install to make that work?

from nvim-lspinstall.

kabouzeid avatar kabouzeid commented on July 28, 2024

@jqno I copied parts of the script from kotlin lang server. Didn't realize die is a cmd local to the script (see: https://github.com/fwcd/kotlin-language-server/blob/58966bc18dd5bf82fdfcf7a2f44bab3622f6907a/server/src/test/resources/additionalWorkspace/gradlew#L56).
Thanks, will fix that.


$WORKSPACE should already be an absolute path

local install_path = require"lspinstall/util".install_path("java")
local workspace_name, _ = string.gsub(vim.fn.fnamemodify(new_root_dir, ":p"), "/", "-")
new_config.cmd = {
path.join { install_path, "jdtls.sh" },
path.join { install_path, "workspace", workspace_name },
}

I also just tested it to confirm

:lua print(require "lspconfig/util".path.join { require"lspinstall/util".install_path("java"), 'workspace', 'test' })

prints:

/Users/karim/.local/share/nvim/lspinstall/java/test

from nvim-lspinstall.

kabouzeid avatar kabouzeid commented on July 28, 2024

So now you've removed the cmd key from your config?

from nvim-lspinstall.

jqno avatar jqno commented on July 28, 2024

Thank you!

from nvim-lspinstall.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.