Skip to content

Commit 71c79b9

Browse files
authored
feat(sam): disable "Add Debug Config" codelenses by default #2746
Problem: The heuristic for deciding what is a lambda handler function is too noisy, so the "AWS: ..." codelenses appear on almost any function for untyped languages such javascript or python. Solution: Disable the "aws.samcli.enableCodeLenses" setting by default. Customers can reenable these codelenses with the `AWS: Toggle SAM hints` command or the `Enable SAM hints` setting.
1 parent 11723eb commit 71c79b9

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "`Add SAM Debug Configuration` codelenses in source files are now disabled by default. (To enable the codelenses, use the `AWS: Toggle SAM hints in source files` command or the `Enable SAM hints` setting.)"
4+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
"aws.samcli.enableCodeLenses": {
195195
"type": "boolean",
196196
"description": "%AWS.configuration.enableCodeLenses%",
197-
"default": true
197+
"default": false
198198
},
199199
"aws.suppressPrompts": {
200200
"type": "object",

src/shared/codelens/codeLensUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ export async function makePythonCodeLensProvider(configuration: SamCliSettings):
311311
token: vscode.CancellationToken,
312312
forceProvide?: boolean
313313
): Promise<vscode.CodeLens[]> => {
314-
if (!forceProvide && !configuration.get('enableCodeLenses', true)) {
314+
if (!forceProvide && !configuration.get('enableCodeLenses', false)) {
315315
return []
316316
}
317317
// Try to activate the Python Extension before requesting symbols from a python file
@@ -338,7 +338,7 @@ export async function makeCSharpCodeLensProvider(configuration: SamCliSettings):
338338
token: vscode.CancellationToken,
339339
forceProvide?: boolean
340340
): Promise<vscode.CodeLens[]> => {
341-
if (!forceProvide && !configuration.get('enableCodeLenses', true)) {
341+
if (!forceProvide && !configuration.get('enableCodeLenses', false)) {
342342
return []
343343
}
344344
const handlers: LambdaHandlerCandidate[] = await csharpCodelens.getLambdaHandlerCandidates(document)
@@ -359,7 +359,7 @@ export function makeTypescriptCodeLensProvider(configuration: SamCliSettings): O
359359
token: vscode.CancellationToken,
360360
forceProvide?: boolean
361361
): Promise<vscode.CodeLens[]> => {
362-
if (!forceProvide && !configuration.get('enableCodeLenses', true)) {
362+
if (!forceProvide && !configuration.get('enableCodeLenses', false)) {
363363
return []
364364
}
365365
const handlers = await tsCodelens.getLambdaHandlerCandidates(document)
@@ -380,7 +380,7 @@ export async function makeGoCodeLensProvider(configuration: SamCliSettings): Pro
380380
token: vscode.CancellationToken,
381381
forceProvide?: boolean
382382
): Promise<vscode.CodeLens[]> => {
383-
if (!forceProvide && !configuration.get('enableCodeLenses', true)) {
383+
if (!forceProvide && !configuration.get('enableCodeLenses', false)) {
384384
return []
385385
}
386386
const handlers = await goCodelens.getLambdaHandlerCandidates(document)

0 commit comments

Comments
 (0)