-
Notifications
You must be signed in to change notification settings - Fork 9
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
How to set up this LSPServer in neovim or vim? #3
Comments
The LSPServer package provides a Wolfram Language LSP server for any LSP client, so if your vim or neovim has LSP client support, then it should definitely work just fine. What have you tried so far? |
Maybe necro bump and not relevant, but I want to document it somewhere. With Kate I also hade some trouble setting up LSPServer, here is how I solved it. First I ran the provided PacletInstall commands inside Mathematica, that is documented (mostly) clearly and worked without issue. However the documentation felt a bit ambiguous about the version information, as first I thougth it is also only available from 13+ based on the Setup while I was running 12.2. Based on my experience now I understand that from 13+ you don't have to run PacletInstall and it is needed (but works!) on earlier versions. What I needed next was a command that Kate can run to fire up the server, however the oneliner with arguments did not work, so I created a script file (under Linux it was a bash script, but I think bat file under Windows, or the equivalent under Mac works the same) that contains the following: #! /bin/bash
WolframKernel -noinit -noprompt -nopaclet -noicon -nostartuppaclets -run 'Needs["LSPServer`"];LSPServer`StartServer[]' and provided the script to the lspclient. The oneliner does not look the same as in the "Using LSPServer" section in the readme. I copied it from the sublime extensions source code, here: https://github.com/WolframResearch/Sublime-WolframLanguage/blob/master/WolframLanguage.sublime-settings#L21-L36 I'm not sure why it differs from the readme. If I may suggest, please update the 'Using LSPServer" section of the Readme with some hints around the used arguments and that it is not just a test, however this should be given also to the lspclient. It may be evident to someone with knowledge around the protocol, but it took me a couple of hours to figure out. Also, to leave a positive comment as well, I really like the fact that Wolfram Mathematica contains everything essential to be used even without the notebook frontend. 🎉 |
Thank you for the feedback. A possible source of confusion about versions may be about the specific versions that appear in the paths for WolframKernel. When talking about the full path to WolframKernel on your machine, I like to give the default location for the latest version, so for example on Windows, it would be: And this will be updated when 13.2 is released. But this in no way implies that 13.1 is required. In fact, if you built from sources, you would be to go back to using version 12.1. I'd like to understand any suggestion for better documentation around version information. I will work to update the "Using LSPServer" section to be more clear. Thanks again! |
I can confirm that @hooger's solution works in Neovim (nightly). Here is part of my config that shows how to setup Wolfram Language Server:
Note that:
|
Hello @even4void I am having some problems connecting Wolfram LSP and neovim, could you provide some more details about your config file? It should be placed under init.vim ? Do you think it is possible to provide wolfram language support using COC ? |
I put everything related to LSP in a dedicated file (http://ix.io/4rAH), then require it from my init fiile (http://ix.io/4rAI), or rather a separate file (http://ix.io/4rAJ) where I manage plugins. I don't know about your config, but the above config is tied to a proper setup of nvim-lspconfig. I don't use COC so I can't tell if these settings apply in this case (probably not, since COC uses its own setup). |
I have this working using the following settings inside my
Essentially, starts the LSP each time a mathematica file is opened. |
Was anyone able to setup with CoC? While I set it up to start the server, it stops at
|
I am a neovim 0.7+ user. It would be great there is some support for the lsp setup for neovim.
Thanks a lot in advance for any suggestions.
The text was updated successfully, but these errors were encountered: