Skip to content

Commit abab312

Browse files
committed
Fix #266 Add a test and update the CHANGELOG
This was fixed in the v0.14.0 release but we forgot to add a test and update the CHANGELOG.md file. Signed-off-by: Remy Suen <[email protected]>
1 parent 152ca2e commit abab312

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
1818
- prevent invalid heredocs from crashing the formatter ([rcjsuen/dockerfile-utils#127](https://github.com/rcjsuen/dockerfile-utils/issues/127))
1919
- textDocument/definition
2020
- stop resolving definitions to build stages after the selected line ([rcjsuen/dockerfile-language-service#130](https://github.com/rcjsuen/dockerfile-language-service/issues/130))
21+
- prevent invalid heredocs from crashing the server ([#266](https://github.com/rcjsuen/dockerfile-language-server/issues/266))
2122
- textDocument/documentHighlight
2223
- build stage references in FROM instructions will now be highlighted ([rcjsuen/dockerfile-language-service#128](https://github.com/rcjsuen/dockerfile-language-service/issues/128))
2324
- textDocument/rename

test/server.test.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2314,6 +2314,39 @@ describe("Dockerfile LSP Tests", function() {
23142314
});
23152315
});
23162316

2317+
it("issue #266", function (finished) {
2318+
this.timeout(5000);
2319+
sendNotification("textDocument/didOpen", {
2320+
textDocument: {
2321+
languageId: "dockerfile",
2322+
version: 1,
2323+
uri: "uri://dockerfile/266.txt",
2324+
text: "RUN <<'END_OF_PATCH\nEND_OF_PATCH\nRUN <<'SCRIPT'\nSCRIPT"
2325+
}
2326+
});
2327+
2328+
2329+
const requestId = sendRequest("textDocument/definition", {
2330+
textDocument: {
2331+
uri: "uri://dockerfile/266.txt",
2332+
},
2333+
position: {
2334+
line: 0,
2335+
character: 10
2336+
}
2337+
});
2338+
2339+
const listener = (json) => {
2340+
if (json.id === requestId) {
2341+
lspProcess.removeListener("message", listener);
2342+
assert.strictEqual(json.error, undefined);
2343+
assert.strictEqual(json.result, null);
2344+
finished();
2345+
}
2346+
};
2347+
lspProcess.on("message", listener);
2348+
});
2349+
23172350
after(() => {
23182351
// terminate the forked LSP process after all the tests have been run
23192352
lspProcess.kill();

0 commit comments

Comments
 (0)