diff --git a/ocaml-lsp-server/test/e2e/__tests__/textDocument-diagnostics.ts b/ocaml-lsp-server/test/e2e/__tests__/textDocument-diagnostics.ts index 5afa1a997..e68e81bf3 100644 --- a/ocaml-lsp-server/test/e2e/__tests__/textDocument-diagnostics.ts +++ b/ocaml-lsp-server/test/e2e/__tests__/textDocument-diagnostics.ts @@ -50,6 +50,24 @@ describe("textDocument/diagnostics", () => { "line": 0, }, }, + "relatedInformation": Array [ + Object { + "location": Object { + "range": Object { + "end": Object { + "character": 4, + "line": 0, + }, + "start": Object { + "character": 3, + "line": 0, + }, + }, + "uri": "file:///test.ml", + }, + "message": "String literal begins here", + }, + ], "severity": 1, "source": "ocamllsp", }, @@ -165,9 +183,7 @@ describe("textDocument/diagnostics", () => { is not included in sig val x : unit end Values do not match: val x : int is not included in val x : unit - The type int is not compatible with the type unit - File \\"test.ml\\", line 2, characters 2-14: Expected declaration - File \\"test.ml\\", line 4, characters 6-7: Actual declaration", + The type int is not compatible with the type unit", "range": Object { "end": Object { "character": 3, @@ -178,6 +194,40 @@ describe("textDocument/diagnostics", () => { "line": 2, }, }, + "relatedInformation": Array [ + Object { + "location": Object { + "range": Object { + "end": Object { + "character": 14, + "line": 2, + }, + "start": Object { + "character": 2, + "line": 2, + }, + }, + "uri": "file:///test.ml", + }, + "message": "Expected declaration", + }, + Object { + "location": Object { + "range": Object { + "end": Object { + "character": 7, + "line": 4, + }, + "start": Object { + "character": 6, + "line": 4, + }, + }, + "uri": "file:///test.ml", + }, + "message": "Actual declaration", + }, + ], "severity": 1, "source": "ocamllsp", }, diff --git a/ocaml-lsp-server/test/e2e/src/LanguageServer.ts b/ocaml-lsp-server/test/e2e/src/LanguageServer.ts index d522940a3..6179b6a77 100644 --- a/ocaml-lsp-server/test/e2e/src/LanguageServer.ts +++ b/ocaml-lsp-server/test/e2e/src/LanguageServer.ts @@ -63,7 +63,13 @@ export const startAndInitialize = async ( processId: process.pid, rootUri: toURI(path.join(__dirname, "..")), workspaceFolders: [], - capabilities: {}, + capabilities: { + textDocument: { + publishDiagnostics: { + relatedInformation: true, + }, + }, + }, ...initializeParameters, };