Skip to content

Commit

Permalink
revert: cloud9 related code (#6376)
Browse files Browse the repository at this point in the history
This code removes nearly all cloud9 codepaths:
- Icons, readme generation, scripts
- ikp3db lambda/sam debugger support
- Cloud9 only codepaths and hacks
- Docs and comments mentioning Cloud9

Includes some follow up items as TODOs in code.

Some items were left in case they are helpful in the future (e.g. for
vscode web or similar). The items should be renamed from Cloud9 if used
again in the future. Some examples are Cloud9 runtime environment checks
(for lambda/sam), `isCloud9()` and properties/text for Cloud9 IDE, some
SAM artifacts, don't start LSP server, etc. Search cloud9 in vscode
after merging this change.

---

- 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](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: Justin M. Keyes <[email protected]>
  • Loading branch information
hayemaxi and justinmk3 authored Jan 21, 2025
1 parent efeba57 commit 01351dd
Show file tree
Hide file tree
Showing 90 changed files with 265 additions and 1,895 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ packages/amazonq/package.nls.json
packages/amazonq/resources

# Icons
packages/*/resources/icons/cloud9/generated/**
packages/*/resources/fonts/aws-toolkit-icons.woff
packages/*/resources/css/icons.css

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ If you are contribuing visual assets from other open source repos, the source re
## Using new vscode APIs

The minimum required vscode version specified in [package.json](https://github.com/aws/aws-toolkit-vscode/blob/07119655109bb06105a3f53bbcd86b812b32cdbe/package.json#L16)
is decided by the version of vscode running in Cloud9 and other vscode-compatible targets.
is decided by the version of vscode running in other supported vscode-compatible targets (e.g. web).

But you can still use the latest vscode APIs, by checking the current running vscode version. For example, to use a vscode 1.64 API:

Expand Down
139 changes: 0 additions & 139 deletions cloud9-toolkit-install.sh

This file was deleted.

11 changes: 4 additions & 7 deletions docs/CODE_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,10 @@ that is a net cost.
- Telemetry: "active" vs "passive"
- Active (`passive:false`) metrics are those intended to appear in DAU count.
- Icons:
- Where possible, use IDE-specific standard icons (e.g. standard VSCode
standard icons in VSCode, and Cloud9 standard icons in Cloud9). The typical
(maintainable) way to do this is to use _named_ icons (what VSCode calls
- Where possible, use standard VSCode icons. The typical (maintainable)
way to do this is to use _named_ icons (what VSCode calls
[codicons](https://microsoft.github.io/vscode-codicons/)) as opposed to
icons shipped with the Toolkit build and referenced by _path_.
- For cases where icons must be statically defined (package.json), if Cloud9
does not support the VSCode standard icon, use the Cloud9 icon.
- Changelog guidelines
- Prefer active voice: "You can do X" instead of "X can be done"
- Avoid unnecessary use of `lodash` (which we may remove in the future).
Expand Down Expand Up @@ -240,11 +237,11 @@ _See also [arch_develop.md](./arch_develop.md#exceptions)._
- PREFER:
```ts
things.filter(o => o.isFoo)
things.filter((o) => o.isFoo)
```
- INSTEAD OF:
```ts
things.filter(thing => thing.isFoo)
things.filter((thing) => thing.isFoo)
```
## User settings
Expand Down
2 changes: 0 additions & 2 deletions docs/arch_runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ If you must define a new key (is it _really_ necessary?), follow these guideline
These keys are currently set by the core/ package, but many of them may eventually be migrated to
toolkit/ or amazonq/ if appropriate.

- `isCloud9`: This is hardcoded by Cloud9 itself, not the Toolkit.
- Cloud9 _does not support setContext_. So this is the only usable key there.
- `aws.codecatalyst.connected`: CodeCatalyst connection is active.
- `aws.codewhisperer.connected`: CodeWhisperer connection is active.
- `aws.codewhisperer.connectionExpired`: CodeWhisperer connection is active, but the connection is expired.
Expand Down
8 changes: 1 addition & 7 deletions docs/icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ All icons that are used in the extensions can be found in `resources/icons`.

A [build script](../scripts/generateIcons.ts) generates extension artifacts in [core/](../packages/core/):

- `resources/icons/cloud9/generated`
- `resources/fonts/aws-toolkit-icons.woff`
- `resources/css/icons.css`
- `contributes.icons` in [amazonq package.json](../packages/amazonq/package.json) and [toolkit package.json](../packages/toolkit/package.json)
Expand All @@ -31,7 +30,7 @@ If your desired icon does not work well as a font, see [Theme Overrides](#theme-

## Identifiers

Icons (except those in `cloud9`) can be referenced within the Toolkit by concatenating the icon path with hyphens, omitting the 'theme' if applicable.
Icons can be referenced within the Toolkit by concatenating the icon path with hyphens, omitting the 'theme' if applicable.

Examples:

Expand All @@ -50,11 +49,6 @@ For example, if I wanted to use a special App Runner service icon, then I need t
- `resources/icons/aws/dark/apprunner-service.svg`
- `resources/icons/aws/light/apprunner-service.svg`

A similar format is used for overriding icons only on Cloud9:

- `resources/icons/cloud9/dark/aws-apprunner-service.svg`
- `resources/icons/cloud9/light/aws-apprunner-service.svg`

These icons will **not** be usuable as Codicons or as font icons.

## Third Party
Expand Down
68 changes: 0 additions & 68 deletions packages/core/resources/css/base-cloud9.css

This file was deleted.

12 changes: 0 additions & 12 deletions packages/core/resources/icons/cloud9/dark/vscode-help.svg

This file was deleted.

12 changes: 0 additions & 12 deletions packages/core/resources/icons/cloud9/light/vscode-help.svg

This file was deleted.

5 changes: 2 additions & 3 deletions packages/core/src/auth/credentials/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import * as vscode from 'vscode'
import { Credentials } from '@aws-sdk/types'
import { authHelpUrl } from '../../shared/constants'
import globals from '../../shared/extensionGlobals'
import { isCloud9 } from '../../shared/extensionUtilities'
import { messages, showMessageWithCancel, showViewLogsMessage } from '../../shared/utilities/messages'
import { Timeout, waitTimeout } from '../../shared/utilities/timeoutUtils'
import { fromExtensionManifest } from '../../shared/settings'
Expand All @@ -37,8 +36,8 @@ export function asEnvironmentVariables(credentials: Credentials): NodeJS.Process
export function showLoginFailedMessage(credentialsId: string, errMsg: string): void {
const getHelp = localize('AWS.generic.message.getHelp', 'Get Help...')
const editCreds = messages.editCredentials(false)
// TODO: getHelp page for Cloud9.
const buttons = isCloud9() ? [editCreds] : [editCreds, getHelp]
// TODO: Any work towards web/another cloud9 -esqe IDE may need different getHelp docs:
const buttons = [editCreds, getHelp]

void showViewLogsMessage(
localize('AWS.message.credentials.invalid', 'Credentials "{0}" failed to connect: {1}', credentialsId, errMsg),
Expand Down
6 changes: 1 addition & 5 deletions packages/core/src/auth/sso/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { CancellationError } from '../../shared/utilities/timeoutUtils'
import { ssoAuthHelpUrl } from '../../shared/constants'
import { openUrl } from '../../shared/utilities/vsCodeUtils'
import { ToolkitError } from '../../shared/errors'
import { isCloud9 } from '../../shared/extensionUtilities'
import { builderIdStartUrl } from './constants'

export interface SsoToken {
Expand Down Expand Up @@ -116,10 +115,7 @@ export async function openSsoPortalLink(startUrl: string, authorization: Authori

async function showLoginNotification() {
const name = startUrl === builderIdStartUrl ? localizedText.builderId() : localizedText.iamIdentityCenterFull()
// C9 doesn't support `detail` field with modals so we need to put it all in the `title`
const title = isCloud9()
? `Confirm Code "${authorization.userCode}" for ${name} in the browser.`
: localize('AWS.auth.loginWithBrowser.messageTitle', 'Confirm Code for {0}', name)
const title = localize('AWS.auth.loginWithBrowser.messageTitle', 'Confirm Code for {0}', name)
const detail = localize(
'AWS.auth.loginWithBrowser.messageDetail',
'Confirm this code in the browser: {0}',
Expand Down
14 changes: 3 additions & 11 deletions packages/core/src/auth/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { TreeNode } from '../shared/treeview/resourceTreeDataProvider'
import { createInputBox } from '../shared/ui/inputPrompter'
import { CredentialSourceId, telemetry } from '../shared/telemetry/telemetry'
import { createCommonButtons, createExitButton, createHelpButton, createRefreshButton } from '../shared/ui/buttons'
import { getIdeProperties, isAmazonQ, isCloud9 } from '../shared/extensionUtilities'
import { getIdeProperties, isAmazonQ } from '../shared/extensionUtilities'
import { addScopes, getDependentAuths } from './secondaryAuth'
import { DevSettings } from '../shared/settings'
import { createRegionPrompter } from '../shared/ui/common/region'
Expand Down Expand Up @@ -562,9 +562,9 @@ export class AuthNode implements TreeNode<Auth> {
if (conn !== undefined && conn.state !== 'valid') {
item.iconPath = getIcon('vscode-error')
if (conn.state === 'authenticating') {
this.setDescription(item, 'authenticating...')
item.description = 'authenticating...'
} else {
this.setDescription(item, 'expired or invalid, click to authenticate')
item.description = 'expired or invalid, click to authenticate'
item.command = {
title: 'Reauthenticate',
command: '_aws.toolkit.auth.reauthenticate',
Expand All @@ -578,14 +578,6 @@ export class AuthNode implements TreeNode<Auth> {

return item
}

private setDescription(item: vscode.TreeItem, text: string) {
if (isCloud9()) {
item.tooltip = item.tooltip ?? text
} else {
item.description = text
}
}
}

export async function hasIamCredentials(
Expand Down
Loading

0 comments on commit 01351dd

Please sign in to comment.