Skip to content

Commit 2e6bd33

Browse files
authored
Merge pull request #17 from supermario/configure-compiler
Allow user to configure an alternative Elm compiler
2 parents edf2ac0 + 382f75f commit 2e6bd33

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
"command": "elmLand.htmlToElm",
4141
"enablement": "false"
4242
},
43-
{
43+
{
4444
"category": "Elm Land",
4545
"title": "Install Elm",
4646
"command": "elmLand.installElm",
4747
"enablement": "false"
4848
},
49-
{
49+
{
5050
"category": "Elm Land",
5151
"title": "Install elm-format",
5252
"command": "elmLand.installElmFormat",
@@ -112,6 +112,12 @@
112112
"description": "Enable the 'HTML to Elm' feature",
113113
"type": "boolean",
114114
"default": true
115+
},
116+
"elmLand.compilerFilepath": {
117+
"order": 7,
118+
"description": "The path to your Elm compiler",
119+
"type": "string",
120+
"default": "elm"
115121
}
116122
}
117123
}
@@ -151,4 +157,4 @@
151157
"terser": "5.16.3",
152158
"typescript": "4.9.4"
153159
}
154-
}
160+
}

src/features/error-highlighting.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,12 @@ const Elm = {
128128
const promise: Promise<ParsedError | undefined> =
129129
new Promise((resolve, reject) => {
130130
const isWindows = process.platform === 'win32'
131+
const compiler = vscode.workspace.getConfiguration('elmLand').compilerFilepath;
132+
131133
// This uses `spawn` so that we can support folders with spaces in them
132134
// without having to think about escaping.
133135
const child = child_process.spawn(
134-
'elm',
136+
compiler,
135137
[
136138
'make',
137139
// `shell: true` is needed on Windows to execute shell scripts (non .exe files).

0 commit comments

Comments
 (0)