Closed ahoppen closed 5 months ago
Yeah I should be able to move this to an earlier point, at least before the resolve.
I had a look at this and the LanguageClient.start()
is called before any projects are loaded. And I've verified the sourcekit-lsp executable is running once that returns.
Stick a breakpoint here to verify https://github.com/swift-server/vscode-swift/blob/dfba3243e6cb97faa45037d11478e2714d4d5e17/src/sourcekit-lsp/LanguageClientManager.ts#L507-L511
Oh, sorry, taking this back. Looks like initialization just takes a while in sourcekit-lsp. And I guess it’s doing similar things as resolve packages (or might even be competing for the lock to the .build
directory) they probably finish at around the same time, which mislead me.
Not sure what would be involved here but it looks like the Swift extension only launches SourceKit-LSP after it has loaded the package (eg. resolved package dependencies). When opening SourceKit-LSP, this step takes >10s. During this time, no functionality from SourceKit-LSP is available, for example there is no document outline during this time.
I’m not sure if there’s a hard requirement to only launch sourcekit-lsp after the package has been loaded by the extension but I think it would be worth investigating if we can launch SourceKit-LSP straight away.