Skip to content

Always suggest cabal-version field for the first line of a cabal file #5115

Open

Description

@VeryMilkyJoe

We know that the first line of the cabal file should always be cabal-version: ....

Therefore we should consider this when generating completions for .cabal files.

This will be a little bit of a hacky solution, as we add add a check for whether we are in the first line of the cabal file when deciding the context for completions.

Implementation suggestion:

  • Extend FieldContext type in Completion.Types.hs in the cabal plugin by a Context which denotes that we are in the first line of the cabal file.
  • In findCursorContext in Completion.hs add a case for the cursor being in at the beginning of the first line of the file and then return this new FieldContext.
  • Add a completion for this context in the contextToCompleter function.

Activity

  1. StillerHarpo commented on Oct 9, 2026

    @StillerHarpo

    I want to do this.

  2. StillerHarpo commented on Oct 10, 2026

    @StillerHarpo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

HackathonThis issue is suitable for hackathon sessionscomponent: hls-cabal-pluginIssues related to the hls-cabal-pluginlevel: easyThe issue is suited for beginnerstype: enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions