Skip to content

Commit

Permalink
fix:correcting functionNames for javascript and typeScript
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya-eddy <[email protected]>
  • Loading branch information
Aditya-eddy committed Oct 8, 2024
1 parent ac4f08c commit fd26c1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ class KeployCodeLensProvider implements vscode.CodeLensProvider {
) {
const line = document.positionAt(node.startIndex).line;
const range = new vscode.Range(line, 0, line, 0);
console.log('🐰 Found function:', node.firstChild?.text);
const functionName = node.firstChild?.text || '';
console.log('🐰 Found function:', node.childForFieldName('name')?.text);
const functionName = node.childForFieldName('name')?.text || '';
codeLenses.push(new vscode.CodeLens(range, {
title: '🐰 Generate unit tests',
command: 'keploy.utg',
Expand Down Expand Up @@ -177,7 +177,7 @@ class KeployCodeLensProvider implements vscode.CodeLensProvider {
command: 'keploy.showSidebar',
arguments: [document.uri.fsPath,functionName,fileExtension]
}));
console.log('🐰 Found arrow function:', node.firstChild?.text);
console.log('🐰 Found arrow function:', node?.text);
}
}
} else if (fileName.endsWith('.py') && node.type === 'function_definition') {
Expand Down

0 comments on commit fd26c1d

Please sign in to comment.