Skip to content

Commit dae5187

Browse files
committed
Merge branch 'remove-wrapper-config'
2 parents 421fe9b + 1b5401f commit dae5187

File tree

4 files changed

+7
-160
lines changed

4 files changed

+7
-160
lines changed

hie-wrapper-old.sh

Lines changed: 0 additions & 104 deletions
This file was deleted.

hie-wrapper.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@
5555
"description":
5656
"Set the path to your hie executable, if it's not already on your $PATH. Works with ~, ${HOME} and ${workspaceFolder}."
5757
},
58-
"languageServerHaskell.useHieWrapper": {
59-
"scope": "resource",
60-
"type": "boolean",
61-
"default": false,
62-
"description":
63-
"Try to automatically select the correct hie version, based on your projects GHC version. NOTE: Build hie using the Makefile to get all versions. This will take precedence over hieExecutablePath."
64-
},
6558
"languageServerHaskell.useCustomHieWrapper": {
6659
"scope": "resource",
6760
"type": "boolean",

src/extension.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function activateHieNoCheck(context: ExtensionContext, folder: WorkspaceFolder,
104104
}
105105

106106
const useCustomWrapper = workspace.getConfiguration('languageServerHaskell', uri).useCustomHieWrapper;
107-
const useHieWrapper = workspace.getConfiguration('languageServerHaskell', uri).useHieWrapper;
107+
// const useHieWrapper = workspace.getConfiguration('languageServerHaskell', uri).useHieWrapper;
108108
let hieExecutablePath = workspace.getConfiguration('languageServerHaskell', uri).hieExecutablePath;
109109
let customWrapperPath = workspace.getConfiguration('languageServerHaskell', uri).useCustomHieWrapperPath;
110110
const logLevel = workspace.getConfiguration('languageServerHaskell', uri).trace.server;
@@ -126,25 +126,20 @@ function activateHieNoCheck(context: ExtensionContext, folder: WorkspaceFolder,
126126
.replace(/^~/, os.homedir);
127127
}
128128

129-
// Set the executable, based on the settings. The order goes:
130-
// First check useCustomWrapper, then check useHieWrapper, then
131-
// check hieExecutablePath, else retain original path.
132-
let hieLaunchScript = 'hie-vscode.sh';
129+
// Set the executable, based on the settings. The order goes: First
130+
// check useCustomWrapper, then check hieExecutablePath, else retain
131+
// original path.
132+
let hieLaunchScript = process.platform === 'win32' ? 'hie-vscode.bat' : 'hie-vscode.sh';
133133
if (useCustomWrapper) {
134134
hieLaunchScript = customWrapperPath;
135-
} else if (useHieWrapper) {
136-
hieLaunchScript = 'hie-wrapper.sh';
137135
} else if (hieExecutablePath !== '') {
138136
hieLaunchScript = hieExecutablePath;
139137
}
140138

141-
// Don't use the .bat launcher, if the user specified a custom wrapper or a executable path.
142-
const startupScript =
143-
process.platform === 'win32' && !useCustomWrapper && !hieExecutablePath ? 'hie-vscode.bat' : hieLaunchScript;
144139
// If using a custom wrapper or specificed an executable path, the path is assumed to already
145140
// be absolute.
146141
const serverPath =
147-
useCustomWrapper || hieExecutablePath ? startupScript : context.asAbsolutePath(path.join('.', startupScript));
142+
useCustomWrapper || hieExecutablePath ? hieLaunchScript : context.asAbsolutePath(path.join('.', hieLaunchScript));
148143

149144
const tempDir = os.tmpdir();
150145
const runArgs = [];
@@ -155,7 +150,7 @@ function activateHieNoCheck(context: ExtensionContext, folder: WorkspaceFolder,
155150
} else if (logLevel === 'messages') {
156151
debugArgs = ['-d', '-l', path.join(tempDir, 'hie.log')];
157152
}
158-
if (!useCustomWrapper && !useHieWrapper && hieExecutablePath !== '') {
153+
if (!useCustomWrapper && hieExecutablePath !== '') {
159154
runArgs.unshift('--lsp');
160155
debugArgs.unshift('--lsp');
161156
}

0 commit comments

Comments
 (0)