Skip to content

Possibilty to configure HLS from the command line  #3505

Open
@avandecreme

Description

@avandecreme

Is your enhancement request related to a problem? Please describe.

At my company, we would like to enforce an hlint config accross multiple projects.
When running hlint from the command line, we are able to do that by wrapping the hlint command in a small shell script which adds the necessary config.
Basically, our custom hlint script is calling the real hlint with the --hint=our-custom-hlint-config.yaml flag.
That wrapped hlint is built using nix and available on users' shells.
However, we can't configure HLS's hlint plugin the same way because there is no such option in HLS.

Describe the solution you'd like

It would be nice to be able to run something like haskell-language-server --lsp --config=hls-config-file.yaml
hls-config-file.yaml would contain the same kind of configurations availables to clients (ie. text editors).

I am not sure whether clients or server configurations should take precedence.

While my specific problem is with configuring hlint, I think it would make sense for all HLS options to be tweakable from a configuration file.

Describe alternatives you've considered

Currently, one can configure HLS from the client (ie. text editor).
For example to specify a custom hlint config file, one can add the following in vscode's config:

    "haskell.plugin.hlint.config.flags": [
        "--hint=our-custom-hlint-config.yaml"
    ]

But that means that every user has to configure his editor correctly.
Being able to configure haskell-language-server for the whole company would avoid configurations issues.

Another option would be to have hlint (the library) looks for its configuration from an environment variable, so that would means patching hlint instead of hls.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: cliAbout the pure command line interface of the hls executabletype: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions