Bicep commands EXTREMELY slow in a large workspace
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
## Description
I've noticed that when working in a VSCode workspace with many files, the following commands are **VERY** slow to open (sometimes upwards of 30 seconds):
* Insert Resource
* Build ARM Template
* Deploy Bicep File
This also seems to block other language server capabilities - feels like VSCode just grinds to a halt.
If I have a single Bicep file open, things are fast (0 or >1, and things are slow), leading me to guess that it's related to the `findFiles` call here: https://github.com/Azure/bicep/blob/a81dcdbc40f3ab1c6b94e7ba374f02f71b002db6/src/vscode-bicep/src/commands/findOrCreateActiveBicepFile.ts#L52
## To Repro
* Open the Bicep repo (example of a large repo with many Bicep files)
* Either close all currently-open `.bicep` files, or ensure you have more than 1 open.
* Ctrl+Shift+P -> `Bicep: Insert Resource...`.
* The editor hangs for a long time.
Contributor guide
Research direction
Reproduce the slowdown in a large workspace such as the Bicep repository using Bicep: Insert Resource after closing or opening multiple .bicep files. Inspect findOrCreateActiveBicepFile.ts around the findFiles call, then verify that Insert Resource, Build ARM Template, and Deploy Bicep File no longer cause the editor to hang for tens of seconds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- performance, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100