Я пишу на языковом сервере.Он предоставляет дополнительную DiagnosticRelatedInformation как часть своего диагностического ответа.Как и в https://code.visualstudio.com/updates/v1_22#_related-information-in-errors-and-warnings. В настоящее время, хотя я вижу главную ошибку, отображаемую как в окне «Проблемы», так и в основной текстовой области, дополнительной «связанной информации» не видно.
Я подозреваю, что для этого могут быть две причины.Либо на стороне клиента: возможность отображения этой информации не включена в VS Code.По крайней мере, когда протокол инициирован, эту возможность нигде не видно, вот исходное сообщение JSON от клиента:
[Trace - 2:22:13 PM] Sending request 'initialize - (0)'.
Params: {
"processId": 6640,
"rootPath": null,
"rootUri": null,
"capabilities": {
"workspace": {
"applyEdit": true,
"didChangeConfiguration": {
"dynamicRegistration": true
},
"didChangeWatchedFiles": {
"dynamicRegistration": true
},
"symbol": {
"dynamicRegistration": true
},
"executeCommand": {
"dynamicRegistration": true
}
},
"textDocument": {
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"completionItem": {
"snippetSupport": true,
"commitCharactersSupport": true
}
},
"hover": {
"dynamicRegistration": true
},
"signatureHelp": {
"dynamicRegistration": true
},
"definition": {
"dynamicRegistration": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true
},
"codeAction": {
"dynamicRegistration": true
},
"codeLens": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true
},
"documentLink": {
"dynamicRegistration": true
}
}
},
"trace": "verbose"
}
Я использую VS Code 1.28.2 на Win10, кстати.
Другая причина может быть на стороне сервера: ответ, содержащий диагностику, может быть неверно сформирован.Выглядит это так:
Params: {
"diagnostics": [
{
"code": null,
"message": "the declaration of 'x' shadows an existing declaration",
"range": {
"end": {
"character": 17,
"line": 8
},
"start": {
"character": 17,
"line": 8
}
},
"relatedInformation": [
{
"location": {
"uri": "file:///c%3A/Users/blabla/XlocalShadow3.blc",
"range": {
"end": {
"character": 13,
"line": 6
},
"start": {
"character": 13,
"line": 6
}
}
},
"message": "existing declaration"
},
{
"location": {
"uri": "file:///c%3A/Users/blabla/XlocalShadow3.blc",
"range": {
"end": {
"character": 17,
"line": 8
},
"start": {
"character": 17,
"line": 8
}
}
},
"message": "shadowing declaration"
}
],
"severity": {
"_tag": 0
},
"source": "Parsing Error"
}
],
"uri": "file:///c%3A/Users/blabla/XlocalShadow3.blc"
}
По крайней мере URI верны (хотя и изменены для удобства чтения), так как я могу щелкнуть по ним, и редактор действительно переходит к нужному файлу.
MyПроблема в том, что я не вижу, как проверить ту или иную гипотезу о том, что происходит не так.Или, может быть, мне не хватает чего-то совершенно другого?