-
Notifications
You must be signed in to change notification settings - Fork 141
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Current Version
v0.4.0
Use-cases
Currently the whole hierarchy is walked through to discover root modules on initialization synchronously:
terraform-ls/langserver/handlers/initialize.go
Lines 58 to 66 in e40f7c5
walker := rootmodule.NewWalker() | |
walker.SetLogger(lh.logger) | |
err = walker.WalkInitializedRootModules(fh.Dir(), func(dir string) error { | |
lh.logger.Printf("Adding root module (via %T): %s", rmm, dir) | |
return rmm.AddRootModule(dir) | |
}) | |
if err != nil { | |
return serverCaps, err | |
} |
This can result in:
- delay in adding paths to the watcher
- delayed initial response to the client, which means the client may refuse to provide any functionality until
initialize
request is responded to
Proposal
Run walker asynchronously.
It should still be cancellable per session though.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request