diff --git a/selene-vscode/package.json b/selene-vscode/package.json index 2defeb01..7dd1fe78 100644 --- a/selene-vscode/package.json +++ b/selene-vscode/package.json @@ -58,6 +58,16 @@ "description": "Specifies the path of selene. If not specified, selene will automatically download from the GitHub releases.", "scope": "machine-overridable" }, + "selene.configPath": { + "title": "Path", + "type": [ + "string", + null + ], + "default": null, + "description": "Specifies the path to the selene configuration file. If not specified, selene will automatically attempt to find the configuration file at project root.", + "scope": "machine-overridable" + }, "selene.run": { "title": "Run", "type": "string", diff --git a/selene-vscode/src/extension.ts b/selene-vscode/src/extension.ts index 2b8f1353..c5094e16 100644 --- a/selene-vscode/src/extension.ts +++ b/selene-vscode/src/extension.ts @@ -147,9 +147,15 @@ export async function activate( return } + const configPath = vscode.workspace + .getConfiguration("selene") + .get("configPath") + const command = "--display-style=json2 --no-summary -" + const configCommand = configPath ? `--config ${configPath} ${command}` : command + const output = await selene.seleneCommand( context.globalStorageUri, - "--display-style=json2 --no-summary -", + configCommand, selene.Expectation.Stderr, vscode.workspace.getWorkspaceFolder(document.uri), document.getText(),