Skip to content

Commit f4cccca

Browse files
committed
merge master
2 parents 58f6ff6 + c94acfd commit f4cccca

File tree

14 files changed

+118
-152
lines changed

14 files changed

+118
-152
lines changed

.vscode/launch.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,13 @@
2424
"preLaunchTask": "watch"
2525
},
2626
{
27-
"name": "Attach to ASL Server",
28-
"type": "node",
29-
"request": "attach",
30-
"port": 6009,
31-
"restart": true,
32-
"outFiles": ["${workspaceRoot}/dist/src/stepFunctions/asl/**.js"]
33-
},
34-
{
35-
"name": "Attach to SSM Document Language Server",
36-
"type": "node",
37-
"request": "attach",
38-
"port": 6010,
39-
"restart": true,
40-
"outFiles": ["${workspaceRoot}/dist/src/ssmDocument/ssm/ssmServer.js"]
27+
"name": "Extension (web)",
28+
"type": "pwa-extensionHost",
29+
"debugWebWorkerHost": true,
30+
"request": "launch",
31+
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionDevelopmentKind=web"],
32+
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
33+
"preLaunchTask": "${defaultBuildTask}"
4134
},
4235
{
4336
"name": "Extension (webpack)",
@@ -147,13 +140,20 @@
147140
"preLaunchTask": "${defaultBuildTask}"
148141
},
149142
{
150-
"name": "Run Web Extension ",
151-
"type": "pwa-extensionHost",
152-
"debugWebWorkerHost": true,
153-
"request": "launch",
154-
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionDevelopmentKind=web"],
155-
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
156-
"preLaunchTask": "${defaultBuildTask}"
143+
"name": "Attach to ASL Server",
144+
"type": "node",
145+
"request": "attach",
146+
"port": 6009,
147+
"restart": true,
148+
"outFiles": ["${workspaceRoot}/dist/src/stepFunctions/asl/**.js"]
149+
},
150+
{
151+
"name": "Attach to SSM Document Language Server",
152+
"type": "node",
153+
"request": "attach",
154+
"port": 6010,
155+
"restart": true,
156+
"outFiles": ["${workspaceRoot}/dist/src/ssmDocument/ssm/ssmServer.js"]
157157
}
158158
],
159159
"compounds": [

CONTRIBUTING.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,21 @@ Then clone the repository and install NPM packages:
3535

3636
### Run
3737

38-
You can run the extension from Visual Studio Code:
38+
To run the extension from VSCode as a Node.js app:
3939

4040
1. Select the Run panel from the sidebar.
4141
2. From the dropdown at the top of the Run pane, choose `Extension`.
42-
3. Press `F5` to launch a new instance of Visual Studio Code with the extension installed and the debugger attached.
42+
3. Press `F5` to launch a new instance of VSCode with the extension installed and the debugger attached.
43+
44+
To run the extension from VSCode in "web mode" (a browser app, or "PWA"):
45+
46+
1. Select the Run panel from the sidebar.
47+
2. From the dropdown at the top of the Run pane, choose `Extension (web)`.
48+
3. Press `F5` to launch a new instance of VSCode (web mode) with the extension installed and the debugger attached.
4349

4450
### Build
4551

46-
When you launch the extension or run tests from Visual Studio Code, it will automatically build the extension and watch for changes.
52+
When you launch the extension or run tests from VSCode, it will automatically build the extension and watch for changes.
4753

4854
You can also use these NPM tasks (see `npm run` for the full list):
4955

@@ -118,7 +124,7 @@ You can also use these NPM tasks (see `npm run` for the full list):
118124
See [TESTPLAN.md](./docs/TESTPLAN.md) to understand the project's test
119125
structure, mechanics and philosophy.
120126
121-
You can run tests directly from Visual Studio Code:
127+
You can run tests directly from VSCode:
122128
123129
1. Select `View > Debug`, or select the Debug pane from the sidebar.
124130
2. From the dropdown at the top of the Debug pane, select the `Extension Tests` configuration.
@@ -343,7 +349,7 @@ Webviews can be hot-reloaded (updated without restarting the extension) by runni
343349

344350
### Font generation
345351

346-
For extensions to contribute their own codicons, VS Code requires a font file as well as how that font maps to codicon IDs. The mapping is found in `package.json` under the `icons` contribution point. Icons located in `resources/icons` are stitched together at build-time into a single font, automatically adding mappings to `package.json`. More information can be found [here](docs/icons.md).
352+
For extensions to contribute their own codicons, VSCode requires a font file as well as how that font maps to codicon IDs. The mapping is found in `package.json` under the `icons` contribution point. Icons located in `resources/icons` are stitched together at build-time into a single font, automatically adding mappings to `package.json`. More information can be found [here](docs/icons.md).
347353

348354
As a simple example, let's say I wanted to add a new icon for CloudWatch log streams. I would do the following:
349355

package.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,11 @@
14141414
"when": "!config.aws.samcli.legacyDeploy && view == aws.explorer && viewItem =~ /^(awsLambdaNode|awsRegionNode|awsCloudFormationRootNode)$/",
14151415
"group": "1@2"
14161416
},
1417+
{
1418+
"command": "aws.ec2.copyInstanceId",
1419+
"when": "view == aws.explorer && viewItem == awsEc2Node",
1420+
"group": "2@0"
1421+
},
14171422
{
14181423
"command": "aws.ecr.copyTagUri",
14191424
"when": "view == aws.explorer && viewItem == awsEcrTagNode",
@@ -1601,12 +1606,12 @@
16011606
},
16021607
{
16031608
"command": "aws.copyName",
1604-
"when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode|awsStateMachineNode|awsCloudFormationNode|awsS3BucketNode|awsS3FolderNode|awsS3FileNode|awsApiGatewayNode|awsIotThingNode)$|^(awsAppRunnerServiceNode|awsIotCertificateNode|awsIotPolicyNode|awsIotPolicyVersionNode)/",
1609+
"when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode|awsStateMachineNode|awsCloudFormationNode|awsS3BucketNode|awsS3FolderNode|awsS3FileNode|awsApiGatewayNode|awsIotThingNode)$|^(awsAppRunnerServiceNode|awsIotCertificateNode|awsIotPolicyNode|awsIotPolicyVersionNode|awsEc2Node)/",
16051610
"group": "2@1"
16061611
},
16071612
{
16081613
"command": "aws.copyArn",
1609-
"when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode|awsStateMachineNode|awsCloudFormationNode|awsCloudWatchLogNode|awsS3BucketNode|awsS3FolderNode|awsS3FileNode|awsApiGatewayNode|awsEcrRepositoryNode|awsIotThingNode)$|^(awsAppRunnerServiceNode|awsEcsServiceNode|awsIotCertificateNode|awsIotPolicyNode|awsIotPolicyVersionNode|awsMdeInstanceNode)/",
1614+
"when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode|awsStateMachineNode|awsCloudFormationNode|awsCloudWatchLogNode|awsS3BucketNode|awsS3FolderNode|awsS3FileNode|awsApiGatewayNode|awsEcrRepositoryNode|awsIotThingNode)$|^(awsAppRunnerServiceNode|awsEcsServiceNode|awsIotCertificateNode|awsIotPolicyNode|awsIotPolicyVersionNode|awsMdeInstanceNode|awsEc2Node)/",
16101615
"group": "2@2"
16111616
},
16121617
{
@@ -2086,6 +2091,16 @@
20862091
}
20872092
}
20882093
},
2094+
{
2095+
"command": "aws.ec2.copyInstanceId",
2096+
"title": "%AWS.command.ec2.copyInstanceId%",
2097+
"category": "%AWS.title",
2098+
"cloud9": {
2099+
"cn": {
2100+
"category": "%AWS.title.cn%"
2101+
}
2102+
}
2103+
},
20892104
{
20902105
"command": "aws.ecr.copyTagUri",
20912106
"title": "%AWS.command.ecr.copyTagUri%",

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"AWS.command.cdk.help": "View CDK Documentation",
111111
"AWS.command.ec2.openTerminal": "Open terminal to EC2 instance...",
112112
"AWS.command.ec2.openRemoteConnection": "Connect to EC2 instance in New Window...",
113+
"AWS.command.ec2.copyInstanceId": "Copy Instance Id",
113114
"AWS.command.ecr.copyTagUri": "Copy Tag URI",
114115
"AWS.command.ecr.copyRepositoryUri": "Copy Repository URI",
115116
"AWS.command.ecr.createRepository": "Create Repository...",

src/auth/ui/vue/show.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import { trustedDomainCancellation } from '../../sso/model'
4444
import { FeatureId, CredentialSourceId, Result, telemetry } from '../../../shared/telemetry/telemetry'
4545
import { AuthFormId, isBuilderIdAuth } from './authForms/types'
4646

47-
const logger = getLogger()
4847
export class AuthWebview extends VueWebview {
4948
public override id: string = 'authWebview'
5049
public override source: string = 'src/auth/ui/vue/index.js'
@@ -238,7 +237,7 @@ export class AuthWebview extends VueWebview {
238237
return { id: 'badStartUrl', text: `Connection failed. Please verify your start URL.` }
239238
}
240239

241-
logger.error('Failed to setup.', e)
240+
getLogger().error('AuthWebview: Failed to setup: %s', (e as Error).message)
242241
return { id: 'defaultFailure', text: 'Failed to setup.' }
243242
}
244243
}

src/awsexplorer/activation.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ import { downloadStateMachineDefinition } from '../stepFunctions/commands/downlo
1919
import { executeStateMachine } from '../stepFunctions/vue/executeStateMachine/executeStateMachine'
2020
import { StateMachineNode } from '../stepFunctions/explorer/stepFunctionsNodes'
2121
import { AwsExplorer } from './awsExplorer'
22-
import { copyArnCommand } from './commands/copyArn'
23-
import { copyNameCommand } from './commands/copyName'
22+
import { copyTextCommand } from './commands/copyText'
2423
import { loadMoreChildrenCommand } from './commands/loadMoreChildren'
2524
import { checkExplorerForDefaultRegion } from './defaultRegion'
2625
import { createLocalExplorerView } from './localExplorer'
@@ -156,8 +155,8 @@ async function registerAwsExplorerCommands(
156155
isPreviewAndRender: true,
157156
})
158157
),
159-
Commands.register('aws.copyArn', async (node: AWSResourceNode) => await copyArnCommand(node)),
160-
Commands.register('aws.copyName', async (node: AWSResourceNode) => await copyNameCommand(node)),
158+
Commands.register('aws.copyArn', async (node: AWSResourceNode) => await copyTextCommand(node, 'ARN')),
159+
Commands.register('aws.copyName', async (node: AWSResourceNode) => await copyTextCommand(node, 'name')),
161160
Commands.register('aws.refreshAwsExplorerNode', async (element: AWSTreeNodeBase | undefined) => {
162161
awsExplorer.refresh(element)
163162
}),

src/awsexplorer/commands/copyArn.ts

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/awsexplorer/commands/copyName.ts renamed to src/awsexplorer/commands/copyText.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,23 @@ import { copyToClipboard } from '../../shared/utilities/messages'
88
import { AWSResourceNode } from '../../shared/treeview/nodes/awsResourceNode'
99
import { TreeShim } from '../../shared/treeview/utils'
1010

11-
/**
12-
* Copies the name of the resource represented by the given node.
13-
*/
14-
export async function copyNameCommand(
11+
export type copyableText = 'ARN' | 'name' | 'id'
12+
13+
export async function copyTextCommand(
1514
node: AWSResourceNode | TreeShim<AWSResourceNode>,
15+
text: copyableText,
1616
env = Env.vscode()
1717
): Promise<void> {
1818
node = node instanceof TreeShim ? node.node.resource : node
19-
20-
await copyToClipboard(node.name, 'name', env)
19+
switch (text) {
20+
case 'ARN':
21+
await copyToClipboard(node.arn, text, env)
22+
break
23+
case 'name':
24+
await copyToClipboard(node.name, text, env)
25+
break
26+
case 'id':
27+
await copyToClipboard(node.id!, text, env)
28+
break
29+
}
2130
}

src/ec2/activation.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import { telemetry } from '../shared/telemetry/telemetry'
88
import { Ec2InstanceNode } from './explorer/ec2InstanceNode'
99
import { promptUserForEc2Selection } from './prompter'
1010
import { Ec2ConnectionManager } from './model'
11+
import { copyTextCommand } from '../awsexplorer/commands/copyText'
12+
import { Ec2Node } from './explorer/ec2ParentNode'
13+
import { openRemoteConnection } from './commands'
1114

1215
export async function activate(ctx: ExtContext): Promise<void> {
1316
ctx.extensionContext.subscriptions.push(
@@ -26,6 +29,14 @@ export async function activate(ctx: ExtContext): Promise<void> {
2629
const connectionManager = new Ec2ConnectionManager(selection.region)
2730

2831
await connectionManager.attemptToOpenRemoteConnection(selection)
32+
}),
33+
34+
Commands.register('aws.ec2.copyInstanceId', async (node: Ec2InstanceNode) => {
35+
await copyTextCommand(node, 'id')
36+
}),
37+
38+
Commands.register('aws.ec2.openRemoteConnection', async (node?: Ec2Node) => {
39+
await (node ? openRemoteConnection(node) : openRemoteConnection(node))
2940
})
3041
)
3142
}

src/ec2/commands.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { Ec2InstanceNode } from './explorer/ec2InstanceNode'
77
import { Ec2Node } from './explorer/ec2ParentNode'
88
import { Ec2ConnectionManager } from './model'
9+
import { copyToClipboard } from '../shared/utilities/messages'
910
import { promptUserForEc2Selection } from './prompter'
1011

1112
export async function openTerminal(node?: Ec2Node) {
@@ -20,3 +21,7 @@ export async function openRemoteConnection(node?: Ec2Node) {
2021
//const connectionManager = new Ec2ConnectionManager(selection.region)
2122
console.log(selection)
2223
}
24+
25+
export async function copyInstanceId(instanceId: string): Promise<void> {
26+
await copyToClipboard(instanceId, 'Id')
27+
}

0 commit comments

Comments
 (0)