Skip to content

Commit 0824669

Browse files
committed
Make the "languageServerHaskell.trace.server" setting work
Prior to this it had no effect, it now maps to log commands to hie. For some reason it applies to launching via the debug options, I have no idea why that is the case. Mapping is "off" : hie --lsp "messages" : hie --lsp -d -l /tmp/hie.log "verbose" : hie --lsp -d -l /tmp/hie.log --vomit
1 parent 3745b02 commit 0824669

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-hie-server",
33
"displayName": "Haskell Language Server",
44
"description": "Language Server Protocol for Haskell via HIE",
5-
"version": "0.0.17",
5+
"version": "0.0.18",
66
"license": "MIT",
77
"publisher": "alanz",
88
"engines": {

src/extension.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ function activateHieNoCheck(context: ExtensionContext, folder: WorkspaceFolder,
107107
const useHieWrapper = workspace.getConfiguration('languageServerHaskell', uri).useHieWrapper;
108108
let hieExecutablePath = workspace.getConfiguration('languageServerHaskell', uri).hieExecutablePath;
109109
let customWrapperPath = workspace.getConfiguration('languageServerHaskell', uri).useCustomHieWrapperPath;
110+
const logLevel = workspace.getConfiguration('languageServerHaskell', uri).trace.server;
110111

111112
// Substitute path variables with their corresponding locations.
112113
if (useCustomWrapper) {
@@ -147,7 +148,13 @@ function activateHieNoCheck(context: ExtensionContext, folder: WorkspaceFolder,
147148

148149
const tempDir = os.tmpdir();
149150
const runArgs = [];
150-
const debugArgs = ['-d', '-l', path.join(tempDir, 'hie.log')];
151+
// const debugArgs = ['-d', '-l', path.join(tempDir, 'hie.log')];
152+
let debugArgs = [''];
153+
if (logLevel == 'verbose') {
154+
debugArgs = ['-d', '-l', path.join(tempDir, 'hie.log'), '--vomit'];
155+
} else if (logLevel == 'messages') {
156+
debugArgs = ['-d', '-l', path.join(tempDir, 'hie.log')];
157+
}
151158
if (!useCustomWrapper && !useHieWrapper && hieExecutablePath !== '') {
152159
runArgs.unshift('--lsp');
153160
debugArgs.unshift('--lsp');

0 commit comments

Comments
 (0)