Skip to content
Open
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 selene-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 7 additions & 1 deletion selene-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,15 @@ export async function activate(
return
}

const configPath = vscode.workspace
.getConfiguration("selene")
.get<string | null>("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(),
Expand Down