From db043651e9bf2ca11d6ccec91e450ff5b96b4d09 Mon Sep 17 00:00:00 2001 From: fendor Date: Wed, 4 Jun 2025 19:24:07 +0200 Subject: [PATCH] Add preliminary support for cabal.project files --- package.json | 13 ++++++++++++- src/extension.ts | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3fbada64..593f1d1d 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,8 @@ "activationEvents": [ "onLanguage:haskell", "onLanguage:literate haskell", - "onLanguage:cabal" + "onLanguage:cabal", + "onLanguage:cabal project" ], "main": "./dist/extension", "contributes": { @@ -59,6 +60,16 @@ ".cabal" ] }, + { + "id": "cabal project", + "aliases": [ + "cabalProject" + ], + "extensions": [ + ".project", + ".project.local" + ] + }, { "id": "literate haskell", "aliases": [ diff --git a/src/extension.ts b/src/extension.ts index 480ba77a..8fec096f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -293,6 +293,9 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold break; } + // TODO @fendor: guard the cabal.project support by HLS version + documentSelector.push({ scheme: 'file', language: 'cabal project', pattern: pat }); + const clientOptions: LanguageClientOptions = { // Use the document selector to only notify the LSP on files inside the folder // path for the specific workspace.