Skip to content

TexLab responds with LocationLink[] at Goto Definition request, even though textDocument.definition.linkSupport is not declared #1399

@lhy7889678

Description

@lhy7889678

As the title says, TexLab responds with LocationLink[] at Goto Definition request, even though textDocument.definition.linkSupport is not declared.

The specification says:

The result type LocationLink[] got introduced with version 3.14.0 and depends on the corresponding client capability textDocument.definition.linkSupport.

The Kate editor does not support this capability yet, and the response by TexLab will make it fail to jump to the correct destination.

Consider the following MWE:

% t.tex
\documentclass{article}

\begin{document}

\input{u.tex}

\end{document}


% u.tex
Hello!

Here is the output of the capability declaration:

DEBUG - < {
    "id": 1,
    "jsonrpc": "2.0",
    "method": "initialize",
    "params": {
        "capabilities": {
            "textDocument": {
                "codeAction": {
                    "codeActionLiteralSupport": {
                        "codeActionKind": {
                            "valueSet": [
                                "quickfix",
                                "refactor",
                                "source"
                            ]
                        }
                    }
                },
                "completion": {
                    "completionItem": {
                        "resolveSupport": {
                            "properties": [
                                "additionalTextEdits",
                                "documentation"
                            ]
                        },
                        "snippetSupport": true
                    }
                },
                "documentSymbol": {
                    "hierarchicalDocumentSymbolSupport": true
                },
                "hover": {
                    "contentFormat": [
                        "markdown",
                        "plaintext"
                    ]
                },
                "inlayHint": {
                    "dynamicRegistration": false
                },
                "publishDiagnostics": {
                    "relatedInformation": true
                },
                "selectionRange": {
                    "dynamicRegistration": false
                },
                "semanticTokens": {
                    "formats": [
                        "relative"
                    ],
                    "requests": {
                        "full": {
                            "delta": true
                        },
                        "range": true
                    },
                    "tokenModifiers": [
                    ],
                    "tokenTypes": [
                        "namespace",
                        "type",
                        "class",
                        "enum",
                        "interface",
                        "struct",
                        "typeParameter",
                        "parameter",
                        "variable",
                        "property",
                        "enumMember",
                        "event",
                        "function",
                        "method",
                        "macro",
                        "keyword",
                        "modifier",
                        "comment",
                        "string",
                        "number",
                        "regexp",
                        "operator"
                    ]
                },
                "synchronization": {
                    "didSave": true
                }
            },
            "window": {
                "showMessage": {
                    "messageActionItem": {
                        "additionalPropertiesSupport": true
                    }
                },
                "workDoneProgress": true
            },
            "workspace": {
                "workspaceFolders": true
            }
        },
        "processId": 16679,
        "rootPath": "/home/huanyu",
        "rootUri": "file:///home/huanyu",
        "workspaceFolders": [
        ]
    }
}
DEBUG - sending message Request( [OMITTED...] )
DEBUG - > {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"completionProvider":{"resolveProvider":true,"triggerCharacters":["\\","{","}","@","/"," "]},"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentLinkProvider":{"resolveProvider":false},"documentSymbolProvider":true,"executeCommandProvider":{"commands":["texlab.cleanAuxiliary","texlab.cleanArtifacts","texlab.changeEnvironment","texlab.findEnvironments","texlab.showDependencyGraph","texlab.cancelBuild"]},"foldingRangeProvider":true,"hoverProvider":true,"inlayHintProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"textDocumentSync":{"change":2,"openClose":true,"save":{"includeText":false}},"workspaceSymbolProvider":true},"serverInfo":{"name":"TexLab","version":"5.22.1"}}}

After Ctrl+click on the \input{u.tex} line, the output is:

DEBUG - < {
    "id": 6,
    "jsonrpc": "2.0",
    "method": "textDocument/definition",
    "params": {
        "position": {
            "character": 10,
            "line": 4
        },
        "textDocument": {
            "uri": "file:///tmp/t.tex"
        }
    }
}
DEBUG - sending message Request( [OMITTED...] )
DEBUG - > {"jsonrpc":"2.0","id":6,"result":[{"originSelectionRange":{"end":{"character":12,"line":4},"start":{"character":7,"line":4}},"targetRange":{"end":{"character":0,"line":0},"start":{"character":0,"line":0}},"targetSelectionRange":{"end":{"character":0,"line":0},"start":{"character":0,"line":0}},"targetUri":"file:///tmp/u.tex"}]}

However, I'm not very familiar with the LSP Specification. Please correct me if I didn't understand correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions