Skip to content

Conversation

@nkomonen-amazon
Copy link
Contributor

@nkomonen-amazon nkomonen-amazon commented Oct 3, 2024

We have some strings that need to resolve a url depending on c9 vs toolkit.

The isCloud9() function is causing issues in the constants file. Due to some sort of module import order, isCloud9() did not resolve appropriately when expected. I think we used the constants file before all the dependencies of the isCloud9() function were available

The constants file should be a minimal module with as little external dependencies as possible.

Solution:

Move the resolution of c9 vs toolkit docs to an external function. Update uses everywhere.


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

The isCloud9() function was causing issues in the constants file.
The constants file should be a minimal module with as little external
dependencies as possible.

We had some strings that needed to resolve a url depending on c9 vs toolkit.

Solution:

Move the resolution of c9 vs toolkit docs to an external function. Update uses
everywhere.

Signed-off-by: nkomonen-amazon <[email protected]>
@nkomonen-amazon nkomonen-amazon requested a review from a team as a code owner October 3, 2024 15:14
@github-actions
Copy link

github-actions bot commented Oct 3, 2024

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.

@jpinkney-aws
Copy link
Contributor

The isCloud9() function is causing issues in the constants file

What do you mean issues? Circular dependencies, etc?

}

function _getDocumentationUrl(urls: { cloud9: vscode.Uri; toolkit: vscode.Uri }): vscode.Uri {
return isCloud9() ? urls.cloud9 : urls.toolkit
Copy link
Contributor

Choose a reason for hiding this comment

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

rather than having to do vscode.Uri.parse everywhere you could just have c9/toolkit be strings and do the parsing in here I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking that eventually I think we'll get rid of C9 and just directly use the variable in the constants file, so all these functions would be deleted

@jpinkney-aws jpinkney-aws merged commit 30601ba into aws:master Oct 3, 2024
18 of 20 checks passed
@nkomonen-amazon nkomonen-amazon deleted the constantsDocs branch October 3, 2024 18:55
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