Skip to content

restrict autoImports to base or another list of libraries #2440

Open
@cxandru

Description

@cxandru

Is your feature request related to a problem? Please describe.
We teach a Haskell course and automatically grade student submissions. We do this using https://github.com/cxandru/haskell-submission-tester, where each exercise is tested by the test suite of a cabal project with specified dependencies. I assume that because of the way students' installation is set up they work in a global project with a bunch of packages available, so haskell.plugin.ghcide-completions.config.autoExtendOn imports things from all sorts of packages that aren't base, meaning we can't grade their submissions. Often nothing from the imported modules is even used. Imports include really strange things such as:

System.Directory.Internal
Unicode 
Network.TCP
import Control.Monad.Identity ( replicateM ) (instead of the sane import from Control.Monad)
import Distribution.Simple.Flag (BooleanFlag)
import Distribution.Simple.Hpc (guessWay)

all in exercises with business logic entirely unrelated to any of these packages. I can only imagine that the autocompletion runs wild completely.

Describe the solution you'd like

We would like to have students be able to still use autocompletion, but only for modules in base

Describe alternatives you've considered

Telling students to disable autocompletion entirely.
Supply students templates within a cabal project with restricted dependencies. I assume hls would then adjust what it suggests? The problem with this would be that it exposes additional complexity to students that might cause to more issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions