Skip to content

Use ghcide master head (d76fbf9) #530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ defaults: &defaults
# work ok, but given that these CircleCI runners aren't the beefiest
# machine can cause some flakiness. So pass -j1 to Tasty (NOT Stack) to
# tell it to go slow and steady.
command: stack --stack-yaml=${STACK_FILE} test haskell-language-server --dump-logs --test-arguments="-j1"
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"
no_output_timeout: 120m

- run:
Expand Down
5 changes: 3 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
packages:
./
ghcide
hls-plugin-api
./ghcide/hie-compat
./ghcide
./hls-plugin-api
./plugins/tactics
./plugins/hls-hlint-plugin

Expand Down
2 changes: 1 addition & 1 deletion ghcide
Submodule ghcide updated 62 files
+2 −2 .azure/linux-bench.yml
+1 −1 .azure/linux-stack.yml
+5 −9 .azure/windows-stack.yml
+1 −1 .gitignore
+0 −0 bench-results/.artifactignore
+2 −2 bench/README.md
+17 −1 bench/config.yaml
+1 −1 bench/exe/Main.hs
+83 −58 bench/hist/Main.hs
+164 −146 bench/lib/Experiments.hs
+67 −0 bench/lib/Experiments/Types.hs
+2 −3 cabal.project
+10 −22 ghcide.cabal
+5 −0 hie-compat/CHANGELOG.md
+201 −0 hie-compat/LICENSE
+20 −0 hie-compat/README.md
+45 −0 hie-compat/hie-compat.cabal
+1 −1 hie-compat/src-ghc810/Compat/HieAst.hs
+1 −1 hie-compat/src-ghc810/Compat/HieBin.hs
+3 −3 hie-compat/src-ghc86/Compat/HieAst.hs
+2 −2 hie-compat/src-ghc86/Compat/HieBin.hs
+4 −4 hie-compat/src-ghc86/Compat/HieDebug.hs
+1 −1 hie-compat/src-ghc86/Compat/HieTypes.hs
+2 −2 hie-compat/src-ghc86/Compat/HieUtils.hs
+1 −1 hie-compat/src-ghc88/Compat/HieAst.hs
+1 −1 hie-compat/src-ghc88/Compat/HieBin.hs
+3 −0 hie-compat/src-reexport/Compat/HieDebug.hs
+3 −0 hie-compat/src-reexport/Compat/HieTypes.hs
+3 −0 hie-compat/src-reexport/Compat/HieUtils.hs
+13 −4 session-loader/Development/IDE/Session.hs
+220 −168 src/Development/IDE/Core/Compile.hs
+1 −1 src/Development/IDE/Core/FileStore.hs
+6 −6 src/Development/IDE/Core/OfInterest.hs
+9 −12 src/Development/IDE/Core/Preprocessor.hs
+69 −39 src/Development/IDE/Core/RuleTypes.hs
+197 −145 src/Development/IDE/Core/Rules.hs
+15 −104 src/Development/IDE/GHC/Compat.hs
+8 −10 src/Development/IDE/GHC/Error.hs
+19 −9 src/Development/IDE/GHC/Orphans.hs
+8 −3 src/Development/IDE/GHC/Util.hs
+3 −12 src/Development/IDE/GHC/Warnings.hs
+0 −30 src/Development/IDE/GHC/WithDynFlags.hs
+11 −4 src/Development/IDE/Import/DependencyInformation.hs
+8 −5 src/Development/IDE/Import/FindImports.hs
+1 −1 src/Development/IDE/LSP/Notifications.hs
+64 −23 src/Development/IDE/Plugin/CodeAction.hs
+4 −4 src/Development/IDE/Plugin/Completions.hs
+13 −13 src/Development/IDE/Plugin/Completions/Logic.hs
+10 −4 src/Development/IDE/Spans/AtPoint.hs
+11 −3 src/Development/IDE/Spans/Common.hs
+30 −26 src/Development/IDE/Spans/Documentation.hs
+27 −31 src/Development/IDE/Spans/LocalBindings.hs
+1 −1 src/Development/IDE/Types/Diagnostics.hs
+18 −1 src/Development/IDE/Types/Exports.hs
+3 −0 stack-ghc-lib.yaml
+2 −1 stack.yaml
+2 −1 stack810.yaml
+2 −1 stack8101.yaml
+2 −1 stack88.yaml
+0 −1 test/data/TH/THB.hs
+3 −0 test/data/hover/GotoHover.hs
+187 −50 test/exe/Main.hs
2 changes: 1 addition & 1 deletion plugins/default/src/Ide/Plugin/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ runEvalCmd lsp state EvalParams {..} = withIndefiniteProgress lsp "Eval" Cancell
session <-
liftIO $
runAction "runEvalCmd.ghcSession" state $
use_ GhcSessionDeps $
use_ GhcSession $
toNormalizedFilePath' $
fp

Expand Down
8 changes: 4 additions & 4 deletions plugins/default/src/Ide/Plugin/ImportLens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ extractMinimalImports ::
Maybe (HscEnvEq) ->
Maybe (TcModuleResult) ->
IO ([LImportDecl GhcRn], Maybe [LImportDecl GhcRn])
extractMinimalImports (Just (hsc)) (Just (tmrModule -> TypecheckedModule {..})) = do
extractMinimalImports (Just (hsc)) (Just (TcModuleResult {..})) = do
-- extract the original imports and the typechecking environment
let (tcEnv, _) = tm_internals_
Just (_, imports, _, _) = tm_renamed_source
ParsedModule {pm_parsed_source = L loc _} = tm_parsed_module
let tcEnv = tmrTypechecked
(_, imports, _, _) = tmrRenamed
ParsedModule {pm_parsed_source = L loc _} = tmrParsed
span = fromMaybe (error "expected real") $ realSpan loc

-- GHC is secretly full of mutable state
Expand Down
15 changes: 7 additions & 8 deletions plugins/default/src/Ide/Plugin/Retrie.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ import Development.IDE.GHC.Compat (GenLocated (L), GhcRn,
RuleDecls (HsRules),
SrcSpan (..),
TyClDecl (SynDecl),
TyClGroup (..),
TypecheckedModule (..), fun_id,
TyClGroup (..), fun_id,
mi_fixities, moduleNameString,
parseModule, rds_rules,
srcSpanFile)
import GHC.Generics (Generic)
import GhcPlugins (Outputable,
SourceText (NoSourceText),
isQual, isQual_maybe,
hm_iface, isQual, isQual_maybe,
nameModule_maybe, nameRdrName,
occNameFS, occNameString,
rdrNameOcc, unpackFS)
Expand Down Expand Up @@ -213,7 +212,7 @@ getBinds nfp = runMaybeT $ do
-- we use the typechecked source instead of the parsed source
-- to be able to extract module names from the Ids,
-- so that we can include adding the required imports in the retrie command
let TypecheckedModule {tm_renamed_source = Just rn} = tmrModule tm
let rn = tmrRenamed tm
( HsGroup
{ hs_valds =
XValBindsLR
Expand Down Expand Up @@ -369,8 +368,8 @@ callRetrie state session rewrites origin restrictToOriginatingFile = do
Just (stringToStringBuffer contents)
}
logPriority (ideLogger state) Info $ T.pack $ "Parsing module: " <> t
(_, parsed) <-
runGhcEnv session (parseModule ms')
parsed <-
evalGhcEnv session (parseModule ms')
`catch` \e -> throwIO (GHCParseError nt (show @SomeException e))
(fixities, parsed) <- fixFixities f (fixAnns parsed)
return (fixities, parsed)
Expand Down Expand Up @@ -454,9 +453,9 @@ callRetrie state session rewrites origin restrictToOriginatingFile = do
let fs = occNameFS n
]
fixFixities f pm = do
HiFileResult {hirModIface} <-
HiFileResult {hirHomeMod} <-
useOrFail "GetModIface" NoTypeCheck GetModIface f
let fixities = fixityEnvFromModIface hirModIface
let fixities = fixityEnvFromModIface $ hm_iface hirHomeMod
res <- transformA pm (fix fixities)
return (fixities, res)
fixAnns ParsedModule {..} =
Expand Down
5 changes: 3 additions & 2 deletions plugins/tactics/src/Ide/Plugin/Tactic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import Language.Haskell.LSP.Types
import OccName
import SrcLoc (containsSpan)
import System.Timeout
import TcRnTypes (tcg_binds)


descriptor :: PluginId -> PluginDescriptor
Expand Down Expand Up @@ -260,8 +261,8 @@ judgementForHole state nfp range = do

resulting_range <- liftMaybe $ toCurrentRange amapping $ realSrcSpanToRange rss
(tcmod, _) <- MaybeT $ runIde state $ useWithStale TypeCheck nfp
let tcg = fst $ tm_internals_ $ tmrModule tcmod
tcs = tm_typechecked_source $ tmrModule tcmod
let tcg = tmrTypechecked tcmod
tcs = tcg_binds tcg
ctx = mkContext
(mapMaybe (sequenceA . (occName *** coerce))
$ getDefiningBindings binds rss)
Expand Down
1 change: 1 addition & 0 deletions stack-8.10.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resolver: nightly-2020-08-16 # Last 8.10.1

packages:
- .
- ./ghcide/hie-compat
- ./ghcide/
- ./hls-plugin-api
- ./plugins/tactics
Expand Down
1 change: 1 addition & 0 deletions stack-8.10.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resolver: nightly-2020-10-19

packages:
- .
- ./ghcide/hie-compat
- ./ghcide/
- ./hls-plugin-api
- ./plugins/tactics
Expand Down
1 change: 1 addition & 0 deletions stack-8.6.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ compiler: ghc-8.6.4

packages:
- .
- ./ghcide/hie-compat
- ./ghcide/
- ./hls-plugin-api
- ./plugins/tactics
Expand Down
1 change: 1 addition & 0 deletions stack-8.6.5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resolver: lts-14.27 # Last 8.6.5

packages:
- .
- ./ghcide/hie-compat
- ./ghcide/
- ./hls-plugin-api
- ./plugins/tactics
Expand Down
1 change: 1 addition & 0 deletions stack-8.8.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resolver: lts-15.3 # Last 8.8.2

packages:
- .
- ./ghcide/hie-compat
- ./ghcide/
- ./hls-plugin-api
- ./plugins/tactics
Expand Down
1 change: 1 addition & 0 deletions stack-8.8.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resolver: lts-16.11 # Last 8.8.3

packages:
- .
- ./ghcide/hie-compat
- ./ghcide/
- ./hls-plugin-api
- ./plugins/tactics
Expand Down
1 change: 1 addition & 0 deletions stack-8.8.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resolver: lts-16.19

packages:
- .
- ./ghcide/hie-compat
- ./ghcide/
- ./hls-plugin-api
- ./plugins/tactics
Expand Down
1 change: 1 addition & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resolver: lts-14.27 # Last 8.6.5

packages:
- .
- ./ghcide/hie-compat
- ./ghcide/
- ./hls-plugin-api
- ./plugins/tactics
Expand Down