Skip to content

Commit 4f29a9f

Browse files
committed
(GH-400) Add Modulepath setting
Currently the only way to specify additional modulepaths is to modify the puppet.conf on the system. This commit adds an additional modulepath in VSCode Extension settings and then passes that into the Puppet Editor Services.
1 parent c2cef09 commit 4f29a9f

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
66

77
## Unreleased
88

9+
- ([GH-440](https://github.com/lingua-pupuli/puppet-vscode/issues/440)) Add a setting for additional modulepath
910
- ([GH-447](https://github.com/lingua-pupuli/puppet-vscode/issues/447)) Update puppet-editor-services to [0.17.0](https://github.com/lingua-pupuli/puppet-editor-services/blob/master/CHANGELOG.md#0170---2018-12-14)
1011

1112
## [0.14.0] - 2018-12-03

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@
280280
"verbose"
281281
]
282282
},
283+
"puppet.editorService.modulePath": {
284+
"type": "string",
285+
"default": "",
286+
"description": "Additional module paths to use when starting the Editor Services. On Windows this is delimited with a semicolon, and on all other platforms, with a colon. For example C:\\Path1;C:\\Path2"
287+
},
283288
"puppet.editorService.protocol": {
284289
"type": "string",
285290
"default": "stdio",

src/helpers/commandHelper.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ export class CommandEnvironmentHelper {
9090
if (vscode.workspace.workspaceFolders !== undefined) {
9191
args.push('--local-workspace=' + vscode.workspace.workspaceFolders[0].uri.fsPath);
9292
}
93+
if (settings.editorService.modulePath !== undefined && settings.editorService.modulePath !== '') {
94+
args.push('--puppet-settings=--modulepath,' + settings.editorService.modulePath);
95+
}
9396
if (config.enableFileCache) {
9497
args.push('--enable-file-cache');
9598
}

src/settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface IEditorServiceSettings {
1717
docker?: IEditorServiceDockerSettings;
1818
enable?: boolean;
1919
featureflags?: string[];
20+
modulePath?: string;
2021
loglevel?: string;
2122
protocol?: ProtocolType;
2223
tcp?: IEditorServiceTCPSettings;
@@ -119,6 +120,7 @@ export function settingsFromWorkspace(): ISettings {
119120
enable: true,
120121
featureflags: [],
121122
loglevel: "normal",
123+
modulePath: "",
122124
protocol: ProtocolType.STDIO,
123125
timeout: 10,
124126
};

0 commit comments

Comments
 (0)