mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-13 09:34:31 +03:00
5f4384e8ef
* Tests for issue 310 (misleading hover on inner signature) The most important pair of tests here is the "inner signature" pair. The others serve mainly to document, compare and contrast what is happening in related situations. In summary, hover and gotoDef + on inner signatures: give type and location information for the outer definition; this is misleading, + on outer signatures: give no information at all, + on inner definitions: give correct information for the inner definition, + on outer definitions: give correct information for the outer definition. Should hover and gotoDef do anything at all for signatures? or is the current behaviour for outer signatures (doing nothing at all) what we want? * Require signature hover/gotoDef to point to first clause of definition * Remove perhaps superfluous tests for definitions
51 lines
1.0 KiB
Haskell
51 lines
1.0 KiB
Haskell
{- HLINT ignore -}
|
|
module Testing ( module Testing ) where
|
|
import Data.Text (Text, pack)
|
|
data TypeConstructor = DataConstructor
|
|
{ fff :: Text
|
|
, ggg :: Int }
|
|
aaa :: TypeConstructor
|
|
aaa = DataConstructor
|
|
{ fff = "dfgy"
|
|
, ggg = 832
|
|
}
|
|
bbb :: TypeConstructor
|
|
bbb = DataConstructor "mjgp" 2994
|
|
ccc :: (Text, Int)
|
|
ccc = (fff bbb, ggg aaa)
|
|
ddd :: Num a => a -> a -> a
|
|
ddd vv ww = vv +! ww
|
|
a +! b = a - b
|
|
hhh (Just a) (><) = a >< a
|
|
iii a b = a `b` a
|
|
jjj s = pack $ s <> s
|
|
class MyClass a where
|
|
method :: a -> Int
|
|
instance MyClass Int where
|
|
method = succ
|
|
kkk :: MyClass a => Int -> a -> Int
|
|
kkk n c = n + method c
|
|
|
|
doBind :: Maybe ()
|
|
doBind = do unwrapped <- Just ()
|
|
return unwrapped
|
|
|
|
listCompBind :: [Char]
|
|
listCompBind = [ succ c | c <- "ptfx" ]
|
|
|
|
multipleClause :: Bool -> Char
|
|
multipleClause True = 't'
|
|
multipleClause False = 'f'
|
|
|
|
-- | Recognizable docs: kpqz
|
|
documented :: Monad m => Either Int (m a)
|
|
documented = Left 7518
|
|
|
|
listOfInt = [ 8391 :: Int, 6268 ]
|
|
|
|
outer :: Bool
|
|
outer = undefined where
|
|
|
|
inner :: Char
|
|
inner = undefined
|