File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
plugins/hls-class-plugin/src/Ide/Plugin/Class Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -137,4 +137,4 @@ if impl(ghc >= 9.5)
137137 semigroupoids :base,
138138 stm-hamt :transformers,
139139 entropy :Cabal,
140-
140+
Original file line number Diff line number Diff line change 11{-# LANGUAGE GADTs #-}
22{-# LANGUAGE OverloadedLists #-}
33{-# LANGUAGE RecordWildCards #-}
4+ {-# LANGUAGE CPP #-}
45{-# OPTIONS_GHC -Wno-overlapping -patterns #-}
56
67module Ide.Plugin.Class.CodeLens where
@@ -90,7 +91,18 @@ codeLens state plId CodeLensParams{..} = pluginResponse $ do
9091 getBindSpanWithoutSig ClsInstDecl {.. } =
9192 let bindNames = mapMaybe go (bagToList cid_binds)
9293 go (L l bind) = case bind of
93- FunBind {.. } -> Just $ L l fun_id
94+ FunBind {.. }
95+ -- `Generated` tagged for Template Haskell,
96+ -- here we filter out nonsence generated bindings
97+ -- that are nonsense for displaying code lenses.
98+ --
99+ -- See https://github.com/haskell/haskell-language-server/issues/3319
100+ #if MIN_VERSION_ghc(9,5,0)
101+ | not $ isGenerated (mg_ext fun_matches)
102+ #else
103+ | not $ isGenerated (mg_origin fun_matches)
104+ #endif
105+ -> Just $ L l fun_id
94106 _ -> Nothing
95107 -- Existed signatures' name
96108 sigNames = concat $ mapMaybe (\ (L _ r) -> getSigName r) cid_sigs
You can’t perform that action at this time.
0 commit comments