Skip to content

Custom-setups completion in cabal files#4848

Merged
fendor merged 3 commits into
haskell:masterfrom
vidit-od:Cabal-Custom-Setups
Feb 21, 2026
Merged

Custom-setups completion in cabal files#4848
fendor merged 3 commits into
haskell:masterfrom
vidit-od:Cabal-Custom-Setups

Conversation

@vidit-od

Copy link
Copy Markdown
Collaborator

Fixes #4645

This PR aims at fixing the issue where users did not see completions for custom-setup stanza. The reason for this was lack of stanza mapping for custom-setups.

we fix this by making a customsetupfields and map it to our target stanza.

custom

@vidit-od vidit-od requested a review from fendor as a code owner February 19, 2026 07:09
@fendor fendor requested a review from VeryMilkyJoe February 19, 2026 07:48

@fendor fendor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you, just one nitpick :)

[ ("setup-depends:", noopCompleter)
, ("build-depends:", noopCompleter)
, ("build-tools:", noopCompleter)
, ("default-language:", constantCompleter ["GHC2021", "Haskell2010", "Haskell98"])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are definitely other default-language usages in this file, could you deduplicate them?

Unsure whether we should deduplicate only the fields, or full completion item...

@VeryMilkyJoe VeryMilkyJoe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@vidit-od

Copy link
Copy Markdown
Collaborator Author

Implemented the Review @fendor suggested, while doing so i tried getting the Language Names from Cabal itself.

found this on there Documentation

GHC supports multiple language editions: `Haskell98` , `Haskell2010`, `GHC2021`, `GHC2024`. Each language edition consists of a collection of language extensions, and there are many other language extensions not currently part of a language edition but that can be enabled explicitly.

can we import this somehow and use directly ? I could not find anything related to this so did it locally !

Thanks a lot for review !!

@fendor fendor enabled auto-merge (squash) February 20, 2026 07:56
@fendor fendor disabled auto-merge February 20, 2026 07:56
@fendor

fendor commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator

@vidit-od https://hackage-content.haskell.org/package/Cabal-syntax-3.16.1.0/docs/Language-Haskell-Extension.html#t:Language and maybe https://hackage-content.haskell.org/package/Cabal-syntax-3.16.1.0/docs/Language-Haskell-Extension.html#v:knownLanguages

You just need to find a way to print them again in a human readable way 🤔 Perhaps the same way we print Extension?

@vidit-od vidit-od force-pushed the Cabal-Custom-Setups branch from 0b2a928 to dc6f303 Compare February 20, 2026 08:40
@fendor fendor enabled auto-merge (squash) February 21, 2026 19:36
@fendor fendor merged commit d5a8750 into haskell:master Feb 21, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hls-cabal-plugin: No completions for custom-setup

3 participants