haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Prune import statement symbols

Open sir4ur0n opened this issue 5 years ago • 1 comments

It's been a long time since my last issue :stuck_out_tongue:

Currently HLS considers each import statement as a symbol, which has several minor inconveniences, e.g.:

  • Go to symbol is spammed with import statements, which - I think - almost nobody will ever use
  • Go to Next Member stops at each import statement, while the whole point is to quickly navigate in the file

I just checked how it's done e.g. with Java files: import statements are not even symbols.

Concrete example:

module Foo where

import Prelude
import Data.Text
import GHC.Generics
import GHC.Arr

foo :: ()
foo = ()

bar :: ()
bar = ()

data Foo

newtype Bar = Bar Foo

class Baz a

instance Baz Foo

image

As you can see, there is a symbol for the module declaration, another for "the group of imports" (which I find awesome), in my opinion there is no benefit to also consider each import statement as a symbol.

What do you think?

sir4ur0n avatar Jul 21 '20 13:07 sir4ur0n

Is it possible without breaking the highlighting an appropriate import statement when a caret is on the symbol's usage?

image

develop7 avatar Oct 13 '24 09:10 develop7