Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/utils/exerciseLspServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ async function exerciseLspServerWorker(testDir: string, lspServerPath: string, r
let line = 0; // LSP uses 0-based lines
let character = 0; // LSP uses 0-based characters
let characterDelta = 0; // Net character offset from insertions/deletions on the current line
const totalLines = openFileContents.split(/\r\n|\r|\n/).length;
const lines = openFileContents.split(/\r\n|\r|\n/);
const totalLines = lines.length;

let prev = "";

Expand Down Expand Up @@ -367,9 +368,10 @@ async function exerciseLspServerWorker(testDir: string, lspServerPath: string, r

const inlayHintsPromise = request("textDocument/inlayHint", {
textDocument: { uri: openFileUri },
// TODO - this is still a hack.
// Could just move it to the end after we've iterated through the file.
range: { start: { line: 0, character: 0 }, end: { line: 0, character: openFileContents.length } },
range: {
start: { line: 0, character: 0 },
end: { line: totalLines - 1, character: lines[totalLines - 1].length },
},
});

const [diagResult, codeLenses, _inlayHints] = await Promise.all([diagnosticsPromise, codeLensesPromise, inlayHintsPromise]);
Expand Down Expand Up @@ -808,4 +810,4 @@ async function exerciseLspServerWorker(testDir: string, lspServerPath: string, r
process.exit(EXIT_SERVER_ERROR);
}
}
}
}
Loading