Skip to content

Commit cebfe4a

Browse files
authored
Merge branch 'master' into ghc92
2 parents eb285b4 + 5bd8512 commit cebfe4a

File tree

9 files changed

+80
-94
lines changed

9 files changed

+80
-94
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
[![Hackage][badge-hackage]][hackage]
88
[![License Apache 2.0][badge-license]][license]
99
[![CircleCI][badge-circleci]][circleci]
10-
![Github Testing Workflow](https://github.com/haskell/haskell-language-server/workflows/Testing/badge.svg)
11-
![Github Nix Workflow](https://github.com/haskell/haskell-language-server/workflows/Nix/badge.svg)
10+
[![GitHub Testing Workflow](https://github.com/haskell/haskell-language-server/actions/workflows/test.yml/badge.svg)](https://github.com/haskell/haskell-language-server/actions/workflows/test.yml)
11+
[![GitHub Nix Workflow](https://github.com/haskell/haskell-language-server/actions/workflows/nix.yml/badge.svg)](https://github.com/haskell/haskell-language-server/actions/workflows/nix.yml)
1212
[![codetriage][badge-codetriage]][codetriage]
1313

1414
[logo]: ./docs/logos/logo-256.png

cabal-ghc901.project

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ packages:
1010
-- ./plugins/hls-brittany-plugin
1111
-- ./plugins/hls-stylish-haskell-plugin
1212
-- ./plugins/hls-fourmolu-plugin
13-
./plugins/hls-class-plugin
13+
-- ./plugins/hls-class-plugin
1414
./plugins/hls-eval-plugin
1515
./plugins/hls-explicit-imports-plugin
16-
./plugins/hls-refine-imports-plugin
16+
-- ./plugins/hls-refine-imports-plugin
1717
./plugins/hls-hlint-plugin
1818
./plugins/hls-rename-plugin
1919
./plugins/hls-retrie-plugin
@@ -24,6 +24,9 @@ packages:
2424
./plugins/hls-module-name-plugin
2525
./plugins/hls-ormolu-plugin
2626
./plugins/hls-call-hierarchy-plugin
27+
28+
with-compiler: ghc-9.0.1
29+
2730
tests: true
2831

2932
package *
@@ -70,50 +73,9 @@ constraints:
7073
-- These plugins doesn't work on GHC9 yet
7174
haskell-language-server -brittany -class -fourmolu -stylishhaskell -tactic
7275

73-
7476
allow-newer:
75-
-- -- Broken on ghc9, but let's pretend it's not so we can build the other things
76-
-- brittany:base,
77-
-- brittany:ghc,
78-
-- brittany:ghc-boot-th,
79-
-- butcher:base,
80-
-- fourmolu:ghc-lib-parser,
81-
-- stylish-haskell:ghc-lib-parser,
82-
-- stylish-haskell:Cabal,
83-
-- multistate:base,
84-
-- ghc-source-gen:ghc,
85-
86-
assoc:base,
87-
cryptohash-md5:base,
88-
cryptohash-sha1:base,
89-
constraints-extras:template-haskell,
90-
data-tree-print:base,
91-
deepseq:base,
92-
dependent-sum:some,
93-
dependent-sum:constraints,
94-
diagrams-postscript:base,
95-
diagrams-postscript:lens,
96-
diagrams-postscript:diagrams-core,
97-
diagrams-postscript:monoid-extras,
98-
diagrams:diagrams-core,
99-
Chart-diagrams:diagrams-core,
100-
SVGFonts:diagrams-core,
101-
dual-tree:base,
102-
-- Does this make any sense?
103-
entropy:Cabal,
104-
force-layout:base,
105-
force-layout:lens,
106-
floskell:ghc-prim,
10777
floskell:base,
108-
hashable:base,
109-
hslogger:base,
110-
monoid-extras:base,
111-
newtype-generics:base,
112-
parallel:base,
113-
regex-base:base,
114-
regex-tdfa:base,
115-
statestack:base,
116-
svg-builder:base,
117-
these:base,
118-
time-compat:base
119-
78+
floskell:ghc-prim,
79+
-- for shake-bench
80+
Chart-diagrams:diagrams-core,
81+
SVGFonts:diagrams-core

ghcide/ghcide.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ library
4848
dependent-map,
4949
dependent-sum,
5050
dlist,
51+
-- we can't use >= 1.7.10 while we have to use hlint == 3.2.*
5152
extra >= 1.7.4 && < 1.7.10,
5253
fuzzy,
5354
filepath,

plugins/hls-call-hierarchy-plugin/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Enabled by default. You can disable it in your editor settings whenever you like
2020
{
2121
"haskell.plugin.callHierarchy.globalOn": true
2222
}
23+
```
2324

2425
## Change log
2526
### 1.0.0.1

plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: hls-call-hierarchy-plugin
3-
version: 1.0.0.1
3+
version: 1.0.0.2
44
synopsis: Call hierarchy plugin for Haskell Language Server
55
license: Apache-2.0
66
license-file: LICENSE

plugins/hls-call-hierarchy-plugin/src/Ide/Plugin/CallHierarchy/Internal.hs

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ prepareCallHierarchy state pluginId param
4646
liftIO (runAction "CallHierarchy.prepareHierarchy" state (prepareCallHierarchyItem nfp pos)) >>=
4747
\case
4848
Just items -> pure $ Right $ Just $ List items
49-
Nothing -> pure $ Left $ responseError "Call Hierarchy: No result"
49+
Nothing -> pure $ Right Nothing
5050
| otherwise = pure $ Left $ responseError $ T.pack $ "Call Hierarchy: uriToNormalizedFilePath failed for: " <> show uri
5151
where
5252
uri = param ^. (L.textDocument . L.uri)
@@ -66,23 +66,28 @@ constructFromAst nfp pos =
6666
resolveIntoCallHierarchy :: Applicative f => HieASTs a -> Position -> NormalizedFilePath -> f (Maybe [CallHierarchyItem])
6767
resolveIntoCallHierarchy hf pos nfp =
6868
case listToMaybe $ pointCommand hf pos extract of
69-
Just res -> pure $ Just $ mapMaybe (construct nfp hf) res
70-
Nothing -> pure Nothing
69+
Nothing -> pure Nothing
70+
Just infos ->
71+
case mapMaybe (construct nfp hf) infos of
72+
[] -> pure Nothing
73+
res -> pure $ Just res
7174

7275
extract :: HieAST a -> [(Identifier, S.Set ContextInfo, Span)]
7376
extract ast = let span = nodeSpan ast
7477
infos = M.toList $ M.map identInfo (Compat.getNodeIds ast)
7578
in [ (ident, contexts, span) | (ident, contexts) <- infos ]
7679

7780
recFieldInfo, declInfo, valBindInfo, classTyDeclInfo,
78-
useInfo, patternBindInfo, tyDeclInfo :: [ContextInfo] -> Maybe ContextInfo
79-
recFieldInfo ctxs = listToMaybe [ctx | ctx@RecField{} <- ctxs]
80-
declInfo ctxs = listToMaybe [ctx | ctx@Decl{} <- ctxs]
81-
valBindInfo ctxs = listToMaybe [ctx | ctx@ValBind{} <- ctxs]
82-
classTyDeclInfo ctxs = listToMaybe [ctx | ctx@ClassTyDecl{} <- ctxs]
83-
useInfo ctxs = listToMaybe [Use | Use <- ctxs]
84-
patternBindInfo ctxs = listToMaybe [ctx | ctx@PatternBind{} <- ctxs]
85-
tyDeclInfo ctxs = listToMaybe [TyDecl | TyDecl <- ctxs]
81+
useInfo, patternBindInfo, tyDeclInfo, matchBindInfo
82+
:: [ContextInfo] -> Maybe ContextInfo
83+
recFieldInfo ctxs = listToMaybe [ctx | ctx@RecField{} <- ctxs]
84+
declInfo ctxs = listToMaybe [ctx | ctx@Decl{} <- ctxs]
85+
valBindInfo ctxs = listToMaybe [ctx | ctx@ValBind{} <- ctxs]
86+
classTyDeclInfo ctxs = listToMaybe [ctx | ctx@ClassTyDecl{} <- ctxs]
87+
useInfo ctxs = listToMaybe [Use | Use <- ctxs]
88+
patternBindInfo ctxs = listToMaybe [ctx | ctx@PatternBind{} <- ctxs]
89+
tyDeclInfo ctxs = listToMaybe [TyDecl | TyDecl <- ctxs]
90+
matchBindInfo ctxs = listToMaybe [MatchBind | MatchBind <- ctxs]
8691

8792
construct :: NormalizedFilePath -> HieASTs a -> (Identifier, S.Set ContextInfo, Span) -> Maybe CallHierarchyItem
8893
construct nfp hf (ident, contexts, ssp)
@@ -92,6 +97,9 @@ construct nfp hf (ident, contexts, ssp)
9297
-- ignored type span
9398
= Just $ mkCallHierarchyItem' ident SkField ssp ssp
9499

100+
| isJust (matchBindInfo ctxList) && isNothing (valBindInfo ctxList)
101+
= Just $ mkCallHierarchyItem' ident SkFunction ssp ssp
102+
95103
| Just ctx <- valBindInfo ctxList
96104
= Just $ case ctx of
97105
ValBind _ _ span -> mkCallHierarchyItem' ident SkFunction (renderSpan span) ssp

plugins/hls-call-hierarchy-plugin/src/Ide/Plugin/CallHierarchy/Types.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ instance FromRow Vertex where
3535
<*> field <*> field <*> field
3636
<*> field <*> field <*> field
3737
<*> field <*> field
38+
3839
data SymbolPosition = SymbolPosition {
3940
psl :: Int
4041
, psc :: Int

plugins/hls-call-hierarchy-plugin/test/Main.hs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ prepareCallHierarchyTests =
178178
expected = mkCallHierarchyItemV "b" SkFunction range selRange
179179
oneCaseWithCreate contents 0 2 expected
180180
]
181+
, testCase "multi pattern" $ do
182+
let contents = T.unlines
183+
[ "f (Just _) = ()"
184+
, "f Nothing = ()"
185+
]
186+
range = mkRange 1 0 1 1
187+
selRange = mkRange 1 0 1 1
188+
expected = mkCallHierarchyItemV "f" SkFunction range selRange
189+
oneCaseWithCreate contents 1 0 expected
181190
]
182191

183192
incomingCallsTests :: TestTree
@@ -263,6 +272,15 @@ incomingCallsTests =
263272
positions = [(1, 5)]
264273
ranges = [mkRange 1 13 1 14]
265274
incomingCallTestCase contents 1 13 positions ranges
275+
, testCase "multi pattern" $ do
276+
let contents = T.unlines
277+
[ "f 1 = 1"
278+
, "f 2 = 2"
279+
, "g = f"
280+
]
281+
positions = [(2, 0)]
282+
ranges = [mkRange 2 4 2 5]
283+
incomingCallTestCase contents 1 0 positions ranges
266284
]
267285
, testGroup "multi file"
268286
[ testCase "1" $ do

stack-9.0.1.yaml

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
resolver: nightly-2021-05-02
2-
compiler: ghc-9.0.1
1+
resolver: nightly-2021-08-26
32

43
packages:
54
- .
@@ -8,7 +7,7 @@ packages:
87
- ./ghcide/
98
- ./hls-plugin-api
109
- ./hls-test-utils
11-
# - ./shake-bench
10+
- ./shake-bench
1211
- ./plugins/hls-call-hierarchy-plugin
1312
# - ./plugins/hls-class-plugin
1413
- ./plugins/hls-haddock-comments-plugin
@@ -22,58 +21,44 @@ packages:
2221
# - ./plugins/hls-tactics-plugin
2322
# - ./plugins/hls-brittany-plugin
2423
# - ./plugins/hls-stylish-haskell-plugin
25-
# - ./plugins/hls-floskell-plugin
24+
- ./plugins/hls-floskell-plugin
2625
# - ./plugins/hls-fourmolu-plugin
2726
- ./plugins/hls-pragmas-plugin
2827
- ./plugins/hls-module-name-plugin
29-
# - ./plugins/hls-ormolu-plugin
28+
- ./plugins/hls-ormolu-plugin
3029

3130
ghc-options:
3231
"$everything": -haddock
3332

3433
extra-deps:
35-
- apply-refact-0.9.3.0
36-
- base16-bytestring-0.1.1.7@sha256:0021256a9628971c08da95cb8f4d0d72192f3bb8a7b30b55c080562d17c43dd3,2231
34+
35+
- blaze-textual-0.2.2.1
3736
- bytestring-encoding-0.1.0.0@sha256:460b49779fbf0112e8e2f1753c1ed9131eb18827600c298f4d6bb51c4e8c1c0d,1727
38-
# Not newest (constraints-extras doesn't support 0.13 yet)
39-
- constraints-0.12@sha256:71c7999d7fa01d8941f08d37d4c107c6b1bcbd0306e234157557b9b096b7f1be,2217
40-
- constraints-extras-0.3.1.0@sha256:12016ebb91ad5ed2c82bf7e48c6bd6947d164d33c9dca5ac3965de1bb6c780c0,1777
4137
- dependent-map-0.4.0.0@sha256:ca2b131046f4340a1c35d138c5a003fe4a5be96b14efc26291ed35fd08c62221,1657
4238
- dependent-sum-0.7.1.0@sha256:0e419237f5b86da3659772afff9cab355c0f8d5b3fdb15a5b30e673d8dc83941,2147
43-
- ghc-lib-9.0.1.20210324@sha256:c8b9a2541ea3424c8d0e4f80584477d0f35be03f4a47d931152042d5f446c5fc,19279
44-
- ghc-lib-parser-9.0.1.20210324@sha256:fb680f78d4ab08b5d089a05bda3b84ad857e5edcc2e4ca7c188c0207d369af80
45-
- ghc-lib-parser-ex-9.0.0.4@sha256:8282b11c3797fc8ba225b245e736cc9a0745d9c48d0f9fea7f9bffb5c9997709,3642
39+
- floskell-0.10.5
4640
- ghc-source-gen-0.4.1.0
47-
- haddock-library-1.10.0@sha256:2a6c239da9225951a5d837e1ce373faeeae60d1345c78dd0a0b0f29df30c4fe9,4098
4841
- heapsize-0.3.0.1@sha256:0b69aa97a46d819b700ac7b145f3b5493c3565cf2c5b8298682238d405d0326e,1417
42+
- hie-bios-0.7.6
4943
- hiedb-0.4.0.0
50-
- hlint-3.3@sha256:4218ad6e03050f5d68aeba0e025f5f05e366c8fd49657f2a19df04ee31b2bb23,4154
44+
- hspec-2.7.10
45+
- hspec-core-2.7.10
46+
- hspec-discover-2.7.10
5147
- implicit-hie-0.1.2.6
5248
- implicit-hie-cradle-0.3.0.5
53-
- lens-5.0.1
54-
- profunctors-5.6.2
49+
- monad-dijkstra-0.1.1.2
5550
- refinery-0.4.0.0
5651
- retrie-1.0.0.0
57-
- some-1.0.2@sha256:3d460998df32ad7b93bf55657aeae988d97070155e71718b4bc75d0997ce9d62,2244
52+
- some-1.0.2
5853
- lsp-1.2.0.1
5954
- lsp-types-1.3.0.1
6055
- lsp-test-0.14.0.1
61-
62-
# Upstream patches for ghc-9.0.1 compatability
63-
# Same as in cabal.project
64-
- github: jwaldmann/blaze-textual
65-
commit: d8ee6cf80e27f9619d621c936bb4bda4b99a183f
66-
# https://github.com/jwaldmann/blaze-textual/commit/d8ee6cf80e27f9619d621c936bb4bda4b99a183f
67-
# https://github.com/bos/blaze-textual/issues/13
56+
- sqlite-simple-0.4.18.0
6857

6958
- github: mithrandi/czipwith
7059
commit: b6245884ae83e00dd2b5261762549b37390179f8
7160
# https://github.com/lspitzner/czipwith/pull/2
7261

73-
- github: jneira/hie-bios
74-
commit: 9b1445ab5efcabfad54043fc9b8e50e9d8c5bbf3
75-
# https://github.com/mpickering/hie-bios/pull/285
76-
7762
- github: hsyl20/ghc-api-compat
7863
commit: 8fee87eac97a538dbe81ff1ab18cff10f2f9fa15
7964

@@ -88,15 +73,26 @@ extra-deps:
8873
- dependent-sum-template
8974
# https://github.com/obsidiansystems/dependent-sum/pull/57
9075

76+
# shake-bench dependencies
77+
78+
- SVGFonts-1.7.0.1@sha256:44f0e5ee69a0c41de72bfc1408d1384719ec44b2f1a83fd4da31071d9da21f84,4004
79+
- diagrams-postscript-1.5@sha256:ea9ef970f653072cfde9715fad92481eedcc72a94da543c52a68ca33100902ab,2369
80+
- Chart-1.9.3@sha256:640a38463318b070d80a049577e4f0b3322df98290abb7afcf0cb74a4ad5b512,2948
81+
- Chart-diagrams-1.9.3@sha256:1535d5d0d3febca63138cecfde234315212611c21bb7f4358b2dae8c55c59003,1801
82+
- statestack-0.3@sha256:be43ce2cd790a4732b88cdc9480458503cb5e307b4f79a502d99d5b3d417730e,1135
83+
9184
- github: diagrams/active
9285
commit: ca23431a8dfa013992f9164ccc882a3277361f17
9386
# https://github.com/diagrams/active/pull/36
9487

95-
96-
# benchmark dependency
9788
- github: HeinrichApfelmus/operational
9889
commit: 16e19aaf34e286f3d27b3988c61040823ec66537
9990

91+
# end of shake-bench dpendencies
92+
93+
# due to floskell-0.10.5 and diagrams-core-1.5.0
94+
allow-newer: true
95+
10096
configure-options:
10197
ghcide:
10298
- --disable-library-for-ghci
@@ -108,13 +104,12 @@ configure-options:
108104
flags:
109105
haskell-language-server:
110106
pedantic: true
107+
111108
class: false
112109
splice: false
113110
refineImports: false
114111
tactic: false # Dependencies fail
115112

116-
floskell: false
117-
ormolu: false
118113
fourmolu: false
119114
stylishHaskell: false
120115
brittany: false

0 commit comments

Comments
 (0)