Skip to content

Commit

Permalink
Fix #119 Support hovers for --start-interval in HEALTHCHECK
Browse files Browse the repository at this point in the history
Signed-off-by: Remy Suen <[email protected]>
  • Loading branch information
rcjsuen committed Sep 9, 2023
1 parent 3a79928 commit 73cfbea
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- support parsing the new `--start-interval` flag for HEALTHCHECK instructions ([rcjsuen/dockerfile-utils#115](https://github.com/rcjsuen/dockerfile-utils/issues/115))
- allow some diagnostics to be ignored if a `# dockerfile-utils: ignore` comment precedes the originating line of the error ([rcjsuen/dockerfile-utils#106](https://github.com/rcjsuen/dockerfile-utils/issues/106))
- suggest the new `--start-interval` flag for HEALTHCHECK instructions when calculating completion items ([#117](https://github.com/rcjsuen/dockerfile-language-service/issues/117))
- provide documentation support when hovering over the `--start-interval` flag for HEALTHCHECK instructions ([#119](https://github.com/rcjsuen/dockerfile-language-service/issues/119))

## [0.10.2] - 2023-06-01
### Fixed
Expand Down
2 changes: 2 additions & 0 deletions src/dockerHover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ export class DockerHover {
return "HEALTHCHECK_FlagInterval";
case "retries":
return "HEALTHCHECK_FlagRetries";
case "start-interval":
return "HEALTHCHECK_FlagStartInterval";
case "start-period":
return "HEALTHCHECK_FlagStartPeriod";
case "timeout":
Expand Down
2 changes: 1 addition & 1 deletion src/dockerMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class MarkdownDocumentation {
"hoverFromFlagPlatform": "The platform of the image if referencing a multi-platform image.\n\nSince Docker CE 18.04.",
"hoverHealthcheckFlagInterval": "The seconds to wait for the health check to run after the container has started, and then again the number of seconds to wait before running again after the previous check has completed.",
"hoverHealthcheckFlagRetries": "The number of consecutive failures of this health check before the container is considered to be `unhealthy`.",
"hoverHealthcheckFlagStartInterval": "The number of seconds to wait between health checks during the start period.",
"hoverHealthcheckFlagStartInterval": "The number of seconds to wait between health checks during the start period.",
"hoverHealthcheckFlagStartPeriod": "The number of seconds to wait for the container to startup. Failures during this grace period will not count towards the maximum number of retries. However, should a health check succeed during this period then any subsequent failures will count towards the maximum number of retries.\n\nSince Docker 17.05.0-ce.",
"hoverHealthcheckFlagTimeout": "The number of seconds to wait for the check to complete before considering it to have failed.",

Expand Down
2 changes: 1 addition & 1 deletion src/dockerPlainText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class PlainTextDocumentation {
"hoverFromFlagPlatform": "The platform of the image if referencing a multi-platform image.\n\nSince Docker CE 18.04.",
"hoverHealthcheckFlagInterval": "The seconds to wait for the health check to run after the container has started, and then again the number of seconds to wait before running again after the previous check has completed.",
"hoverHealthcheckFlagRetries": "The number of consecutive failures of this health check before the container is considered to be `unhealthy`.",
"hoverHealthcheckFlagStartInterval": "The number of seconds to wait between health checks during the start period.",
"hoverHealthcheckFlagStartInterval": "The number of seconds to wait between health checks during the start period.",
"hoverHealthcheckFlagStartPeriod": "The number of seconds to wait for the container to startup. Failures during this grace period will not count towards the maximum number of retries. However, should a health check succeed during this period then any subsequent failures will count towards the maximum number of retries.\n\nSince Docker 17.05.0-ce.",
"hoverHealthcheckFlagTimeout": "The number of seconds to wait for the check to complete before considering it to have failed.",

Expand Down
5 changes: 5 additions & 0 deletions test/dockerHover.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,11 @@ describe("Dockerfile hover", function () {
assertHover(content, 0, triggerOffset + 17, "HEALTHCHECK_FlagRetries");
});

it("--start-interval", () => {
const content = onbuild + "HEALTHCHECK --start-interval";
assertHover(content, 0, triggerOffset + 17, "HEALTHCHECK_FlagStartInterval");
});

it("--start-period", function () {
let content = onbuild + "HEALTHCHECK --start-period";
assertHover(content, 0, triggerOffset + 17, "HEALTHCHECK_FlagStartPeriod");
Expand Down

0 comments on commit 73cfbea

Please sign in to comment.