Skip to content

Add preliminary support for cabal.project files #1253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"activationEvents": [
"onLanguage:haskell",
"onLanguage:literate haskell",
"onLanguage:cabal"
"onLanguage:cabal",
"onLanguage:cabal project"
],
"main": "./dist/extension",
"contributes": {
Expand All @@ -59,6 +60,16 @@
".cabal"
]
},
{
"id": "cabal project",
"aliases": [
"cabalProject"
],
"extensions": [
".project",
".project.local"
]
},
{
"id": "literate haskell",
"aliases": [
Expand Down
3 changes: 3 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading