I'm developing Eglot, an LSP client for emacs. If the following command
dotnet path/to/output/bin/Release/Microsoft.Python.LanguageServer.dll
is used to start the server , then this :initializationOptions is enough to get a minimal working server.
{"interpreter":{"properties":{"UseDefaultDatabase":true}}}
If, on the other hand, :initializationOptions is empty or missing from the :initialize request, the server errors immediately with
{"code":-32000,
"message":"Object reference not set to an instance of an object.",
"data":" at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Initialize(JToken token, CancellationToken cancellationToken) in /home/capitaomorte/Source/Csharp/python-language-server/src/LanguageServer/Impl/LanguageServer.Lifetime.cs:line 41"}
My question here is this: if the "database", whatever it means in your server, is the "default", shouldn't it be used when the user defaults on it, i.e. doesn't provide it?
It would be nice if the server, much like Palantir's pyls, could:
- use the best possible defaults
- deduce the remaining settings from its environment and
- use
:initializationOptions for allowing user/client tweaks to those settings.