Skip to content

Conversation

@Hweinstock
Copy link
Contributor

@Hweinstock Hweinstock commented Dec 13, 2024

Problem

ToolkitPromptSettings and AmazonQPromptSettings reimplement the same functions.

Solution

  • factor these classes out into the same anonymous class.
  • avoid using inheritance to keep strong typing from the settings.

TODO: figure out how to type the booleans to avoid casting


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.

License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

) {
public isPromptEnabled(promptName: promptName) {
try {
return !this._getOrThrow(promptName, false as never)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Believe there is an issue with how I setup types since I need the cast here.


// We know 'ssoCacheError' is in all extension prompt settings
if (await promptSettings.isPromptEnabled('ssoCacheError')) {
if (promptSettings.isPromptEnabled('ssoCacheError')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a welcome change 👍
Not a strong reason for this function to be async

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hweinstock Hweinstock closed this Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants