Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion packages/core/src/lambda/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { liveTailRegistry, liveTailCodeLensProvider } from '../awsService/cloudW
import { getFunctionLogGroupName } from '../awsService/cloudWatchLogs/activation'
import { ToolkitError, isError } from '../shared/errors'
import { LogStreamFilterResponse } from '../awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu'
import { registerLambdaUriHandler } from './uriHandlers'

/**
* Activates Lambda components.
Expand Down Expand Up @@ -116,6 +117,8 @@ export async function activate(context: ExtContext): Promise<void> {
throw err
}
}
})
}),

registerLambdaUriHandler()
)
}
39 changes: 39 additions & 0 deletions packages/core/src/lambda/uriHandlers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*!
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

import * as vscode from 'vscode'
import * as nls from 'vscode-nls'

import { SearchParams } from '../shared/vscode/uriHandler'
import { showMessage } from '../shared/utilities/messages'
import globals from '../shared/extensionGlobals'

const localize = nls.loadMessageBundle()

export function registerLambdaUriHandler() {
async function openFunctionHandler(params: ReturnType<typeof parseOpenParams>) {
await showMessage(
'warn',
localize(
'AWS.lambda.uriUnavailable',
'The URI handler you are attempting to open is not handled in this version of the toolkit, try installing the latest version'
)
)
}

return vscode.Disposable.from(
globals.uriHandler.onPath('/lambda/load-function', openFunctionHandler, parseOpenParams)
Copy link
Contributor

@justinmk3 justinmk3 Jun 9, 2025

Choose a reason for hiding this comment

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

👍 thanks for re-using the existing module and patterns.

)
}
function parseOpenParams(query: SearchParams) {
return {
functionName: query.getOrThrow(
'functionName',
localize('AWS.lambda.open.missingName', 'A function name must be provided')
),
region: query.getOrThrow('region', localize('AWS.lambda.open.missingRegion', 'A region must be provided')),
isCfn: query.get('isCfn'),
}
}
Loading