Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

91 changes: 77 additions & 14 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.8.2",
"version": "2.8.3",
"license": "MIT",
"publisher": "haskell",
"engines": {
Expand Down Expand Up @@ -153,7 +153,7 @@
"scope": "resource",
"type": "string",
"default": "",
"description": "An optional URL to override where ghcup checks for tool download info (usually at: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml)"
"description": "An optional URL to override where ghcup checks for tool download info (usually at: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.1.0.yaml). Allows multiple channels passed as a JSON array, for example '[ \"GHCupURL\", \"prereleases\", \"cross\" ]'."
},
"haskell.releasesDownloadStoragePath": {
"scope": "resource",
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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"
},
Expand Down Expand Up @@ -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",
Comment thread
fendor marked this conversation as resolved.
"scope": "resource",
"type": "boolean"
},
Expand Down Expand Up @@ -1298,7 +1361,7 @@
"type": "string"
},
"haskell.plugin.semanticTokens.globalOn": {
"default": false,
"default": true,
"description": "Enables semanticTokens plugin",
"scope": "resource",
"type": "boolean"
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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'),
},
Expand Down
24 changes: 21 additions & 3 deletions src/ghcup.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -19,8 +19,26 @@ export function initDefaultGHCup(config: GHCupConfig, logger: Logger, folder?: W
});
}

export type MetadataUri = Uri | string[];

export function parseMetadataUri(m: string): MetadataUri {
try {
const value = JSON.parse(m);
if (Array.isArray(value) && value.every((item) => typeof item === 'string')) return value;
else return Uri.parse(m, true);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (SyntaxError) {
return Uri.parse(m, true);
}
}

function showMetadataUri(m: MetadataUri): string {
if (m instanceof Uri) return m.toString();
else return JSON.stringify(m);
}

export type GHCupConfig = {
metadataUrl?: string;
metadataUrl?: MetadataUri;
upgradeGHCup: boolean;
executablePath?: string;
};
Expand Down Expand Up @@ -56,7 +74,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,
Expand Down
Loading