Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding general explorer features to menu in AWS pane #333

Merged
merged 5 commits into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,26 @@
"command": "aws.refreshAwsExplorer",
"when": "view == lambda",
"group": "navigation@5"
},
{
"command": "aws.login",
"group": "1_account"
},
{
"command": "aws.showRegion",
"group": "2_region"
},
{
"command": "aws.hideRegion",
"group": "2_region"
},
{
"command": "aws.help",
"group": "z_help"
},
{
"command": "aws.github",
"group": "z_help"
}
],
"view/item/context": [
Expand Down Expand Up @@ -256,6 +276,16 @@
"command": "aws.showErrorDetails",
"title": "%AWS.command.showErrorDetails%",
"category": "AWS"
},
{
"command": "aws.help",
"title": "%AWS.command.help%",
"category": "AWS"
},
{
"command": "aws.github",
mpiroc marked this conversation as resolved.
Show resolved Hide resolved
"title": "%AWS.command.github%",
"category": "AWS"
}
]
},
Expand Down
2 changes: 2 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"AWS.telemetry.notificationMessage": "Please help improve the AWS Toolkit by enabling anonymous usage data to be sent to AWS. You can always change your mind later by going to the \"AWS Configuration\" section in your user settings",
"AWS.telemetry.notificationYes": "Enable",
"AWS.telemetry.notificationNo": "Disable",
"AWS.command.github": "View Source on Github",
"AWS.command.help": "View Documentation",
"AWS.command.login": "Connect to AWS",
"AWS.command.logout": "Sign out",
"AWS.command.createNewSamApp": "Create new SAM Application",
Expand Down
12 changes: 11 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { DefaultAWSClientBuilder } from './shared/awsClientBuilder'
import { AwsContextTreeCollection } from './shared/awsContextTreeCollection'
import { DefaultToolkitClientBuilder } from './shared/clients/defaultToolkitClientBuilder'
import { TypescriptCodeLensProvider } from './shared/codelens/typescriptCodeLensProvider'
import { extensionSettingsPrefix } from './shared/constants'
import { documentationUrl, extensionSettingsPrefix, githubUrl } from './shared/constants'
import { DefaultCredentialsFileReaderWriter } from './shared/credentials/defaultCredentialsFileReaderWriter'
import { DefaultAwsContext } from './shared/defaultAwsContext'
import { DefaultAWSContextCommands } from './shared/defaultAwsContextCommands'
Expand Down Expand Up @@ -87,6 +87,16 @@ export async function activate(context: vscode.ExtensionContext) {
async (node?: RegionNode) => await ext.awsContextCommands.onCommandHideRegion(safeGet(node, x => x.regionCode))
)

// register URLs in extension menu
vscode.commands.registerCommand(
'aws.help',
() => { vscode.env.openExternal(vscode.Uri.parse(documentationUrl(vscode.env.language))) }
)
vscode.commands.registerCommand(
'aws.github',
() => { vscode.env.openExternal(vscode.Uri.parse(githubUrl)) }
)

const providers = [
new LambdaTreeDataProvider(
awsContext,
Expand Down
8 changes: 8 additions & 0 deletions src/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ export const hostedFilesBaseUrl: string = 'https://d3rrggjwfhwld2.cloudfront.net
export const endpointsFileUrl: string = 'https://aws-toolkit-endpoints.s3.amazonaws.com/endpoints.json'
export const aboutCredentialsFileUrl: string = 'https://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html'
export const samAboutInstallUrl: string = 'https://aws.amazon.com/serverless/sam/'
export const githubUrl: string = 'https://github.com/aws/aws-toolkit-vscode'

const npmPackage = () => require('../../../package.json') as NpmPackage
export const pluginVersion = npmPackage().version

export function documentationUrl(language: string): string {
switch (language) {
default:
return 'https://aws.amazon.com/visualstudiocode/'
}
}