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

add configuration for exclude root module #446

Merged
merged 2 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ If you have multiple root modules in your workspace, you can configure the langu
}
```

If you want to automatically search root modules in your workspace and exclude some folders, you can configure the language server settings to identify them.
```
{
"terraform-ls.excludeRootModules": [
"/module3",
"/module4"
]
}
```

## Release History

**v2.0.0** is the first official release from HashiCorp, prior releases were by [Mikael Olenfalk](https://github.com/mauve).
Expand Down
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@
},
"default": [],
"description": "Per-workspace list of module directories for the language server to read"
},
"terraform-ls.excludeRootModules": {
"scope": "resource",
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Per-workspace list of module directories for the language server to exclude"
}
}
},
Expand Down
5 changes: 4 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ function newClient(cmd: string, folder: string) {
const channelName = `${binaryName}/${folder}`;
const f = pathToWorkspaceFolder(folder);
const serverArgs: string[] = config('terraform').get('languageServer.args');
let initializationOptions = { rootModulePaths: config('terraform-ls', f).get('rootModules') };
let initializationOptions = {
rootModulePaths: config('terraform-ls', f).get('rootModules'),
excludeModulePaths: config('terraform-ls', f).get('excludeRootModules')
};

const setup = vscode.window.createOutputChannel(channelName);
setup.appendLine(`Launching language server: ${cmd} ${serverArgs.join(' ')} for folder: ${folder}`);
Expand Down