eclipse.jdt.ls icon indicating copy to clipboard operation
eclipse.jdt.ls copied to clipboard

Help! init request, but not response

Open Yurii-huang opened this issue 3 years ago • 4 comments

my request protocol data:

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "initialize",
    "params": {
        "capabilities": {
            "notebookDocument": {
                "synchronization": {
                    "dynamicRegistration": true,
                    "executionSummarySupport": true
                }
            },
            "textDocument": {
                "callHierarchy": {
                    "dynamicRegistration": true
                },
                "codeAction": {
                    "codeActionLiteralSupport": {
                        "codeActionKind": {
                            "valueSet": [
                                "",
                                "quickfix",
                                "refactor",
                                "refactor.extract",
                                "refactor.inline",
                                "refactor.rewrite",
                                "source",
                                "source.organizeImports",
                                "source.fixAll"
                            ]
                        }
                    },
                    "dataSupport": true,
                    "disabledSupport": false,
                    "dynamicRegistration": true,
                    "honorsChangeAnnotations": 1,
                    "isPreferredSupport": true,
                    "resolveSupport": {
                        "properties": [
                            "edit"
                        ]
                    }
                },
                "codeLens": {
                    "dynamicRegistration": true
                },
                "colorProvider": {
                    "dynamicRegistration": true
                },
                "completion": {
                    "completionItemKind": {
                        "valueSet": [
                            1,
                            2,
                            3,
                            4,
                            5,
                            6,
                            7,
                            8,
                            9,
                            10,
                            11,
                            12,
                            13,
                            14,
                            15,
                            16,
                            17,
                            18,
                            19,
                            20,
                            21,
                            22,
                            23,
                            24,
                            25
                        ]
                    },
                    "contextSupport": true,
                    "dynamicRegistration": true,
                    "insertTextMode": 1
                },
                "declaration": {
                    "dynamicRegistration": true,
                    "linkSupport": true
                },
                "definition": {
                    "dynamicRegistration": true
                },
                "diagnostic": {
                    "dynamicRegistration": true,
                    "relatedDocumentSupport": true
                },
                "documentLink": {
                    "dynamicRegistration": true,
                    "tooltipSupport": true
                },
                "documentSymbol": {
                    "dynamicRegistration": true,
                    "hierarchicalDocumentSymbolSupport": true,
                    "labelSupport": true,
                    "symbolKind": {
                        "valueSet": [
                            1,
                            2,
                            3,
                            4,
                            5,
                            6,
                            7,
                            8,
                            9,
                            10,
                            11,
                            12,
                            13,
                            14,
                            15,
                            16,
                            17,
                            18,
                            19,
                            20,
                            21,
                            22,
                            23,
                            24,
                            25,
                            26
                        ]
                    },
                    "tagSupport": {
                        "valueSet": [
                            1
                        ]
                    }
                },
                "foldingRange": {
                    "dynamicRegistration": true,
                    "foldingRange": {
                        "collapsedText": true
                    },
                    "foldingRangeKind": {
                        "valueSet": [
                            "comment",
                            "imports",
                            "region"
                        ]
                    },
                    "lineFoldingOnly": true,
                    "rangeLimit": 4294967295
                },
                "formatting": {
                    "dynamicRegistration": true
                },
                "hover": {
                    "contentFormat": "markdown",
                    "dynamicRegistration": true
                },
                "implementation": {
                    "dynamicRegistration": true,
                    "linkSupport": true
                },
                "inlayHint": {
                    "dynamicRegistration": true,
                    "resolveSupport": {
                        "properties": [
                            "label.location"
                        ]
                    }
                },
                "inlineValue": {
                    "dynamicRegistration": true
                },
                "linkedEditingRange": {
                    "dynamicRegistration": true
                },
                "moniker": {
                    "dynamicRegistration": true
                },
                "onTypeFormatting": {
                    "dynamicRegistration": true
                },
                "publishDiagnostics": {
                    "codeDescriptionSupport": true,
                    "dataSupport": true,
                    "relatedInformation": true,
                    "tagSupport": {
                        "valueSet": [
                            1,
                            2
                        ]
                    },
                    "versionSupport": true
                },
                "rename": {
                    "dynamicRegistration": true,
                    "honorsChangeAnnotations": true,
                    "prepareSupport": true,
                    "prepareSupportDefaultBehavior": 1
                },
                "selectionRange": {
                    "dynamicRegistration": true
                },
                "semanticTokens": {
                    "augmentsSyntaxTokens": true,
                    "dynamicRegistration": true,
                    "formats": [
                        "relative"
                    ],
                    "multilineTokenSupport": true,
                    "overlappingTokenSupport": true,
                    "request": {
                        "full": true,
                        "range": true
                    },
                    "serverCancelSupport": true,
                    "tokenModifiers": [
                        "declaration",
                        "definition",
                        "readonly",
                        "static",
                        "deprecated",
                        "abstract",
                        "async",
                        "modification",
                        "documentation",
                        "defaultLibrary"
                    ],
                    "tokenTypes": [
                        "namespace",
                        "type",
                        "class",
                        "enum",
                        "interface",
                        "struct",
                        "typeParameter",
                        "parameter",
                        "variable",
                        "property",
                        "enumMember",
                        "event",
                        "function",
                        "method",
                        "macro",
                        "keyword",
                        "modifier",
                        "comment",
                        "string",
                        "number",
                        "regexp",
                        "operator",
                        "decorator"
                    ]
                },
                "signatureHelp": {
                    "contextSupport": true,
                    "dynamicRegistration": true,
                    "signatureInformation": {
                        "documentationFormat": [
                            "plaintext",
                            "markdown"
                        ],
                        "parameterInformation": {
                            "labelOffsetSupport": true
                        }
                    }
                },
                "synchronization": {
                    "didSave": true,
                    "dynamicRegistration": true,
                    "willSave": true,
                    "willSaveWaitUntil": true
                },
                "typeDefinition": {
                    "dynamicRegistration": true
                },
                "typeHierarchy": {
                    "dynamicRegistration": true
                }
            },
            "window": {
                "showDocument": {
                    "messageActionItem": {
                        "additionalPropertiesSupport": true
                    }
                },
                "showMessage": {
                    "messageActionItem": {
                        "additionalPropertiesSupport": true
                    }
                }
            },
            "workspace": {
                "applyEdit": true,
                "configuration": true,
                "diagnostics": {
                    "refreshSupport": true
                },
                "didChangeConfiguration": {
                    "dynamicRegistration": true
                },
                "didChangeWatchedFiles": {
                    "dynamicRegistration": true,
                    "relativePatternSupport": true
                },
                "executeCommand": {
                    "dynamicRegistration": true
                },
                "fileOperations": {
                    "didCreate": true,
                    "didDelete": true,
                    "didRename": true,
                    "dynamicRegistration": true,
                    "willCreate": true,
                    "willDelete": true,
                    "willRename": true
                },
                "inlayHint": {
                    "refreshSupport": true
                },
                "inlineValue": {
                    "refreshSupport": true
                },
                "semanticTokens": {
                    "refreshSupport": true
                },
                "symbol": {
                    "dynamicRegistration": true,
                    "symbolKind": {
                        "valueSet": [
                            1,
                            2,
                            3,
                            4,
                            5,
                            6,
                            7,
                            8,
                            9,
                            10,
                            11,
                            12,
                            13,
                            14,
                            15,
                            16,
                            17,
                            18,
                            19,
                            20,
                            21,
                            22,
                            23,
                            24,
                            25,
                            26
                        ]
                    },
                    "tagSupport": {
                        "valueSet": [
                            1
                        ]
                    }
                },
                "workspaceEdit": {
                    "changeAnnotationSupport": {
                        "groupsOnLabel": 1
                    },
                    "documentChanges": true,
                    "failureHandling": "transactional",
                    "normalizesLineEndings": true,
                    "resourceOperations": [
                        "create",
                        "rename",
                        "delete"
                    ]
                },
                "workspaceFolders": true
            }
        },
        "language": "Java",
        "processId": 25520,
        "rootUri": "file:///home/funning/eclipse-workspace/mavenProject",
        "trace": "verbose",
        "workspaceFolders": [
            {
                "name": "mavenProject",
                "uri": "file:///home/funning/eclipse-workspace/mavenProject"
            }
        ]
    }
}

Yurii-huang avatar Jul 20 '22 06:07 Yurii-huang

Is there any way to output the internal processing log of jdtls?

Yurii-huang avatar Jul 20 '22 07:07 Yurii-huang

Some hints:

  1. You can use an empty param in initialize to reduce its influnce, as sometimes incorrect parameters may affect server's behaviour
  2. Make sure jdt.ls starts successfully and runs well
  3. Make sure your code can read jdt.ls's response correctly

zbelial avatar Jul 24 '22 11:07 zbelial

Some hints:

  1. You can use an empty param in initialize to reduce its influnce, as sometimes incorrect parameters may affect server's behaviour
  2. Make sure jdt.ls starts successfully and runs well
  3. Make sure your code can read jdt.ls's response correctly

Yet, empty request is working, I found from byte data covert error, the byte count is error. now, this is working

Yurii-huang avatar Jul 26 '22 01:07 Yurii-huang

If it works now, you can close this issue. If you still have problems (eg. the byte count error), you could check whether you open jdt.ls' stdout in binary mode or not.

zbelial avatar Jul 27 '22 06:07 zbelial

jdtls program is python, use other language do process launch start not equal can write(frame not working). should wait can read jdtls befor do write any request to stdout.

The features only for jdtls,It won't happen from cxx or python

Yurii-huang avatar Oct 28 '22 10:10 Yurii-huang

It's a complex bug. I'm sorry to close it now

Yurii-huang avatar Oct 28 '22 10:10 Yurii-huang