haskell / haskell/haskell-language-server

Unify "import action" and "import code lens" behaviour

Offen
#487 2 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
component: ghcide type: enhancement
Vorherrschende Sprache
Haskell
Sterne
3k
Forks
455
Ø Merge
2 T. 19 Std.
Gemergte PRs (30 T.)
11

Beschreibung

The import code lens action (hover over non-explicit imports and trigger a code lens action) and the import code action (hover over an unimported identifier and trigger a code action) differ in some ways:

0. the code action imports things with explicit constructors (e.g. `Either(Left, Right)` instead of `Either(..)`)
1. the code action **fails** to distinguish between a constructor and a type, (e.g. if I want to import `Data.Either.Left` it will generate `import Data.Either (Left)`, which is not valid)

I feel that both for consistency, and as an improvement to the code action (point 0. is subjective, but point 1. is definitely a bug), it would be nice if these two could be unified, to the behaviour of the code lens.

Is there some technical reason to be unable to do so, e.g. "before we have the imports we haven't loaded necessary data and are therefore unable to determine whether `Left` should be a constructor or a type"?

I am also willing to do work on this, if someone is willing to provide guidance.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.