Skip to content

Commit d0f02b5

Browse files
authored
Merge pull request #530 from jneira/ghcide-master
Use ghcide master head (d76fbf9) with the new handling of template haskell
2 parents 6c14163 + e1a5752 commit d0f02b5

15 files changed

+28
-19
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ defaults: &defaults
6969
# work ok, but given that these CircleCI runners aren't the beefiest
7070
# machine can cause some flakiness. So pass -j1 to Tasty (NOT Stack) to
7171
# tell it to go slow and steady.
72-
command: stack --stack-yaml=${STACK_FILE} test haskell-language-server --dump-logs --test-arguments="-j1"
72+
command: stack --stack-yaml=${STACK_FILE} test haskell-language-server --dump-logs --test-arguments="-j1 --rerun-update" || stack --stack-yaml=${STACK_FILE} test haskell-language-server --dump-logs --test-arguments="-j1 --rerun" || stack --stack-yaml=${STACK_FILE} test haskell-language-server --dump-logs --test-arguments="-j1 --rerun"
7373
no_output_timeout: 120m
7474

7575
- run:

cabal.project

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
packages:
22
./
3-
ghcide
4-
hls-plugin-api
3+
./ghcide/hie-compat
4+
./ghcide
5+
./hls-plugin-api
56
./plugins/tactics
67
./plugins/hls-hlint-plugin
78

ghcide

Submodule ghcide updated 62 files

plugins/default/src/Ide/Plugin/Eval.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ runEvalCmd lsp state EvalParams {..} = withIndefiniteProgress lsp "Eval" Cancell
172172
session <-
173173
liftIO $
174174
runAction "runEvalCmd.ghcSession" state $
175-
use_ GhcSessionDeps $
175+
use_ GhcSession $
176176
toNormalizedFilePath' $
177177
fp
178178

plugins/default/src/Ide/Plugin/ImportLens.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ extractMinimalImports ::
192192
Maybe (HscEnvEq) ->
193193
Maybe (TcModuleResult) ->
194194
IO ([LImportDecl GhcRn], Maybe [LImportDecl GhcRn])
195-
extractMinimalImports (Just (hsc)) (Just (tmrModule -> TypecheckedModule {..})) = do
195+
extractMinimalImports (Just (hsc)) (Just (TcModuleResult {..})) = do
196196
-- extract the original imports and the typechecking environment
197-
let (tcEnv, _) = tm_internals_
198-
Just (_, imports, _, _) = tm_renamed_source
199-
ParsedModule {pm_parsed_source = L loc _} = tm_parsed_module
197+
let tcEnv = tmrTypechecked
198+
(_, imports, _, _) = tmrRenamed
199+
ParsedModule {pm_parsed_source = L loc _} = tmrParsed
200200
span = fromMaybe (error "expected real") $ realSpan loc
201201

202202
-- GHC is secretly full of mutable state

plugins/default/src/Ide/Plugin/Retrie.hs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,14 @@ import Development.IDE.GHC.Compat (GenLocated (L), GhcRn,
5353
RuleDecls (HsRules),
5454
SrcSpan (..),
5555
TyClDecl (SynDecl),
56-
TyClGroup (..),
57-
TypecheckedModule (..), fun_id,
56+
TyClGroup (..), fun_id,
5857
mi_fixities, moduleNameString,
5958
parseModule, rds_rules,
6059
srcSpanFile)
6160
import GHC.Generics (Generic)
6261
import GhcPlugins (Outputable,
6362
SourceText (NoSourceText),
64-
isQual, isQual_maybe,
63+
hm_iface, isQual, isQual_maybe,
6564
nameModule_maybe, nameRdrName,
6665
occNameFS, occNameString,
6766
rdrNameOcc, unpackFS)
@@ -213,7 +212,7 @@ getBinds nfp = runMaybeT $ do
213212
-- we use the typechecked source instead of the parsed source
214213
-- to be able to extract module names from the Ids,
215214
-- so that we can include adding the required imports in the retrie command
216-
let TypecheckedModule {tm_renamed_source = Just rn} = tmrModule tm
215+
let rn = tmrRenamed tm
217216
( HsGroup
218217
{ hs_valds =
219218
XValBindsLR
@@ -369,8 +368,8 @@ callRetrie state session rewrites origin restrictToOriginatingFile = do
369368
Just (stringToStringBuffer contents)
370369
}
371370
logPriority (ideLogger state) Info $ T.pack $ "Parsing module: " <> t
372-
(_, parsed) <-
373-
runGhcEnv session (parseModule ms')
371+
parsed <-
372+
evalGhcEnv session (parseModule ms')
374373
`catch` \e -> throwIO (GHCParseError nt (show @SomeException e))
375374
(fixities, parsed) <- fixFixities f (fixAnns parsed)
376375
return (fixities, parsed)
@@ -454,9 +453,9 @@ callRetrie state session rewrites origin restrictToOriginatingFile = do
454453
let fs = occNameFS n
455454
]
456455
fixFixities f pm = do
457-
HiFileResult {hirModIface} <-
456+
HiFileResult {hirHomeMod} <-
458457
useOrFail "GetModIface" NoTypeCheck GetModIface f
459-
let fixities = fixityEnvFromModIface hirModIface
458+
let fixities = fixityEnvFromModIface $ hm_iface hirHomeMod
460459
res <- transformA pm (fix fixities)
461460
return (fixities, res)
462461
fixAnns ParsedModule {..} =

plugins/tactics/src/Ide/Plugin/Tactic.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import Language.Haskell.LSP.Types
6161
import OccName
6262
import SrcLoc (containsSpan)
6363
import System.Timeout
64+
import TcRnTypes (tcg_binds)
6465

6566

6667
descriptor :: PluginId -> PluginDescriptor
@@ -260,8 +261,8 @@ judgementForHole state nfp range = do
260261

261262
resulting_range <- liftMaybe $ toCurrentRange amapping $ realSrcSpanToRange rss
262263
(tcmod, _) <- MaybeT $ runIde state $ useWithStale TypeCheck nfp
263-
let tcg = fst $ tm_internals_ $ tmrModule tcmod
264-
tcs = tm_typechecked_source $ tmrModule tcmod
264+
let tcg = tmrTypechecked tcmod
265+
tcs = tcg_binds tcg
265266
ctx = mkContext
266267
(mapMaybe (sequenceA . (occName *** coerce))
267268
$ getDefiningBindings binds rss)

stack-8.10.1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ resolver: nightly-2020-08-16 # Last 8.10.1
22

33
packages:
44
- .
5+
- ./ghcide/hie-compat
56
- ./ghcide/
67
- ./hls-plugin-api
78
- ./plugins/tactics

stack-8.10.2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ resolver: nightly-2020-10-19
22

33
packages:
44
- .
5+
- ./ghcide/hie-compat
56
- ./ghcide/
67
- ./hls-plugin-api
78
- ./plugins/tactics

stack-8.6.4.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ compiler: ghc-8.6.4
33

44
packages:
55
- .
6+
- ./ghcide/hie-compat
67
- ./ghcide/
78
- ./hls-plugin-api
89
- ./plugins/tactics

stack-8.6.5.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ resolver: lts-14.27 # Last 8.6.5
22

33
packages:
44
- .
5+
- ./ghcide/hie-compat
56
- ./ghcide/
67
- ./hls-plugin-api
78
- ./plugins/tactics

stack-8.8.2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ resolver: lts-15.3 # Last 8.8.2
22

33
packages:
44
- .
5+
- ./ghcide/hie-compat
56
- ./ghcide/
67
- ./hls-plugin-api
78
- ./plugins/tactics

stack-8.8.3.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ resolver: lts-16.11 # Last 8.8.3
22

33
packages:
44
- .
5+
- ./ghcide/hie-compat
56
- ./ghcide/
67
- ./hls-plugin-api
78
- ./plugins/tactics

stack-8.8.4.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ resolver: lts-16.19
22

33
packages:
44
- .
5+
- ./ghcide/hie-compat
56
- ./ghcide/
67
- ./hls-plugin-api
78
- ./plugins/tactics

stack.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ resolver: lts-14.27 # Last 8.6.5
22

33
packages:
44
- .
5+
- ./ghcide/hie-compat
56
- ./ghcide/
67
- ./hls-plugin-api
78
- ./plugins/tactics

0 commit comments

Comments
 (0)