Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ignorelist for module indexing configurable #670

Closed
radeksimko opened this issue Oct 8, 2021 · 1 comment · Fixed by #696
Closed

Make ignorelist for module indexing configurable #670

radeksimko opened this issue Oct 8, 2021 · 1 comment · Fixed by #696
Assignees
Labels
enhancement New feature or request

Comments

@radeksimko
Copy link
Member

Use-cases

When editor launches the LS on behalf of the user, it will attempt to index all initialized modules within the hierarchy.
Some users open directories which are relatively high up in the hierarchy, meaning that there is many directories to walk through, which in turn may consume CPU and filesystem I/O resources.

This is why we also avoid descending into certain directories which will never contain editable Terraform modules.

// skipDirNames represent directory names which would never contain
// plugin/module cache, so it's safe to skip them during the walk
skipDirNames = map[string]bool{
".git": true,
".idea": true,
".vscode": true,
"terraform.tfstate.d": true,
}

Users may however have additional directories in their workspace which they would like to ignore.

Proposal

Make the ignorelist configurable via options, similar to how other aspects of LS are configurable

type Options struct {
// ModulePaths describes a list of absolute paths to modules to load
ModulePaths []string `mapstructure:"rootModulePaths"`
ExcludeModulePaths []string `mapstructure:"excludeModulePaths"`
CommandPrefix string `mapstructure:"commandPrefix"`
// ExperimentalFeatures encapsulates experimental features users can opt into.
ExperimentalFeatures ExperimentalFeatures `mapstructure:"experimentalFeatures"`
TerraformExecPath string `mapstructure:"terraformExecPath"`
TerraformExecTimeout string `mapstructure:"terraformExecTimeout"`
TerraformLogFilePath string `mapstructure:"terraformLogFilePath"`
}

@github-actions
Copy link

github-actions bot commented Dec 9, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants