Skip to content

Allow user to override discovery of root modules #189

@radeksimko

Description

@radeksimko

Current Version

0.4.0

Use-cases

Currently the language server will walk through the hierarchy on initialize and attempt to discover all initialized root modules and obtain the schema from all, so it can later be matched to files being opened in the editor.

There are scenarios where this may not be sufficient:

Proposal

Allow the user to override the discovery mechanism by defining a list of paths to root modules.

This could be provided in the form of:

  • CLI flags (e.g. -root-module=/path/one -root-module=/path/two etc.)
  • LSP settings - this has an added benefit of reacting to changes at runtime (adding/removing root module without having to restart the server)

Related LSP methods

https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_configuration
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeConfiguration

References

hashicorp/vscode-terraform#396

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions