Skip to content
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

misbehavior when omitting initializationOptions parameter to initialize #104

Closed
siegel opened this issue Mar 24, 2021 · 0 comments · Fixed by #111
Closed

misbehavior when omitting initializationOptions parameter to initialize #104

siegel opened this issue Mar 24, 2021 · 0 comments · Fixed by #111

Comments

@siegel
Copy link

siegel commented Mar 24, 2021

According to the protocol documentation, the initializationOptions parameter to initialize is optional. My client omits this parameter.

This morning I did pip uninstall jedi-language-server followed by pip install -U jedi-language-server. This appears to have updated dependencies as follows:

Installing collected packages: parso, jedi, jedi-language-server
  Attempting uninstall: parso
    Found existing installation: parso 0.7.1
    Uninstalling parso-0.7.1:
      Successfully uninstalled parso-0.7.1
  Attempting uninstall: jedi
    Found existing installation: jedi 0.17.2
    Uninstalling jedi-0.17.2:
      Successfully uninstalled jedi-0.17.2
Successfully installed jedi-0.18.0 jedi-language-server-0.28.7 parso-0.8.1

When starting the server, my client supplies the following parameters to initialize:

{
    capabilities =     {
        completion =         {
            completionItem =             {
                deprecatedSupport = 1;
                insertReplaceSupport = 1;
                insertTextModeSupport =                 {
                    valueSet =                     (
                        1,
                        2
                    );
                };
                preselectSupport = 1;
                snippetSupport = 1;
            };
        };
        textDocument =         {
            codeAction =             {
            };
            completion =             {
                completionItem =                 {
                    deprecatedSupport = 1;
                    insertReplaceSupport = 1;
                    insertTextModeSupport =                     {
                        valueSet =                         (
                            1,
                            2
                        );
                    };
                    preselectSupport = 1;
                    resolveSupport =                     {
                        properties =                         (
                            detail,
                            documentation
                        );
                    };
                    snippetSupport = 1;
                };
            };
            documentSymbol =             {
                hierarchicalDocumentSymbolSupport = 1;
                labelSupport = 1;
            };
            publishDiagnostics =             {
                categorySupport = 1;
                codeActionsInline = 1;
                codeDescription = 1;
                dataSupport = 1;
                relatedInformation = 1;
            };
            signatureHelp =             {
                signatureInformation =                 {
                    activeParameterSupport = 1;
                    parameterInformation =                     {
                        labelOffsetSupport = 1;
                    };
                };
            };
            synchronization =             {
                didSave = 1;
                willSave = 1;
            };
        };
        workspace =         {
            workspaceFolders = 1;
        };
    };
    processId = 16817;
    rootUri = "<null>";
    trace = verbose;
    workspaceFolders =     (
    );
}

The server then sends a notification:

{
    jsonrpc = "2.0";
    method = "window/showMessage";
    params =     {
        message = "Invalid InitializationOptions, using defaults: 1 validation error for InitializationOptions\n__root__\n  InitializationOptions expected dict not NoneType (type=type_error)";
        type = 1;
    };
}

However, the server never responds to the initialize request, even with an error, and so the client is left hanging.

So, the two issues I'm reporting are:

  1. The server needs to allow initialize to succeed if initializationOptions is absent from the parameters.
  2. If an error occurs during handling of an initialize call, please make sure that it is returned to the client, and that the server doesn't stall or hang. (The server could exit at that point, and my client can handle that case, but is probably not the ideal behavior.)

(Followup: it's possible that the hang is unrelated; after adding an empty dictionary for initializationOptions, I'm finding that the server still never returns from the initialize request, and that there's a Python process eating 100% CPU.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant