Importing modules from Vapor causing long delays

I imported two Vapor modules into a file. As soon as I did I noticed that they were underlined in red and appeared in the problems tab in VSCode. From that point on the fans on my MacBook Pro increased dramatically in speed while I waited for these modules to be ... I assume 'indexed'. The whole process took about a minute. I had already built the project. I thought that all this indexing occurred when a build occurred.
Any ideas on why this is happening?

Here is another example:

In this example I imported the two modules and then typed in the classname and 'Model' protocol. This also took about a minute to come back from validating. I didn't even try and do any code completion. The fans again spun up on the MacBook Pro. I finally got the problems listed at the bottom of the screenshot.
I don't understand why this is happening.

I'm not sure what's going on here. We do not have "background indexing" in sourcekit-lsp. Is there an example packageI could use to reproduce this issue?

Attachment available until Aug 14, 2020

Hi Ben,

Yes. I am using the Vapor package for building server side swift applications. Vapor has a lot of dependencies. What I could do is send you my project. It is just a tutorial so I really don't care about the content. I will zip it up and send it to you. It works fine in Xcode. No performance issues and it is pretty snappy.

Click to Download

myProject.zip
301.6 MB

I can reproduce roughly the behaviour you describe, and it appears to be the known code-completion performance issue causing it. While you may not have intentionally invoked completion, typing an identifier will trigger completion automatically in vscode. This is something I am working on.