File tree 2 files changed +14
-2
lines changed
plugins/hls-class-plugin/src/Ide/Plugin/Class
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)
137
137
semigroupoids :base,
138
138
stm-hamt :transformers,
139
139
entropy :Cabal,
140
-
140
+
Original file line number Diff line number Diff line change 1
1
{-# LANGUAGE GADTs #-}
2
2
{-# LANGUAGE OverloadedLists #-}
3
3
{-# LANGUAGE RecordWildCards #-}
4
+ {-# LANGUAGE CPP #-}
4
5
{-# OPTIONS_GHC -Wno-overlapping -patterns #-}
5
6
6
7
module Ide.Plugin.Class.CodeLens where
@@ -90,7 +91,18 @@ codeLens state plId CodeLensParams{..} = pluginResponse $ do
90
91
getBindSpanWithoutSig ClsInstDecl {.. } =
91
92
let bindNames = mapMaybe go (bagToList cid_binds)
92
93
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
94
106
_ -> Nothing
95
107
-- Existed signatures' name
96
108
sigNames = concat $ mapMaybe (\ (L _ r) -> getSigName r) cid_sigs
You can’t perform that action at this time.
0 commit comments