Skip to content

Server log parameters not being sent in the oxcaml branch #1548

@Sudha247

Description

@Sudha247

When using ocaml-lsp on VSCode in the OxCaml compiler branch, the errors are not being reported in the "Problems" tab in the terminal - this was originally reported by @yoav-zibin. I tried looking at what could be causing this, and it looks like the JSON parameters are not being sent when the server is sending a notification of the error/warning. Looking at the log, I can tell that the necessary information about the failures is missing; hence, it's not being reported in Problems or the file itself as errors. Here are the details I could narrow down from the log:

Log of the working version (5.2.0)

[Trace - 13:00:43] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [
        {
            "message": "Unbound type constructor rando",
            "range": {
                "end": {
                    "character": 37,
                    "line": 24
                },
                "start": {
                    "character": 32,
                    "line": 24
                }
            },
            "severity": 1,
            "source": "ocamllsp"
        },
        {
            "message": "Error (warning 20): this argument will not be used by the function.",
            "range": {
                "end": {
                    "character": 67,
                    "line": 86
                },
                "start": {
                    "character": 58,
                    "line": 86
                }
            },
            "severity": 2,
            "source": "ocamllsp"
        }
    ],
    "uri": "file:///home/sudha/ocaml/sudha/oxcaml-exp/oxcaml/parsing/ast_helper.ml"
}

Log of the oxcaml version (5.2.0+ox)

[Trace - 11:50:59] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [],
    "uri": "file:///home/sudha/ocaml/sudha/oxcaml-exp/ocaml-lsp/ocaml-lsp-server/src/document_symbol.ml"
}

Looking at the log, my hunch is that the information that needs to be sent to the server is getting lost. I'm also not entirely sure whether this is an issue with ocaml-lsp or with vscode-ocaml-platform, but I'm opening it here since it seems more relevant. I don’t know the codebase well enough to debug this further, and my basic grep-ing didn’t help much. Does anyone have pointers on what might be missing or how to get more information about the failure?

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