Issue with ms python language server and kak-lsp

I would open an issue with kak-lsp or the language server but I’m having trouble figuring out what the issue even is.

I’m trying to switch from palantir’s python language server to microsoft’s after multiple issues with it crashing after updates and issues configuring 3rd party plugins (mypy and black) even with it working.

I changed the python section in kak-lsp to command="Microsoft.Python.LanguageServer"(which is currently symlinked to my local bin) instead of 'command=pyls`. I can launch it from the command line so at the very least I know it’s not crashing.

after realizing there was an issue when testing a few python files and not getting any notifications from the language server and enabled debug logging.

9468    |  Aug 26 14:30:30.352 DEBG Searching for vars starting with KAK_LSP_PROJECT_ROOT_PYTHON, module: kak_lsp::project_root:46
9469   │ Aug 26 14:30:30.352 DEBG Routing editor request to Route { session: "55079", language: "python", root: "/home/daedalus/Workspace/Writing/journaling_tools" }, module: kak_lsp::session:
       │ 95
9470   │ Aug 26 14:30:30.352 DEBG Spawning a new controller for Route { session: "55079", language: "python", root: "/home/daedalus/Workspace/Writing/journaling_tools" }, module: kak_lsp::sess
       │ ion:117
9471   │ Aug 26 14:30:30.353 INFO Starting Language server `pyls `, module: kak_lsp::language_server_transport:21
9472   │ Aug 26 14:30:30.353 ERRO panic: panicked at 'Failed to start language server: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/
       │ 2:21, module: kak_lsp:252
9473   │ Aug 26 14:30:32.199 DEBG From editor:
9474   │ session  = "55079"
9475   │ client   = ""
9476   │ buffile  = ""
9477   │ filetype = ""
9478   │ version  = 0
9479   │ method   = "stop"

the issue seems to be it’s trying to default to pyls despite the toml being updated, and I used ripgrep to search for mentions of pyls starting in the kakrc directory through the plugins, and the only mention left in the lsp was in a comment inside so I’m not sure why it is trying to run that as the command.

If it is still looking for pyls, sounds like there is an issue with kak-lsp.toml that you changed. I believe it is supposed to be in ~/.config/kak-lsp/kak-lsp.toml, is that where you changed the command for [language.python] entry? You can also follow the troubleshooting steps here and see if you see anything different.

Not related to the issue you ran into, but I had to add certain initialization options to get it to work. I have my changes here that I made when experimenting. Specifically, I believe you at least need the lsp_server_initialization_options here. FYI after that I still wasn’t sure if I got it to work correctly since it was returning fewer diagnostics than I expected and I wasn’t sure I got it to start properly every time, so I went back to pyls.

ahh. I made the config directory and copied the toml file from the plugin home to ~/.config/kak-lsp/ and now it’s reading the changes.

the new issue is kak-lsp: python language server error: 'Object reference not set to an instance of an object.' but that is kind of expected.

apparently users of the emacs lsp-ui plugin had to make some changes when migrating from palantir’s language server, so I figured it wouldn’t work out of the box.

Thanks btw, I didn’t realize kak-lsp was supposed to have it’s own config directory.

Edit: I didn’t realize you had already got this working, I just looked at the dotfiles. lol sorry about that, I probably need to get some food.