You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some code to search a launch.json file via await vscode.workspace.findFiles(".vscode/launch.json", "**/node_modules/**");, it can be optimized by specifying the workspace folder and maxResult as 1.
Hi Jinbo Wang (@testforstephen), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Here’s how you can optimize your launch.json lookup:
Scope to a single folder and limit results
import{RelativePattern,workspace,WorkspaceFolder}from'vscode';asyncfunctionfindLaunchJson(folder: WorkspaceFolder){// only look under the workspace folder’s .vscode folder, stop after the first matchconstpattern=newRelativePattern(folder,'.vscode/launch.json');constresults=awaitworkspace.findFiles(pattern,'**/node_modules/**',1);returnresults[0];}
If you don’t need a RelativePattern, you can still pass maxResults directly:
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!
Activity
github-actions commentedon Nov 10, 2025
Hi Jinbo Wang (@testforstephen), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Here’s how you can optimize your launch.json lookup:
Scope to a single folder and limit results
If you don’t need a RelativePattern, you can still pass maxResults directly:
Other references worth checking:
Low-confidence reference
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!