Skip to content

Commit 7e89eb3

Browse files
authored
CodeLens -> Inline Action (#166)
1 parent a1f9d13 commit 7e89eb3

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

package.nls.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"AWS.channel.aws.toolkit": "AWS Toolkit",
1515
"AWS.channel.aws.toolkit.activation.error": "Error Activating AWS Toolkit",
1616
"AWS.codelens.failToInitialize": "Failed to activate template registry. CodeLenses will not appear on SAM template files.",
17+
"AWS.codelens.failToInitialize.c9": "Failed to activate template registry. Inline Actions will not appear on SAM template files.",
1718
"AWS.codelens.lambda.invoke": "Run Locally",
1819
"AWS.codelens.lambda.invoke.debug": "Debug Locally",
1920
"AWS.configuration.title": "AWS Configuration",
@@ -461,6 +462,7 @@
461462
"AWS.samcli.initWizard.source.error.notInWorkspace": "Could not open file '{0}'. If this file exists on disk, try adding it to your workspace.",
462463
"AWS.samcli.initWizard.completionMessage": "Created SAM application \"{0}\" and added launch configurations to launch.json: {1}",
463464
"AWS.samcli.initWizard.launchConfigFail": "Created SAM application \"{0}\" but failed to generate launch configurations. You can generate these via CodeLens in the template or handler file.",
465+
"AWS.samcli.initWizard.launchConfigFail.c9": "Created SAM application \"{0}\" but failed to generate launch configurations. You can generate these via Inline Action in the template or handler file.",
464466
"AWS.pickDebugConfig.prompt": "Create a Debug Configuration from a CloudFormation Template",
465467
"AWS.pickDebugConfig.noTemplate": "No Template",
466468
"AWS.pickDebugConfig.noTemplate.detail": "Launch config will execute function in isolation, without referencing a CloudFormation template",

src/lambda/commands/createNewSamApp.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import * as pathutils from '../../shared/utilities/pathUtils'
4949
import { openLaunchJsonFile } from '../../shared/sam/debugger/commands/addSamDebugConfiguration'
5050
import { waitUntil } from '../../shared/utilities/timeoutUtils'
5151
import { launchConfigDocUrl } from '../../shared/constants'
52+
import { isCloud9 } from '../../shared/extensionUtilities'
5253

5354
export async function resumeCreateNewSamApp(
5455
extContext: ExtContext,
@@ -226,11 +227,17 @@ export async function createNewSamApplication(
226227
const helpText = localize('AWS.generic.message.getHelp', 'Get Help...')
227228
vscode.window
228229
.showWarningMessage(
229-
localize(
230-
'AWS.samcli.initWizard.launchConfigFail',
231-
'Created SAM application "{0}" but failed to generate launch configurations. You can generate these via CodeLens in the template or handler file.',
232-
config.name
233-
),
230+
isCloud9()
231+
? localize(
232+
'AWS.samcli.initWizard.launchConfigFail',
233+
'Created SAM application "{0}" but failed to generate launch configurations. You can generate these via CodeLens in the template or handler file.',
234+
config.name
235+
)
236+
: localize(
237+
'AWS.samcli.initWizard.launchConfigFail.c9',
238+
'Created SAM application "{0}" but failed to generate launch configurations. You can generate these via Inline Action in the template or handler file.',
239+
config.name
240+
),
234241
helpText
235242
)
236243
.then(async buttonText => {

src/shared/cloudformation/activation.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { localize } from '../utilities/vsCodeUtils'
99

1010
import { CloudFormationTemplateRegistry } from './templateRegistry'
1111
import { ext } from '../extensionGlobals'
12+
import { isCloud9 } from '../extensionUtilities'
1213

1314
export const TEMPLATE_FILE_GLOB_PATTERN = '**/template.{yaml,yml}'
1415

@@ -35,10 +36,15 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
3536
ext.templateRegistry = registry
3637
} catch (e) {
3738
vscode.window.showErrorMessage(
38-
localize(
39-
'AWS.codelens.failToInitialize',
40-
'Failed to activate template registry. CodeLenses will not appear on SAM template files.'
41-
)
39+
isCloud9()
40+
? localize(
41+
'AWS.codelens.failToInitialize',
42+
'Failed to activate template registry. CodeLenses will not appear on SAM template files.'
43+
)
44+
: localize(
45+
'AWS.codelens.failToInitialize.c9',
46+
'Failed to activate template registry. Inline Actions will not appear on SAM template files.'
47+
)
4248
)
4349
getLogger().error('Failed to activate template registry', e)
4450
}

0 commit comments

Comments
 (0)