aws-toolkit-vscode: "Scanning CloudFormation templates..." notification never goes away/finishes

Problem

Steps to reproduce the issue

  1. Install AWS Toolkit
  2. Open a large workspace with lots of files and folders.
  3. Observe that on any file open, you see this “Scanning CloudFormation templates…” notification.
  4. Close the notification.
  5. Open a new file.
  6. And the notification re-appears with the same loading bar and never finishes.

Expected behavior

My assumption is that the file scan is just never completing because there are so many files and if so, perhaps you could utilize the user’s search exclude list to ignore irrelevant files.

Or give me an option to fully disable this feature and prevent CFN template discovery / watching.

System details (run the AWS: About Toolkit command)

  • OS: Linux x64 5.4.242-162.348.amzn2int.x86_64
  • Visual Studio Code version: 1.78.2
  • AWS Toolkit version: 1.74.0

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 7
  • Comments: 21 (11 by maintainers)

Commits related to this issue

Most upvoted comments

The correct approach is to allow users who do not have CloudFormations to disable it. Not exclude locations. ZERO scanning.

Is there a way to disable CloudFormation linting altogether?

Not yet, but performance is one of our priorities in the near/medium-term.

Adding a setting to disable this is non-trivial because SAM features depend on it. The work needed to make a “disable” setting work is similar to the work needed for the scan to be “on-demand”.

Meanwhile you can disable this by setting files.watcherExclude.

perhaps you could utilize the user’s search exclude list to ignore irrelevant files.

Implemented in AWS Toolkit 1.86. All directories mentioned by the standard vscode settings files.exclude, search.exclude, and files.watcherExclude, are ignored by the “Scanning CloudFormation templates” feature.

That provides a flexible workaround, but the root cause of the performance issue could still be improved, so leaving this issue open.

This is not helpful. The CloudFormation scan hangs vscode at startup. I don’t want the scan at all, but I want search to work for my other extensions and find in files and the global setting disables that.

So, after a few days with the affinity setting enabled, I still notice very big delays in other extensions while the “Scanning CloudFormation templates…” task is running. Is there a way to disable CloudFormation linting altogether? I do not use CloudFormation templates at all and my workspace is very big, which I suspect is the reason why the scanning for templates takes forever to complete.

Unfortunately, disabling via files.watcherExclude does not only affect the AWS Toolkit functionality and is an unacceptable workaround, as we do rely on other functionality using file watchers.

I think it would at least be good to add one non-standard-vscode setting to that list, so that one could use that setting to exclude parts of hiw workspace, while not affecting other VSCode functionalities.

I’m not 100% sure what the sequencing is, but I’ve also merged https://github.com/aws/aws-toolkit-vscode/pull/3931 , which was rescanning the workspace multiple times for each runtime we support…I’m not sure if VS Code attempts to run this scanner at the same time as the YAML one (where the message is generated from).

If you want to give this a crack before the next release, you can try the latest prerelease VSIX: https://github.com/aws/aws-toolkit-vscode/releases/tag/prerelease

@justinmk3 Do we have a timeline on when (or if) this setting (to disable scans) be released?

Supporting “exclude patterns” was a low-risk way to ameliorate some (but not all) scenarios. The next step in improving this behavior is to make it “just in time” so that it doesn’t try to scan until SAM features are actually requested.

perhaps you could utilize the user’s search exclude list to ignore irrelevant files.

Implemented in AWS Toolkit 1.86. All directories mentioned by the standard vscode settings files.exclude, search.exclude, and files.watcherExclude, are ignored by the “Scanning CloudFormation templates” feature.

That provides a flexible workaround, but the root cause of the performance issue could still be improved, so leaving this issue open.

I’ll enable the setting and give it an in-depth try tomorrow, from a first look it seems that it improves the situation greatly already.