Skip to content

Commit db04365

Browse files
committed
Add preliminary support for cabal.project files
1 parent 7a281b7 commit db04365

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"activationEvents": [
3636
"onLanguage:haskell",
3737
"onLanguage:literate haskell",
38-
"onLanguage:cabal"
38+
"onLanguage:cabal",
39+
"onLanguage:cabal project"
3940
],
4041
"main": "./dist/extension",
4142
"contributes": {
@@ -59,6 +60,16 @@
5960
".cabal"
6061
]
6162
},
63+
{
64+
"id": "cabal project",
65+
"aliases": [
66+
"cabalProject"
67+
],
68+
"extensions": [
69+
".project",
70+
".project.local"
71+
]
72+
},
6273
{
6374
"id": "literate haskell",
6475
"aliases": [

src/extension.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
293293
break;
294294
}
295295

296+
// TODO @fendor: guard the cabal.project support by HLS version
297+
documentSelector.push({ scheme: 'file', language: 'cabal project', pattern: pat });
298+
296299
const clientOptions: LanguageClientOptions = {
297300
// Use the document selector to only notify the LSP on files inside the folder
298301
// path for the specific workspace.

0 commit comments

Comments
 (0)