diff --git a/Changelog.md b/Changelog.md index 8fcb4592..5742b23d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,10 @@ # Changelog for vscode-haskell +## 2.8.3 + +- Prepare release 2.8.3 ([#1396](https://github.com/haskell/vscode-haskell/pull/1396)) by @fendor + - Added new configuration options for HLS 2.15.0.0 + ## 2.8.2 - Add language-haskell extension pack diff --git a/package-lock.json b/package-lock.json index 0743a7b8..ebc19989 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "haskell", - "version": "2.8.1", + "version": "2.8.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "haskell", - "version": "2.8.1", + "version": "2.8.3", "license": "MIT", "dependencies": { "ts-pattern": "^5.9.0", @@ -22,7 +22,7 @@ "@typescript-eslint/eslint-plugin": "^8.56.0", "@typescript-eslint/parser": "^8.56.1", "@vscode/test-cli": "^0.0.12", - "@vscode/test-electron": "^2.5.2", + "@vscode/test-electron": "^3.1.0", "corepack": "^0.35.0", "eslint": "^10.4.0", "eslint-webpack-plugin": "^6.0.0", @@ -825,9 +825,9 @@ } }, "node_modules/@vscode/test-electron": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.5.2.tgz", - "integrity": "sha512-8ukpxv4wYe0iWMRQU18jhzJOHkeGKbnw7xWRX3Zw1WJA4cEKbHcmmLPdPrPtL6rhDcrlCZN+xKRpv09n4gRHYg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-3.1.0.tgz", + "integrity": "sha512-CRqv5u+YYoseuNVJ6Tyo4k0sF0mx4qnKMihRB0PjsUF8Dc0WKtCXo6CNL6nWWm5esfFQsQA/pejMj4ZbpJVLTw==", "dev": true, "license": "MIT", "dependencies": { @@ -838,7 +838,7 @@ "semver": "^7.6.2" }, "engines": { - "node": ">=16" + "node": ">=22" } }, "node_modules/@webassemblyjs/ast": { diff --git a/package.json b/package.json index 6a2a06d4..ead762ec 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "haskell", "displayName": "Haskell", "description": "Haskell language support powered by the Haskell Language Server", - "version": "2.8.2", + "version": "2.8.3", "license": "MIT", "publisher": "haskell", "engines": { @@ -231,10 +231,55 @@ "multipleComponents" ], "default": "multipleComponents", - "description": "Preferred approach for loading package components. Setting this to 'multiple components' allows the build tool (such as `cabal` or `stack`) to [load multiple components at once](https://github.com/haskell/cabal/pull/8726), which is a significant improvement.", + "description": "Preferred approach for loading package components. Setting this to 'multipleComponents' allows the build tool (such as `cabal` or `stack`) to [load multiple components at once](https://github.com/haskell/cabal/pull/8726), which is a significant improvement.", "enumDescriptions": [ "Prefer a multiple component session, if the build tool supports it. At the moment, only `cabal` supports multiple components session loading. If the `cabal` version does not support loading multiple components at once, we gracefully fall back to \"singleComponent\" mode.", "You can force single component session loading if you encountered any issues." + ], + "deprecationMessage": "Prefer `haskell.componentsLoading` in HLS 2.15.0.0 or newer. This option will keep working with HLS 2.15.0.0." + }, + "haskell.componentsLoading": { + "scope": "resource", + "type": "string", + "enum": [ + "single", + "multi: needed-only", + "multi: whole-project" + ], + "default": "multi: needed-only", + "description": "Preferred approach for loading package components. Setting this to 'multi: needed-only' allows the build tool (such as `cabal` or `stack`) to load multiple components at once, which is a significant improvement.", + "enumDescriptions": [ + "Load only the component required to load the file you open in the editor. Might fail if you open components that require a currently unloaded component.", + "Load components on demand that are required to load the files open in your editor.", + "Load the whole project at once. Experimental and might contain more bugs" + ] + }, + "haskell.linkDocTo": { + "scope": "resource", + "type": "string", + "enum": [ + "LinkToHackage", + "LinkToLocal" + ], + "default": "LinkToHackage", + "description": "Where should `Documentation` links in hover messages point to", + "enumDescriptions": [ + "Link to Hackage", + "Link to local haddock" + ] + }, + "haskell.linkSourceTo": { + "scope": "resource", + "type": "string", + "enum": [ + "LinkToHackage", + "LinkToLocal" + ], + "default": "LinkToHackage", + "description": "Where should `Source` links in hover messages point to", + "enumDescriptions": [ + "Link to Hackage", + "Link to local haddock" ] }, "haskell.supportCabalFiles": { @@ -319,6 +364,12 @@ "scope": "resource", "type": "boolean" }, + "haskell.plugin.caseSplit.globalOn": { + "default": true, + "description": "Enables caseSplit plugin", + "scope": "resource", + "type": "boolean" + }, "haskell.plugin.changeTypeSignature.globalOn": { "default": true, "description": "Enables changeTypeSignature plugin", @@ -379,6 +430,12 @@ "scope": "resource", "type": "boolean" }, + "haskell.plugin.export.globalOn": { + "default": true, + "description": "Enables export plugin", + "scope": "resource", + "type": "boolean" + }, "haskell.plugin.fourmolu.config.external": { "default": false, "markdownDescription": "Call out to an external \"fourmolu\" executable, rather than using the bundled library.", @@ -509,9 +566,15 @@ "scope": "resource", "type": "boolean" }, - "haskell.plugin.moduleName.globalOn": { + "haskell.plugin.notes.completionOn": { + "default": true, + "description": "Enables notes completions", + "scope": "resource", + "type": "boolean" + }, + "haskell.plugin.notes.hoverOn": { "default": true, - "description": "Enables moduleName plugin", + "description": "Enables notes hover", "scope": "resource", "type": "boolean" }, @@ -551,21 +614,21 @@ "scope": "resource", "type": "boolean" }, - "haskell.plugin.rename.config.crossModule": { - "default": false, - "markdownDescription": "Enable experimental cross-module renaming", + "haskell.plugin.rename.codeLensOn": { + "default": true, + "description": "Enables rename code lenses", "scope": "resource", "type": "boolean" }, - "haskell.plugin.rename.globalOn": { + "haskell.plugin.rename.config.crossModule": { "default": true, - "description": "Enables rename plugin", + "markdownDescription": "Enable experimental cross-module renaming", "scope": "resource", "type": "boolean" }, - "haskell.plugin.retrie.globalOn": { + "haskell.plugin.rename.renameOn": { "default": true, - "description": "Enables retrie plugin", + "description": "Enables rename rename", "scope": "resource", "type": "boolean" }, @@ -1298,7 +1361,7 @@ "type": "string" }, "haskell.plugin.semanticTokens.globalOn": { - "default": false, + "default": true, "description": "Enables semanticTokens plugin", "scope": "resource", "type": "boolean" @@ -1373,7 +1436,7 @@ "@typescript-eslint/eslint-plugin": "^8.56.0", "@typescript-eslint/parser": "^8.56.1", "@vscode/test-cli": "^0.0.12", - "@vscode/test-electron": "^2.5.2", + "@vscode/test-electron": "^3.1.0", "corepack": "^0.35.0", "eslint": "^10.4.0", "eslint-webpack-plugin": "^6.0.0", diff --git a/src/config.ts b/src/config.ts index 4e652784..57c08f4c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,7 +3,7 @@ import { expandHomeDir, IEnvVars } from './utils'; import * as path from 'path'; import { Logger } from 'vscode-languageclient'; import { ExtensionLogger } from './logger'; -import { GHCupConfig } from './ghcup'; +import { GHCupConfig, parseMetadataUri } from './ghcup'; export type LogLevel = 'off' | 'messages' | 'verbose'; export type ClientLogLevel = 'off' | 'error' | 'info' | 'debug'; @@ -47,7 +47,7 @@ export function initConfig(workspaceConfig: WorkspaceConfiguration, uri: Uri, fo serverArgs: serverArgs, serverEnvironment: workspaceConfig.serverEnvironment, ghcupConfig: { - metadataUrl: workspaceConfig.metadataURL as string, + metadataUrl: workspaceConfig.metadataURL ? parseMetadataUri(workspaceConfig.metadataURL as string) : undefined, upgradeGHCup: workspaceConfig.get('upgradeGHCup') as boolean, executablePath: workspaceConfig.get('ghcupExecutablePath'), }, diff --git a/src/ghcup.ts b/src/ghcup.ts index 85660600..076a3f6d 100644 --- a/src/ghcup.ts +++ b/src/ghcup.ts @@ -1,7 +1,7 @@ import * as path from 'path'; import * as os from 'os'; import * as process from 'process'; -import { WorkspaceFolder } from 'vscode'; +import { Uri, WorkspaceFolder } from 'vscode'; import { Logger } from 'vscode-languageclient'; import { MissingToolError } from './errors'; import { resolvePathPlaceHolders, executableExists, callAsync, ProcessCallback, IEnvVars } from './utils'; @@ -19,8 +19,31 @@ export function initDefaultGHCup(config: GHCupConfig, logger: Logger, folder?: W }); } +export type MetadataUri = Uri | 'cross' | 'prereleases' | 'vanilla' | 'default'; + +export function parseMetadataUri(m: string): MetadataUri { + switch (m) { + case 'cross': + return m; + case 'prereleases': + return m; + case 'vanilla': + return m; + case 'default': + return m; + default: { + return Uri.parse(m, true); + } + } +} + +function showMetadataUri(m: MetadataUri): string { + if (m instanceof Uri) return m.toString(); + else return m; +} + export type GHCupConfig = { - metadataUrl?: string; + metadataUrl?: MetadataUri; upgradeGHCup: boolean; executablePath?: string; }; @@ -56,7 +79,7 @@ export class GHCup { const metadataUrl = this.config.metadataUrl; // ; return await callAsync( this.location, - ['--no-verbose'].concat(metadataUrl ? ['-s', metadataUrl] : []).concat(args), + ['--no-verbose'].concat(metadataUrl ? ['-s', showMetadataUri(metadataUrl)] : []).concat(args), this.logger, undefined, title,