Skip to content

Commit

Permalink
Fix #265 Support --keep-git-dir flag for ADD
Browse files Browse the repository at this point in the history
The new --keep-git-dir flag added for ADD instructions will no longer be
flagged as an unrecognized flag.

Signed-off-by: Remy Suen <[email protected]>
  • Loading branch information
rcjsuen committed Sep 10, 2023
1 parent 9c9d391 commit 18b9f8c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
- support parsing the new `--checksum` flag for ADD instructions ([rcjsuen/dockerfile-utils#116](https://github.com/rcjsuen/dockerfile-utils/issues/116))
- flag empty tag specified with a digest in FROM instructions as an error ([rcjsuen/dockerfile-utils#118](https://github.com/rcjsuen/dockerfile-utils/issues/118))
- ignore predefined platform ARG variables if they are used as a base image ([rcjsuen/dockerfile-utils#119](https://github.com/rcjsuen/dockerfile-utils/issues/119))
- support parsing the new `--keep-git-dir` flag for ADD instructions ([#265](https://github.com/rcjsuen/dockerfile-language-server-nodejs/issues/265))
- textDocument/completion
- suggest the new `--start-interval` flag for HEALTHCHECK instructions when calculating completion items ([#117](https://github.com/rcjsuen/dockerfile-language-service/issues/117))
- textDocument/hover
Expand Down
30 changes: 30 additions & 0 deletions test/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2254,6 +2254,36 @@ describe("Dockerfile LSP Tests", function() {
lspProcess.on("message", listener259);
});

it("issue #265", (finished) => {
this.timeout(5000);

const documentURI = "uri://dockerfile/265.txt";
const diagnosticsListener = (json) => {
if (json.method === "textDocument/publishDiagnostics") {
if (json.params.uri === documentURI) {
lspProcess.removeListener("message", diagnosticsListener);
sendNotification("textDocument/didClose", {
textDocument: {
uri: documentURI,
}
});
assert.strictEqual(json.params.diagnostics.length, 0);
finished();
}
}
};
lspProcess.on("message", diagnosticsListener);

sendNotification("textDocument/didOpen", {
textDocument: {
languageId: "dockerfile",
version: 1,
uri: documentURI,
text: "FROM alpine\nADD --keep-git-dir=true https://github.com/moby/buildkit.git#v0.10.1 /buildkit"
}
});
});

after(() => {
// terminate the forked LSP process after all the tests have been run
lspProcess.kill();
Expand Down

0 comments on commit 18b9f8c

Please sign in to comment.