Skip to content
Closed
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/out/src/**/*.js"],
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"preLaunchTask": "npm: webpack"
},
{
Expand Down
24 changes: 24 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog for vscode-haskell

## 2.6.1

- Prefer the `set` version for `cabal` and `stack` if there is any
([#1275](https://github.com/haskell/vscode-haskell/pull/1275)) by @fendor
- Make js debugger work
([#1258](https://github.com/haskell/vscode-haskell/pull/1258)) by @dyniec
- Prepare release 2.6.0
([#1103](https://github.com/haskell/vscode-haskell/pull/1103)) by @fendor

## 2.6.0

- Add option to enable/disable `.cabal` file support
([#1223](https://github.com/haskell/vscode-haskell/pull/1223)) by @fendor
- Upgrade project to use latest eslint version
([#1150](https://github.com/haskell/vscode-haskell/pull/1150)) by @fendor
- Fix windows CI
([#1149](https://github.com/haskell/vscode-haskell/pull/1149)) by @fendor
- Manually install ghcup into image
([#1119](https://github.com/haskell/vscode-haskell/pull/1119)) by @fendor
- bump vscode-languageclient version to 9.0.1
([#1108](https://github.com/haskell/vscode-haskell/pull/1108)) by @jetjinser
- Add cabalFormattingProvider to package.json
([#1100](https://github.com/haskell/vscode-haskell/pull/1100)) by @fendor

## 2.5.3

- Split out packaging action
Expand Down
58 changes: 47 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "haskell",
"displayName": "Haskell",
"description": "Haskell language support powered by the Haskell Language Server",
"version": "2.5.3",
"version": "2.6.1",
"license": "MIT",
"publisher": "haskell",
"engines": {
Expand Down Expand Up @@ -292,6 +292,24 @@
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.cabal.hoverOn": {
"default": true,
"description": "Enables cabal hover",
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.cabal.symbolsOn": {
"default": true,
"description": "Enables cabal symbols",
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.cabalHaskellIntegration.globalOn": {
"default": true,
"description": "Enables cabalHaskellIntegration plugin",
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.callHierarchy.globalOn": {
"default": true,
"description": "Enables callHierarchy plugin",
Expand All @@ -316,6 +334,18 @@
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.eval.codeActionsOn": {
"default": true,
"description": "Enables eval code actions",
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.eval.codeLensOn": {
"default": true,
"description": "Enables eval code lenses",
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.eval.config.diff": {
"default": true,
"markdownDescription": "Enable the diff output (WAS/NOW) of eval lenses",
Expand All @@ -328,15 +358,15 @@
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.eval.globalOn": {
"haskell.plugin.explicit-fields.codeActionsOn": {
"default": true,
"description": "Enables eval plugin",
"description": "Enables explicit-fields code actions",
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.explicit-fields.globalOn": {
"haskell.plugin.explicit-fields.inlayHintsOn": {
"default": true,
"description": "Enables explicit-fields plugin",
"description": "Enables explicit-fields inlay hints",
"scope": "resource",
"type": "boolean"
},
Expand Down Expand Up @@ -470,6 +500,12 @@
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.importLens.inlayHintsOn": {
"default": true,
"description": "Enables importLens inlay hints",
"scope": "resource",
"type": "boolean"
},
"haskell.plugin.moduleName.globalOn": {
"default": true,
"description": "Enables moduleName plugin",
Expand Down Expand Up @@ -1321,23 +1357,23 @@
"@eslint/js": "^9.24.0",
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.10",
"@types/node": "^22.14.0",
"@types/node": "^22.15.29",
"@types/vscode": "^1.96.0",
"@types/which": "^3.0.4",
"@typescript-eslint/eslint-plugin": "^8.29.0",
"@typescript-eslint/parser": "^8.29.0",
"@typescript-eslint/parser": "^8.37.0",
"@vscode/test-cli": "^0.0.10",
"@vscode/test-electron": "^2.5.2",
"eslint": "^9.24.0",
"eslint": "^9.28.0",
"eslint-webpack-plugin": "^5.0.0",
"glob": "^11.0.1",
"globals": "^16.0.0",
"glob": "^11.0.2",
"globals": "^16.2.0",
"husky": "^9.1.7",
"mocha": "^11.1.0",
"prettier": "^3.5.3",
"ts-loader": "^9.5.2",
"typescript": "^5.8.3",
"typescript-eslint": "^8.29.0",
"typescript-eslint": "^8.33.0",
"webpack": "^5.98.0",
"webpack-cli": "^6.0.1"
},
Expand Down
23 changes: 21 additions & 2 deletions src/hlsBinaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ export async function findHaskellLanguageServer(
latestHLS = await getLatestToolFromGHCup(context, logger, 'hls');
}
if (latestCabal === undefined) {
latestCabal = await getLatestToolFromGHCup(context, logger, 'cabal');
latestCabal = await getSetOrLatestToolFromGHCup(context, logger, 'cabal');
}
if (latestStack === undefined) {
latestStack = await getLatestToolFromGHCup(context, logger, 'stack');
latestStack = await getSetOrLatestToolFromGHCup(context, logger, 'stack');
}
if (recGHC === undefined) {
recGHC = !executableExists('ghc')
Expand Down Expand Up @@ -630,6 +630,25 @@ export async function getStoragePath(context: ExtensionContext): Promise<string>
return storagePath;
}

// the tool might be installed or not
async function getSetOrLatestToolFromGHCup(context: ExtensionContext, logger: Logger, tool: Tool): Promise<string> {
// these might be custom/stray/compiled, so we try first
const installedVersions = await callGHCup(
context,
logger,
['list', '-t', tool, '-c', 'set', '-r'],
undefined,
false,
);
const latestInstalled = installedVersions.split(/\r?\n/).pop();
if (latestInstalled) {
return latestInstalled.split(/\s+/)[1];
}

return getLatestToolFromGHCup(context, logger, tool);
}


// the tool might be installed or not
async function getLatestToolFromGHCup(context: ExtensionContext, logger: Logger, tool: Tool): Promise<string> {
// these might be custom/stray/compiled, so we try first
Expand Down
Loading
Loading