Skip to content
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

Simple Eval plugin #191

Merged
merged 12 commits into from
Jul 17, 2020
Merged

Simple Eval plugin #191

merged 12 commits into from
Jul 17, 2020

Conversation

pepeiborra
Copy link
Collaborator

-- | A plugin inspired by the REPLoid feature of Dante[1] which allows
--     to evaluate code in comment prompts and splice the results right below:
--
--    > example :: [String]
--    > example = ["This is an example", "of", "interactive", "evaluation"]
--    >
--    > -- >>> intercalate " " example
--    > -- "This is an example of interactive evaluation"
--    > --

Closes #51

Copy link
Collaborator

@alanz alanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice concept

haskell-language-server.cabal Outdated Show resolved Hide resolved
src/Ide/Plugin/Eval.hs Outdated Show resolved Hide resolved
src/Ide/Plugin/Eval.hs Outdated Show resolved Hide resolved
src/Ide/Plugin/Eval.hs Outdated Show resolved Hide resolved
@googleson78
Copy link
Contributor

Is it possible to use the approach here to evaluate arbitrary (closed) expressions, outside of comments?

This is also a solution to #94

@pepeiborra
Copy link
Collaborator Author

Is it possible to use the approach here to evaluate arbitrary (closed) expressions, outside of comments?

That would probably require some user interface. This approach leverages code lenses to avoid the need for that. The evaluation primitives, on the other hand, could be reused.

test/functional/Eval.hs Show resolved Hide resolved
test/functional/Main.hs Outdated Show resolved Hide resolved
@pepeiborra
Copy link
Collaborator Author

I don't know what to do in terms of documentation - how will hls users learn about this feature?
I could write a few notes about it in the README, but I don't see a section listing the current plugins and/or features.
Is there a better place?

@fendor
Copy link
Collaborator

fendor commented Jul 12, 2020

@pepeiborra I think a new section with current features would be nice and welcome! We could move some stuff from Haskell IDE Engine or write a complete new section. For this feature, it would be enough to just add it to the README and other features are added in different PRs.

Unfortunately, when trying out this feature I get this error:

Exception: Rules should not depend on ms_hs_date
CallStack (from HasCallStack):
  error, called at src/Development/IDE/Core/Compile.hs:423:25 in ghcide-0.2.0-52f20783409697de6c196b0810d1688811d3be0cf3e768d6b64111b06c7e1089:Development.IDE.Core.Compile
[Error - 12:31:33 PM] Request workspace/executeCommand failed.
  Message: Rules should not depend on ms_hs_date
CallStack (from HasCallStack):
  error, called at src/Development/IDE/Core/Compile.hs:423:25 in ghcide-0.2.0-52f20783409697de6c196b0810d1688811d3be0cf3e768d6b64111b06c7e1089:Development.IDE.Core.Compile
  Code: -32603 
  • GHC 8.8.3
  • Executed on src/Ide/Cradle.hs

@pepeiborra
Copy link
Collaborator Author

pepeiborra commented Jul 12, 2020

@pepeiborra I think a new section with current features would be nice and welcome! We could move some stuff from Haskell IDE Engine or write a complete new section. For this feature, it would be enough to just add it to the README and other features are added in different PRs.

I'm not the best person to enumerate the features in hls or to port the one in hie, seeing as I've never been a user of either. But I want to document the Eval plugin. Should I just add a new section listing just the Eval plugin?

Unfortunately, when trying out this feature I get this error:

Exception: Rules should not depend on ms_hs_date
CallStack (from HasCallStack):
  error, called at src/Development/IDE/Core/Compile.hs:423:25 in ghcide-0.2.0-52f20783409697de6c196b0810d1688811d3be0cf3e768d6b64111b06c7e1089:Development.IDE.Core.Compile
[Error - 12:31:33 PM] Request workspace/executeCommand failed.
  Message: Rules should not depend on ms_hs_date
CallStack (from HasCallStack):
  error, called at src/Development/IDE/Core/Compile.hs:423:25 in ghcide-0.2.0-52f20783409697de6c196b0810d1688811d3be0cf3e768d6b64111b06c7e1089:Development.IDE.Core.Compile
  Code: -32603 
* GHC 8.8.3

* Executed on `src/Ide/Cradle.hs`

I don't know how to explain that, given it works locally and in CI. Maybe your ghcide submodule is out of sync?

EDIT: Let me add a less trivial test that exercises module dependencies

@fendor
Copy link
Collaborator

fendor commented Jul 12, 2020

I'm not the best person to enumerate the features in hls or to port the one in hie, seeing as I've never been a user of either. But I want to document the Eval plugin. Should I just add a new section listing just the Eval plugin?

Yeah, that would be fine! I would not want to force you to write the documentation for every feature

Maybe your ghcide submodule is out of sync?

Git submodule is at

commit 747ec1401c62257ec849319eb2dda966a8008b09 (HEAD, origin/hls-2)
Author: Zubin Duggal <[email protected]>
Date:   Sat Jun 27 13:44:12 2020 +0530

    Don't restart shake session so that InitialLoad works

for installation I used ./cabal-hls-install hls-8.8.3 which calls git submodule sync && git submodule update --init --recursive.
Did I mess something up?

Just for completeness full logs:

Full logs
[client] run command = "haskell-language-server-wrapper --lsp"
[client] debug command = "haskell-language-server-wrapper --lsp"
ghcide version: 0.2.0.0 (GHC: 8.8.3) (PATH: /home/munin/.cabal/store/ghc-8.8.3/haskell-language-server-0.2.0.0-9476cc2daa63767f227eb3840e2bc4b05a5bc20c973335fcddfadfc5d1f08b38/bin/haskell-language-server-wrapper)
ghcide version: 0.2.0.0 (GHC: 8.8.3) (PATH: /home/munin/.cabal/bin/haskell-language-server-8.8.3)
Starting (haskell-language-server)LSP server...
  with arguments: Arguments {argLSP = True, argsCwd = Nothing, argFiles = [], argsVersion = False, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = False, argsLogFile = Nothing, argsThreads = 0}
  with plugins: [PluginId "brittany",PluginId "eval",PluginId "floskell",PluginId "ghcide",PluginId "ormolu",PluginId "pragmas",PluginId "stylish-haskell"]
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 Started LSP server in 0.01s
2020-07-12 13:12:53.124406971 [ThreadId 30] - Opened text document: file:///home/munin/Documents/haskell/hls/src/Ide/Cradle.hs
Data.HashMap.Base.(!): key not found
CallStack (from HasCallStack):
  error, called at ./Data/HashMap/Base.hs:733:16 in unordered-containers-0.2.11.0-91189d93d8597115f156c50ea132193c0a4d7ce8ab8554a08480c9c95a022bca:Data.HashMap.Base
  !, called at src/Development/IDE/Import/DependencyInformation.hs:107:40 in ghcide-0.2.0-52f20783409697de6c196b0810d1688811d3be0cf3e768d6b64111b06c7e1089:Development.IDE.Import.DependencyInformation
2020-07-12 13:12:53.125091599 [ThreadId 88] - Consulting the cradle for "/home/munin/Documents/haskell/hls/src/Ide/Cradle.hs"
> Resolving dependencies...
> Build profile: -w ghc-8.8.3 -O1
> In order, the following will be built (use -v for more details):
>  - ghcide-0.2.0 (lib) (configuration changed)
>  - haskell-language-server-0.2.0.0 (lib) (configuration changed)
> Configuring library for ghcide-0.2.0..
> Preprocessing library for ghcide-0.2.0..
> Building library for ghcide-0.2.0..
> Preprocessing library for ghcide-0.2.0..
> Running Haddock on library for ghcide-0.2.0..
> Warning: The documentation for the following packages are not installed. No
> links will be generated to these packages: StateVar-1.2, adjunctions-4.4,
> aeson-1.4.7.1, ansi-terminal-0.10.3, async-2.2.2, attoparsec-0.13.2.4,
> base-compat-0.11.1, base-compat-batteries-0.11.1, base-orphans-0.8.2,
> bifunctors-5.5.7, call-stack-0.2.0, clock-0.8, colour-2.3.5, comonad-5.0.6,
> contravariant-1.5.2, data-default-0.7.1.1, data-default-class-0.1.2.0,
> data-default-instances-containers-0.0.1, data-default-instances-dlist-0.0.1,
> data-default-instances-old-locale-0.0.1, distributive-0.6.2, dlist-0.8.0.8,
> exceptions-0.10.4, extra-1.7.3, filepattern-0.1.2, free-5.1.3, fuzzy-0.1.0.0,
> haddock-library-1.9.0, hashable-1.3.0.0, haskell-lsp-0.22.0.0,
> haskell-lsp-types-0.22.0.0, heaps-0.3.6.1, hslogger-1.3.1.0,
> integer-logarithms-1.0.3, invariant-0.5.3, js-dgtable-0.5.2, js-flot-0.8.3,
> js-jquery-3.3.1, kan-extensions-5.2, lens-4.19.2, monoid-subclasses-1.0.1,
> network-3.1.1.1, network-bsd-2.8.1.0, network-uri-2.6.3.0, old-locale-1.0.0.7,
> opentelemetry-0.4.2, parallel-3.2.2.0, prettyprinter-1.6.2,
> prettyprinter-ansi-terminal-1.1.1.2, primes-0.2.1.0, primitive-0.7.1.0,
> profunctors-5.5.2, random-1.1, reflection-2.1.6, regex-base-0.94.0.0,
> regex-tdfa-1.3.1.0, rope-utf16-splay-0.3.1.0, safe-exceptions-0.1.7.0,
> scientific-0.3.6.2, semigroupoids-5.3.4, semigroups-0.18.5, shake-0.19.1,
> sorted-list-0.2.1.0, syb-0.7.1, tagged-0.8.6, temporary-1.3,
> th-abstraction-0.3.2.0, time-compat-1.9.3, transformers-base-0.4.5.2,
> transformers-compat-0.6.5, unordered-containers-0.2.11.0, utf8-string-1.0.1.1,
> uuid-types-1.0.3, vector-0.12.1.2, void-0.7.3
> 
> src/Development/IDE/GHC/Compat.hs:81:1: warning: [-Wunused-imports]
>     The import of ‘Development.IDE.GHC.HieBin’ is redundant
>       except perhaps to import instances from ‘Development.IDE.GHC.HieBin’
>     To import instances alone, use: import Development.IDE.GHC.HieBin()
>    |
> 81 | import Development.IDE.GHC.HieBin (readHieFile,writeHieFile,NameCacheUpdater(..),HieFileResult(..))
>    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> src/Development/IDE/GHC/Compat.hs:91:1: warning: [-Wunused-imports]
>     The import of ‘HscTypes’ is redundant
>       except perhaps to import instances from ‘HscTypes’
>     To import instances alone, use: import HscTypes()
>    |
> 91 | import HscTypes (srcErrorMessages)
>    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> src/Development/IDE/GHC/Compat.hs:92:1: warning: [-Wunused-imports]
>     The import of ‘Control.Applicative’ is redundant
>       except perhaps to import instances from ‘Control.Applicative’
>     To import instances alone, use: import Control.Applicative()
>    |
> 92 | import Control.Applicative ((<|>))
>    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> src/Development/IDE/GHC/Compat.hs:93:1: warning: [-Wunused-imports]
>     The import of ‘Development.IDE.GHC.HieAst’ is redundant
>       except perhaps to import instances from ‘Development.IDE.GHC.HieAst’
>     To import instances alone, use: import Development.IDE.GHC.HieAst()
>    |
> 93 | import Development.IDE.GHC.HieAst (mkHieFile)
>    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> src/Development/IDE/GHC/Compat.hs:99:1: warning: [-Wunused-imports]
>     The import of ‘HieUtils’ is redundant
>       except perhaps to import instances from ‘HieUtils’
>     To import instances alone, use: import HieUtils()
>    |
> 99 | import HieUtils
>    | ^^^^^^^^^^^^^^^
> 
> src/Development/IDE/Core/RuleTypes.hs:22:1: warning: [-Wunused-imports]
>     The qualified import of ‘Data.Map’ is redundant
>       except perhaps to import instances from ‘Data.Map’
>     To import instances alone, use: import Data.Map()
>    |
> 22 | import qualified Data.Map as M
>    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Haddock coverage:
>    0% (  0 /  2) in 'Development.IDE.Compat'
>   Missing documentation for:
>     Module header
>     getProcessID (src/Development/IDE/Compat.hs:16)
>   60% (  3 /  5) in 'Development.IDE.Core.Debouncer'
>   Missing documentation for:
>     Module header
>     registerEvent (src/Development/IDE/Core/Debouncer.hs:29)
>   15% (  2 / 13) in 'Development.IDE.Core.PositionMapping'
>   Missing documentation for:
>     Module header
>     PositionMapping (src/Development/IDE/Core/PositionMapping.hs:38)
>     fromCurrentPosition (src/Development/IDE/Core/PositionMapping.hs:30)
>     toCurrentPosition (src/Development/IDE/Core/PositionMapping.hs:33)
>     PositionDelta (src/Development/IDE/Core/PositionMapping.hs:25)
>     toCurrentRange (src/Development/IDE/Core/PositionMapping.hs:41)
>     fromCurrentRange (src/Development/IDE/Core/PositionMapping.hs:45)
>     applyChange (src/Development/IDE/Core/PositionMapping.hs:72)
>     zeroMapping (src/Development/IDE/Core/PositionMapping.hs:49)
>     toCurrent (src/Development/IDE/Core/PositionMapping.hs:79)
>     fromCurrent (src/Development/IDE/Core/PositionMapping.hs:101)
> Warning: 'CoreExpr' is out of scope.
>     If you qualify the identifier, haddock can try to link it anyway.
>    0% (  0 / 11) in 'Development.IDE.Spans.Common'
>   Missing documentation for:
>     Module header
>     showGhc (src/Development/IDE/Spans/Common.hs:39)
>     showName (src/Development/IDE/Spans/Common.hs:42)
>     safeTyThingId (src/Development/IDE/Spans/Common.hs:57)
>     safeTyThingType (src/Development/IDE/Spans/Common.hs:50)
>     SpanDoc (src/Development/IDE/Spans/Common.hs:63)
>     SpanDocUris (src/Development/IDE/Spans/Common.hs:68)
>     emptySpanDoc (src/Development/IDE/Spans/Common.hs:74)
>     spanDocToMarkdown (src/Development/IDE/Spans/Common.hs:77)
>     spanDocToMarkdownForTest (src/Development/IDE/Spans/Common.hs:97)
>     DocMap (src/Development/IDE/Spans/Common.hs:37)
> Warning: Couldn't find .haddock for export Location
> Warning: Couldn't find .haddock for export Position
> Warning: Couldn't find .haddock for export Range
> Warning: Couldn't find .haddock for export Uri
> Warning: Couldn't find .haddock for export NormalizedUri
> Warning: Couldn't find .haddock for export toNormalizedUri
> Warning: Couldn't find .haddock for export fromNormalizedUri
> Warning: Couldn't find .haddock for export NormalizedFilePath
> Warning: Couldn't find .haddock for export fromNormalizedFilePath
>   15% (  3 / 20) in 'Development.IDE.Types.Location'
>   Missing documentation for:
>     Location
>     noFilePath (src/Development/IDE/Types/Location.hs:67)
>     noRange (src/Development/IDE/Types/Location.hs:71)
>     Position
>     showPosition (src/Development/IDE/Types/Location.hs:74)
>     Range
>     Uri
>     NormalizedUri
>     toNormalizedUri
>     fromNormalizedUri
>     NormalizedFilePath
>     fromUri (src/Development/IDE/Types/Location.hs:64)
>     emptyFilePath (src/Development/IDE/Types/Location.hs:44)
>     emptyPathUri (src/Development/IDE/Types/Location.hs:56)
>     toNormalizedFilePath' (src/Development/IDE/Types/Location.hs:39)
>     fromNormalizedFilePath
>     filePathToUri' (src/Development/IDE/Types/Location.hs:61)
> Warning: 'Document' is out of scope.
>     If you qualify the identifier, haddock can try to link it anyway.
> Warning: Couldn't find .haddock for export Diagnostic
> Warning: Couldn't find .haddock for export DiagnosticSeverity
> Warning: Couldn't find .haddock for export DiagnosticStore
> Warning: Couldn't find .haddock for export List
>   25% (  3 / 12) in 'Development.IDE.Types.Diagnostics'
>   Missing documentation for:
>     Module header
>     Diagnostic
>     DiagnosticSeverity
>     DiagnosticStore
>     List
>     ideErrorText (src/Development/IDE/Types/Diagnostics.hs:48)
>     ideErrorWithSource (src/Development/IDE/Types/Diagnostics.hs:51)
>     showDiagnostics (src/Development/IDE/Types/Diagnostics.hs:97)
>     showDiagnosticsColored (src/Development/IDE/Types/Diagnostics.hs:100)
>   50% (  1 /  2) in 'Development.IDE.LSP.Protocol'
>   Missing documentation for:
>     Module header
> Warning: 'HsEnvEq' is out of scope.
>     If you qualify the identifier, haddock can try to link it anyway.
> Warning: 'hDuplicateTo' is out of scope.
>     If you qualify the identifier, haddock can try to link it anyway.
>   78% ( 21 / 27) in 'Development.IDE.GHC.Util'
>   Missing documentation for:
>     deps (src/Development/IDE/GHC/Util.hs:180)
>     ParseResult
>     runParser (src/Development/IDE/GHC/Util.hs:105)
>     stringBufferToByteString (src/Development/IDE/GHC/Util.hs:113)
>     setHieDir (src/Development/IDE/GHC/Compat.hs:234)
>     dontWriteHieFiles (src/Development/IDE/GHC/Compat.hs:242)
>   57% ( 12 / 21) in 'Development.IDE.GHC.Error'
>   Missing documentation for:
>     Module header
>     diagFromErrMsgs (src/Development/IDE/GHC/Error.hs:66)
>     diagFromGhcException (src/Development/IDE/GHC/Error.hs:154)
>     srcSpanToLocation (src/Development/IDE/GHC/Error.hs:89)
>     srcSpanToLocationMaybe (src/Development/IDE/GHC/Error.hs:94)
>     srcSpanToRangeMaybe (src/Development/IDE/GHC/Error.hs:74)
>     realSrcSpanToRange (src/Development/IDE/GHC/Error.hs:78)
>     realSpan (src/Development/IDE/GHC/Error.hs:134)
>     isInsideSrcSpan (src/Development/IDE/GHC/Error.hs:98)
> Warning: 'main' is out of scope.
>     If you qualify the identifier, haddock can try to link it anyway.
>   23% (  5 / 22) in 'Development.IDE.Import.DependencyInformation'
>   Missing documentation for:
>     Module header
>     DependencyInformation (src/Development/IDE/Import/DependencyInformation.hs:138)
>     TransitiveDependencies (src/Development/IDE/Import/DependencyInformation.hs:365)
>     NamedModuleDep (src/Development/IDE/Import/DependencyInformation.hs:378)
>     PathIdMap (src/Development/IDE/Import/DependencyInformation.hs:80)
>     emptyPathIdMap (src/Development/IDE/Import/DependencyInformation.hs:88)
>     getPathId (src/Development/IDE/Import/DependencyInformation.hs:91)
>     lookupPathToId (src/Development/IDE/Import/DependencyInformation.hs:109)
>     insertImport (src/Development/IDE/Import/DependencyInformation.hs:103)
>     pathToId (src/Development/IDE/Import/DependencyInformation.hs:106)
>     idToPath (src/Development/IDE/Import/DependencyInformation.hs:112)
>     reachableModules (src/Development/IDE/Import/DependencyInformation.hs:162)
>     processDependencyInformation (src/Development/IDE/Import/DependencyInformation.hs:223)
>     transitiveDeps (src/Development/IDE/Import/DependencyInformation.hs:331)
>     reverseDependencies (src/Development/IDE/Import/DependencyInformation.hs:319)
>     BootIdMap (src/Development/IDE/Import/DependencyInformation.hs:118)
>     insertBootId (src/Development/IDE/Import/DependencyInformation.hs:120)
>    8% (  2 / 25) in 'Development.IDE.Core.RuleTypes'
>   Missing documentation for:
>     GetModSummary (src/Development/IDE/Core/RuleTypes.hs:246)
>     IsFileOfInterest (src/Development/IDE/Core/RuleTypes.hs:240)
>     GetModIface (src/Development/IDE/Core/RuleTypes.hs:234)
>     GetModIfaceFromDisk (src/Development/IDE/Core/RuleTypes.hs:228)
>     GhcSessionDeps (src/Development/IDE/Core/RuleTypes.hs:223)
>     GhcSession (src/Development/IDE/Core/RuleTypes.hs:217)
>     GenerateByteCode (src/Development/IDE/Core/RuleTypes.hs:211)
>     GenerateCore (src/Development/IDE/Core/RuleTypes.hs:205)
>     GetDocMap (src/Development/IDE/Core/RuleTypes.hs:198)
>     GetHieFile (src/Development/IDE/Core/RuleTypes.hs:192)
>     TypeCheck (src/Development/IDE/Core/RuleTypes.hs:186)
>     GetDependencies (src/Development/IDE/Core/RuleTypes.hs:180)
>     ReportImportCycles (src/Development/IDE/Core/RuleTypes.hs:174)
>     GetModuleGraph (src/Development/IDE/Core/RuleTypes.hs:168)
>     GetDependencyInformation (src/Development/IDE/Core/RuleTypes.hs:162)
>     GetLocatedImports (src/Development/IDE/Core/RuleTypes.hs:156)
>     GetParsedModule (src/Development/IDE/Core/RuleTypes.hs:150)
>     PDocMap (src/Development/IDE/Core/RuleTypes.hs:107)
>     HieFileResult (src/Development/IDE/Core/RuleTypes.hs:96)
>     HiFileResult (src/Development/IDE/Core/RuleTypes.hs:71)
>     tmrModSummary (src/Development/IDE/Core/RuleTypes.hs:68)
>     tmr_hiFileResult (src/Development/IDE/Core/RuleTypes.hs:78)
>     hiFileFingerPrint (src/Development/IDE/Core/RuleTypes.hs:84)
> Warning: 'phase' is out of scope.
> 
> src/Development/IDE/Core/Compile.hs:290:21: warning: [-Wunused-local-binds]
>     Defined but not used: ‘isBoot’
>     |
> 290 |     (withBootSuffix,isBoot) = case ms_hsc_src mod_summary of
>     |                     ^^^^^^
> 
> src/Development/IDE/Core/Rules.hs:39:1: warning: [-Wunused-imports]
>     The import of ‘Control.Applicative’ is redundant
>       except perhaps to import instances from ‘Control.Applicative’
>     To import instances alone, use: import Control.Applicative()
>    |
> 39 | import Control.Applicative
>    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
>     If you qualify the identifier, haddock can try to link it anyway.
>   22% (  2 /  9) in 'Development.IDE.Types.Logger'
>   Missing documentation for:
>     Priority (src/Development/IDE/Types/Logger.hs:18)
>     logError (src/Development/IDE/Types/Logger.hs:37)
>     logWarning (src/Development/IDE/Types/Logger.hs:40)
>     logInfo (src/Development/IDE/Types/Logger.hs:43)
>     logDebug (src/Development/IDE/Types/Logger.hs:46)
>     logTelemetry (src/Development/IDE/Types/Logger.hs:49)
>     noLogging (src/Development/IDE/Types/Logger.hs:53)
> Warning: 'ComponentOptions' is out of scope.
>     If you qualify the identifier, haddock can try to link it anyway.
>   27% (  3 / 11) in 'Development.IDE.Types.Options'
>   Missing documentation for:
>     IdeOptions (src/Development/IDE/Types/Options.hs:39)
>     IdePreprocessedSource (src/Development/IDE/Types/Options.hs:78)
>     IdeReportProgress (src/Development/IDE/Types/Options.hs:87)
>     IdeDefer (src/Development/IDE/Types/Options.hs:88)
>     IdeTesting (src/Development/IDE/Types/Options.hs:89)
>     clientSupportsProgress (src/Development/IDE/Types/Options.hs:91)
>     defaultIdeOptions (src/Development/IDE/Types/Options.hs:95)
>     IdeGhcSession (src/Development/IDE/Types/Options.hs:29)
> Warning: 'lspShakeProgress' is out of scope.
>     If you qualify the identifier, haddock can try to link it anyway.
> Warning: 'v' is out of scope.
>     If you qualify the identifier, haddock can try to link it anyway.
>   25% ( 17 / 67) in 'Development.IDE.Core.Shake'
>   Missing documentation for:
>     shakeExtras (src/Development/IDE/Core/Shake.hs:305)
>     ShakeExtras (src/Development/IDE/Core/Shake.hs:123)
>     getShakeExtras (src/Development/IDE/Core/Shake.hs:164)
>     getShakeExtrasRules (src/Development/IDE/Core/Shake.hs:169)
>     IdeRule (src/Development/IDE/Core/Shake.hs:282)
>     GetModificationTime (src/Development/IDE/Core/Shake.hs:1080)
>     shakeShut (src/Development/IDE/Core/Shake.hs:511)
>     shakeEnqueueSession (src/Development/IDE/Core/Shake.hs:587)
>     shakeProfile (src/Development/IDE/Core/Shake.hs:508)
>     use (src/Development/IDE/Core/Shake.hs:711)
>     useNoFile (src/Development/IDE/Core/Shake.hs:784)
>     use_ (src/Development/IDE/Core/Shake.hs:787)
>     useNoFile_ (src/Development/IDE/Core/Shake.hs:790)
>     uses_ (src/Development/IDE/Core/Shake.hs:793)
>     useWithStale (src/Development/IDE/Core/Shake.hs:715)
>     useWithStale_ (src/Development/IDE/Core/Shake.hs:719)
>     usesWithStale_ (src/Development/IDE/Core/Shake.hs:723)
>     define (src/Development/IDE/Core/Shake.hs:706)
>     defineEarlyCutoff (src/Development/IDE/Core/Shake.hs:855)
>     defineOnDisk (src/Development/IDE/Core/Shake.hs:944)
>     needOnDisk (src/Development/IDE/Core/Shake.hs:977)
>     needOnDisks (src/Development/IDE/Core/Shake.hs:982)
>     getDiagnostics (src/Development/IDE/Core/Shake.hs:675)
>     getHiddenDiagnostics (src/Development/IDE/Core/Shake.hs:680)
>     IsIdeGlobal (src/Development/IDE/Core/Shake.hs:174)
>     addIdeGlobal (src/Development/IDE/Core/Shake.hs:176)
>     addIdeGlobalExtras (src/Development/IDE/Core/Shake.hs:181)
>     getIdeGlobalState (src/Development/IDE/Core/Shake.hs:201)
>     getIdeGlobalAction (src/Development/IDE/Core/Shake.hs:198)
>     getIdeGlobalExtras (src/Development/IDE/Core/Shake.hs:188)
>     getIdeOptions (src/Development/IDE/Core/Shake.hs:224)
>     getIdeOptionsIO (src/Development/IDE/Core/Shake.hs:229)
>     GlobalIdeOptions (src/Development/IDE/Core/Shake.hs:221)
>     knownFiles (src/Development/IDE/Core/Shake.hs:371)
>     setPriority (src/Development/IDE/Core/Shake.hs:1062)
>     sendEvent (src/Development/IDE/Core/Shake.hs:1065)
>     ideLogger (src/Development/IDE/Core/Shake.hs:1070)
>     actionLogger (src/Development/IDE/Core/Shake.hs:1073)
>     FileVersion (src/Development/IDE/Core/Shake.hs:1105)
>     modificationTime (src/Development/IDE/Core/Shake.hs:1124)
>     Priority (src/Development/IDE/Core/Shake.hs:1060)
>     updatePositionMapping (src/Development/IDE/Core/Shake.hs:1175)
>     OnDiskRule (src/Development/IDE/Core/Shake.hs:928)
>     WithProgressFunc (src/Development/IDE/Core/Shake.hs:155)
>     WithIndefiniteProgressFunc (src/Development/IDE/Core/Shake.hs:157)
>     ProgressEvent (src/Development/IDE/Core/Shake.hs:160)
>     DelayedAction (src/Development/IDE/Core/Shake.hs:534)
>     mkDelayedAction (src/Development/IDE/Core/Shake.hs:531)
>     IdeAction (src/Development/IDE/Core/Shake.hs:730)
>     mkUpdater (src/Development/IDE/Core/Shake.hs:742)
>  100% (  6 /  6) in 'Development.IDE.Core.OfInterest'
>   14% (  1 /  7) in 'Development.IDE.Core.IdeConfiguration'
>   Missing documentation for:
>     Module header
>     registerIdeConfiguration (src/Development/IDE/Core/IdeConfiguration.hs:32)
>     parseConfiguration (src/Development/IDE/Core/IdeConfiguration.hs:40)
>     parseWorkspaceFolder (src/Development/IDE/Core/IdeConfiguration.hs:50)
>     isWorkspaceFile (src/Development/IDE/Core/IdeConfiguration.hs:61)
>     modifyWorkspaceFolders (src/Development/IDE/Core/IdeConfiguration.hs:54)
>   50% (  5 / 10) in 'Development.IDE.Core.FileStore'
>   Missing documentation for:
>     Module header
>     getFileContents (src/Development/IDE/Core/FileStore.hs:170)
>     fileStoreRules (src/Development/IDE/Core/FileStore.hs:173)
>     makeVFSHandle (src/Development/IDE/Core/FileStore.hs:71)
>     makeLSPVFSHandle (src/Development/IDE/Core/FileStore.hs:86)
>   42% (  5 / 12) in 'Development.IDE.Core.Service'
>   Missing documentation for:
>     getIdeOptions (src/Development/IDE/Core/Shake.hs:224)
>     getIdeOptionsIO (src/Development/IDE/Core/Shake.hs:229)
>     runAction (src/Development/IDE/Core/Service.hs:84)
>     writeProfile (src/Development/IDE/Core/Service.hs:74)
>     getDiagnostics (src/Development/IDE/Core/Shake.hs:675)
>     ideLogger (src/Development/IDE/Core/Shake.hs:1070)
>     updatePositionMapping (src/Development/IDE/Core/Shake.hs:1175)
>    0% (  0 /  3) in 'Development.IDE.LSP.Server'
>   Missing documentation for:
>     Module header
>     WithMessage (src/Development/IDE/LSP/Server.hs:19)
>     PartialHandlers (src/Development/IDE/LSP/Server.hs:38)
>   36% (  9 / 25) in 'Development.IDE.Core.Rules'
>   Missing documentation for:
>     GetDependencies (src/Development/IDE/Core/RuleTypes.hs:180)
>     GetParsedModule (src/Development/IDE/Core/RuleTypes.hs:150)
>     TransitiveDependencies (src/Development/IDE/Import/DependencyInformation.hs:365)
>     Priority (src/Development/IDE/Core/Shake.hs:1060)
>     GhcSessionIO (src/Development/IDE/Core/Rules.hs:576)
>     priorityTypeCheck (src/Development/IDE/Core/Rules.hs:235)
>     priorityGenerateCore (src/Development/IDE/Core/Rules.hs:238)
>     priorityFilesOfInterest (src/Development/IDE/Core/Rules.hs:241)
>     runAction (src/Development/IDE/Core/Service.hs:84)
>     useNoFileE (src/Development/IDE/Core/Rules.hs:104)
>     usesE (src/Development/IDE/Core/Rules.hs:107)
>     defineNoFile (src/Development/IDE/Core/Rules.hs:110)
>     defineEarlyCutOffNoFile (src/Development/IDE/Core/Rules.hs:115)
>     getTypeDefinition (src/Development/IDE/Core/Rules.hs:150)
>     highlightAtPoint (src/Development/IDE/Core/Rules.hs:158)
>     generateCore (src/Development/IDE/Core/Rules.hs:550)
>   33% (  2 /  6) in 'Development.IDE.Plugin'
>   Missing documentation for:
>     Module header
>     Plugin (src/Development/IDE/Plugin.hs:16)
>     codeActionPlugin (src/Development/IDE/Plugin.hs:31)
>     codeActionPluginWithRules (src/Development/IDE/Plugin.hs:34)
>   33% (  1 /  3) in 'Development.IDE.Plugin.Completions'
>   Missing documentation for:
>     Module header
>     plugin (src/Development/IDE/Plugin/Completions.hs:36)
>   71% (  5 /  7) in 'Development.IDE.Plugin.CodeAction'
>   Missing documentation for:
>     plugin (src/Development/IDE/Plugin/CodeAction.hs:60)
>     rulePackageExports (src/Development/IDE/Plugin/CodeAction/Rules.hs:34)
>   25% (  1 /  4) in 'Development.IDE.LSP.Outline'
>   Missing documentation for:
>     Module header
>     setHandlersOutline (src/Development/IDE/LSP/Outline.hs:33)
>     moduleOutline (src/Development/IDE/LSP/Outline.hs:38)
>   22% (  2 /  9) in 'Development.IDE.LSP.HoverDefinition'
>   Missing documentation for:
>     setHandlersHover (src/Development/IDE/LSP/HoverDefinition.hs:42)
>     setHandlersDefinition (src/Development/IDE/LSP/HoverDefinition.hs:42)
>     setHandlersTypeDefinition (src/Development/IDE/LSP/HoverDefinition.hs:42)
>     setHandlersDocHighlight (src/Development/IDE/LSP/HoverDefinition.hs:42)
>     hover (src/Development/IDE/LSP/HoverDefinition.hs:30)
>     gotoDefinition (src/Development/IDE/LSP/HoverDefinition.hs:29)
>     gotoTypeDefinition (src/Development/IDE/LSP/HoverDefinition.hs:31)
> Warning: 'executeCommand' is out of scope.
>     If you qualify the identifier, haddock can try to link it anyway.
> Warning: 'applyWorkspaceEdit' is out of scope.
>     If you qualify the identifier, haddock can try to link it anyway.
>    0% (  0 /  2) in 'Development.IDE.LSP.LanguageServer'
>   Missing documentation for:
>     Module header
>     runLanguageServer (src/Development/IDE/LSP/LanguageServer.hs:42)
> Warning: Development.IDE.Core.Debouncer: could not find link destinations for:
>     Seconds Hashable
> Warning: Development.IDE.Core.PositionMapping: could not find link destinations for:
>     TextDocumentContentChangeEvent
> Warning: Development.IDE.Types.Location: could not find link destinations for:
>     FromJSON parseJSON Value Parser parseJSONList ToJSON toJSON toEncoding Encoding toJSONList toEncodingList Hashable hashWithSalt hash FromJSONKey fromJSONKey FromJSONKeyFunction fromJSONKeyList ToJSONKey toJSONKey ToJSONKeyFunction toJSONKeyList
> Warning: Development.IDE.Types.Diagnostics: could not find link destinations for:
>     NumberOrString DiagnosticSource DiagnosticTag DiagnosticRelatedInformation FromJSON parseJSON Value Parser parseJSONList ToJSON toJSON toEncoding Encoding toJSONList toEncodingList HashMap StoreItem
> Warning: Development.IDE.LSP.Protocol: could not find link destinations for:
>     FromServerMessage
> Warning: Development.IDE.GHC.Util: could not find link destinations for:
>     Hashable hashWithSalt hash
> Warning: Development.IDE.Import.DependencyInformation: could not find link destinations for:
>     FilePathIdMap ShowableModuleName FilePathIdSet ArtifactsLocation ErrorNode SuccessNode
> Warning: Development.IDE.Core.RuleTypes: could not find link destinations for:
>     Hashable hashWithSalt hash RuleResult RefMap
> Warning: Development.IDE.Types.Options: could not find link destinations for:
>     Action ClientCapabilities
> Warning: Development.IDE.Core.Shake: could not find link destinations for:
>     FromServerMessage Var HashMap Values TextDocumentVersion ShakeSession Action Rules RuleResult ShakeValue Hashable hashWithSalt hash LspId ShakeOptions HashSet VersionedTextDocumentIdentifier TextDocumentContentChangeEvent ProgressCancellable Progress Failed Succeeded ShakeDatabase shakeDb Q A
> Warning: Development.IDE.Core.OfInterest: could not find link destinations for:
>     Rules Action HashSet
> Warning: Development.IDE.Core.IdeConfiguration: could not find link destinations for:
>     HashSet InitializeParams WorkspaceFolder Action
> Warning: Development.IDE.Core.FileStore: could not find link destinations for:
>     Action VirtualFile Rules LspFuncs
> Warning: Development.IDE.Core.Service: could not find link destinations for:
>     Action ClientCapabilities Rules LspId FromServerMessage VersionedTextDocumentIdentifier TextDocumentContentChangeEvent
> Warning: Development.IDE.LSP.Server: could not find link destinations for:
>     ResponseMessage FromServerMessage LspFuncs ResponseError Handler RequestMessage NotificationMessage InitializeParams InitializeRequest Handlers Default def
> Warning: Development.IDE.Core.Rules: could not find link destinations for:
>     Hashable hashWithSalt hash RuleResult Action Rules DocumentHighlight RunSimplifier
> Warning: Development.IDE.Plugin: could not find link destinations for:
>     Rules Default def LspFuncs TextDocumentIdentifier CodeActionContext ResponseError CAResult
> Warning: Development.IDE.Plugin.Completions: could not find link destinations for:
>     LspFuncs CompletionParams ResponseError CompletionResponseResult
> Warning: Development.IDE.Plugin.CodeAction: could not find link destinations for:
>     LspFuncs TextDocumentIdentifier CodeActionContext ResponseError CAResult CodeLensParams CodeLens Rules ExecuteCommandParams Value ServerMethod ApplyWorkspaceEditParams
> Warning: Development.IDE.LSP.Outline: could not find link destinations for:
>     LspFuncs DocumentSymbolParams ResponseError DSResult
> Warning: Development.IDE.LSP.HoverDefinition: could not find link destinations for:
>     TextDocumentPositionParams ResponseError Hover LocationResponseParams
> Warning: Development.IDE.LSP.LanguageServer: could not find link destinations for:
>     Options InitializeRequest DidChangeConfigurationNotification LspId FromServerMessage ClientCapabilities
> Documentation created:
> /home/munin/Documents/haskell/hls/dist-newstyle/build/x86_64-linux/ghc-8.8.3/ghcide-0.2.0/doc/html/ghcide/index.html
> Configuring library for haskell-language-server-0.2.0.0..
> Preprocessing library for haskell-language-server-0.2.0.0..
2020-07-12 13:13:11.16469261 [ThreadId 88] - Using interface files cache dir: /home/munin/.cache/ghcide/haskell-language-server-0.2.0.0-inplace-a98a2055e0d0dd34b308f9c2bf8d51000f4ec04a
2020-07-12 13:13:11.16495992 [ThreadId 88] - Making new HscEnv[haskell-language-server-0.2.0.0-inplace]
2020-07-12 13:13:11.228676566 [ThreadId 135] - Plugin.makeCodeLens (ideLogger)
2020-07-12 13:13:12.098355484 [ThreadId 2139] - finish: InitialLoad (took 0.87s)
2020-07-12 13:13:12.098454463 [ThreadId 2139] - finish: codeLens (took 0.00s)
2020-07-12 13:13:12.098490823 [ThreadId 2142] - GhcIde.hover entered (ideLogger)
2020-07-12 13:13:12.098574573 [ThreadId 2142] - Hover request at position 816:32 in file: /home/munin/Documents/haskell/hls/src/Ide/Cradle.hs
2020-07-12 13:13:19.73796862 [ThreadId 2146] - finish: runEvalCmd.ghcSession (took 0.00s)
2020-07-12 13:13:19.73807602 [ThreadId 2146] - finish: runEvalCmd.getModSummary (took 0.00s)
2020-07-12 13:13:19.768739025 [ThreadId 30] - Unexpected exception on request, please report!
Message: RequestMessage {_jsonrpc = "2.0", _id = IdInt 4, _method = WorkspaceExecuteCommand, _params = ExecuteCommandParams {_command = "15587:eval:evalCommand", _arguments = Just (List [Object (fromList [("module_",Object (fromList [("uri",String "file:///home/munin/Documents/haskell/hls/src/Ide/Cradle.hs")])),("editTarget",Object (fromList [("start",Object (fromList [("line",Number 816.0),("character",Number 0.0)])),("end",Object (fromList [("line",Number 818.0),("character",Number 0.0)]))])),("statements",Array [Array [String "stripFilePath \"app/\" \"./app/Lib/File.hs\"",Number 815.0]])])]), _workDoneToken = Nothing}}
Exception: Rules should not depend on ms_hs_date
CallStack (from HasCallStack):
  error, called at src/Development/IDE/Core/Compile.hs:472:37 in ghcide-0.2.0-52f20783409697de6c196b0810d1688811d3be0cf3e768d6b64111b06c7e1089:Development.IDE.Core.Compile
[Error - 1:13:19 PM] Request workspace/executeCommand failed.
  Message: Rules should not depend on ms_hs_date
CallStack (from HasCallStack):
  error, called at src/Development/IDE/Core/Compile.hs:472:37 in ghcide-0.2.0-52f20783409697de6c196b0810d1688811d3be0cf3e768d6b64111b06c7e1089:Development.IDE.Core.Compile
  Code: -32603 
2020-07-12 13:13:23.741160326 [ThreadId 2151] - GhcIde.hover entered (ideLogger)
2020-07-12 13:13:23.741274956 [ThreadId 2151] - Hover request at position 816:4 in file: /home/munin/Documents/haskell/hls/src/Ide/Cradle.hs

.gitignore Show resolved Hide resolved
@pepeiborra
Copy link
Collaborator Author

Thanks @fendor for trying out the plugin and finding a bug with module dependencies before merging it! It's fixed now (and tested for).
I have also added a feature entry in the README

Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

I notice, it removes trailing newlines, e.g.

-- >>> unwords ["hello,", "world"]
-- "hello, world"
-- 

Is changed to:

-- >>> unwords ["hello,", "world"]
-- "hello, world"

Also, it removes comments you might have added:

-- >>> unwords ["hello,", "world"]
-- "hello, world" -- output
-- >>> unwords ["hello,", "world"]
-- "hello, world"

I suppose, the latter is fine and the former can be fixed in a follow up PR, imo.

@fendor
Copy link
Collaborator

fendor commented Jul 12, 2020

Also, I noticed some weird behaviour in the test-case T4.hs.
If you press Evaluate quick enough, you can produce the eval output several times.


One more bug in T4.hs: After executing evaluate, no changes to example or evaluation have any impact on Refresh...


I am still fine with current state, I think we can easily fix it in follow up PRs.

@pepeiborra
Copy link
Collaborator Author

I think I've managed to fix the second round of bugs 🐛
Let me know if you find more!

@pepeiborra
Copy link
Collaborator Author

The 8.6.4 is failing with a weird stack error, but other than that this is ready to go.

@fendor
Copy link
Collaborator

fendor commented Jul 14, 2020

Need to clear the caches, but I always forget how to do it, cc @alanz

@alanz
Copy link
Collaborator

alanz commented Jul 14, 2020

Need to clear the caches, but I always forget how to do it.

On circleci? You have to change the environment variable and give HIE_CACHE a different value, I normally use the date. It only prints some of it, with XX, to protect against leakage.

Update is by adding with the same name.

I have just set it to 2020-07-14

cc @fendor

@fendor
Copy link
Collaborator

fendor commented Jul 14, 2020

Turns out, this was my mistake and is fixed by #199
So, we can just merge this.

@lukel97
Copy link
Collaborator

lukel97 commented Jul 16, 2020

I'm seeing a hard crash on this branch, not 100% sure what the error is yet since the log doesn't seem to include it but will try to find it and post it here in a bit

ghcide version: 0.2.0.0 (GHC: 8.10.1) (PATH: /Users/luke/.cabal/store/ghc-8.10.1/hskll-lngg-srvr-0.2.0.0-920590ed/bin/haskell-language-server)
Starting (haskell-language-server)LSP server...
  with arguments: Arguments {argLSP = True, argsCwd = Nothing, argFiles = [], argsVersion = False, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = False, argsLogFile = Nothing, argsThreads = 0}
  with plugins: [PluginId "eval",PluginId "floskell",PluginId "ghcide",PluginId "ormolu",PluginId "pragmas",PluginId "stylish-haskell"]
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 Started LSP server in 0.00s
[Error - 6:38:22 PM] haskell-lsp:configuration parse error. NotificationMessage {_jsonrpc = "2.0", _method = WorkspaceDidChangeConfiguration, _params = DidChangeConfigurationParams {_settings = Object (fromList [("haskell",Object (fromList [("logFile",String ""),("hlintOn",Bool True),("formatOnImportOn",Bool True),("enable",Bool True),("indentationRules",Object (fromList [("enabled",Bool True)])),("liquidOn",Bool False),("languageServerVariant",String "haskell-language-server"),("serverExecutablePath",String ""),("diagnosticsOnChange",Bool True),("completionSnippetsOn",Bool True),("maxNumberOfProblems",Number 100.0),("formattingProvider",String "brittany"),("trace",Object (fromList [("server",String "off")]))]))])}} "key \"languageServerHaskell\" not found"
2020-07-16 18:38:22.785117 [ThreadId 26] - Opened text document: file:///Users/luke/Source/haskell-language-server/src/Ide/Cradle.hs
Data.HashMap.Base.(!): key not found
CallStack (from HasCallStack):
  error, called at ./Data/HashMap/Base.hs:733:16 in nrdrd-cntnrs-0.2.11.0-6e307fb9:Data.HashMap.Base
  !, called at src/Development/IDE/Import/DependencyInformation.hs:107:40 in ghcd-0.2.0-64f601ce:Development.IDE.Import.DependencyInformation
2020-07-16 18:38:22.787048 [ThreadId 76] - Consulting the cradle for "/Users/luke/Source/haskell-language-server/src/Ide/Cradle.hs"
> Warning: Requested index-state2020-07-13T21:29:04Z is newer than
> 'hackage.haskell.org'! Falling back to older state (2020-07-13T21:03:06Z).
> Resolving dependencies...
> Build profile: -w ghc-8.10.1 -O1
> In order, the following will be built (use -v for more details):
>  - ghcide-0.2.0 (lib) (configuration changed)
>  - haskell-language-server-0.2.0.0 (lib) (configuration changed)
> Configuring library for ghcide-0.2.0..
> Preprocessing library for ghcide-0.2.0..
> Building library for ghcide-0.2.0..
> Configuring library for haskell-language-server-0.2.0.0..
> Preprocessing library for haskell-language-server-0.2.0.0..
2020-07-16 18:38:38.885993 [ThreadId 76] - Using interface files cache dir: /Users/luke/.cache/ghcide/haskell-language-server-0.2.0.0-inplace-63a5830fb4d1da57079af3da284bb67234d52a73
2020-07-16 18:38:38.886264 [ThreadId 76] - Making new HscEnv[haskell-language-server-0.2.0.0-inplace]
haskell-language-server-wrapper: callProcess: /Users/luke/.cabal/bin/haskell-language-server "--lsp" (exit -11): failed
[Error - 6:38:40 PM] Connection to server got closed. Server will not be restarted.
[Error - 6:38:40 PM] Request textDocument/codeAction failed.
Error: Connection got disposed.
	at Object.dispose (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:91016)
	at Object.dispose (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:74289)
	at D.handleConnectionClosed (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:74463)
	at D.handleConnectionClosed (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:247:8259)
	at t (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:72614)
	at n.invoke (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233192)
	at i.fire (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233922)
	at G (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:82925)
	at n.invoke (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233192)
	at i.fire (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233922)
	at u.fireClose (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:252616)
	at Socket.<anonymous> (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:253373)
	at Socket.emit (events.js:208:15)
	at Pipe.<anonymous> (net.js:588:12)
[Error - 6:38:40 PM] Request textDocument/codeLens failed.
Error: Connection got disposed.
	at Object.dispose (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:91016)
	at Object.dispose (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:74289)
	at D.handleConnectionClosed (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:74463)
	at D.handleConnectionClosed (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:247:8259)
	at t (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:72614)
	at n.invoke (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233192)
	at i.fire (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233922)
	at G (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:82925)
	at n.invoke (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233192)
	at i.fire (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233922)
	at u.fireClose (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:252616)
	at Socket.<anonymous> (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:253373)
	at Socket.emit (events.js:208:15)
	at Pipe.<anonymous> (net.js:588:12)
[Error - 6:38:40 PM] Request textDocument/codeLens failed.
Error: Connection got disposed.
	at Object.dispose (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:91016)
	at Object.dispose (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:74289)
	at D.handleConnectionClosed (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:74463)
	at D.handleConnectionClosed (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:247:8259)
	at t (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:72614)
	at n.invoke (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233192)
	at i.fire (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233922)
	at G (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:82925)
	at n.invoke (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233192)
	at i.fire (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:233922)
	at u.fireClose (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:252616)
	at Socket.<anonymous> (/Users/luke/.vscode/extensions/alanz.vscode-hie-server-0.1.0/dist/extension.js:1:253373)
	at Socket.emit (events.js:208:15)
	at Pipe.<anonymous> (net.js:588:12)

pepeiborra and others added 12 commits July 16, 2020 20:46
This is surprising and unexpected - I wasted a lot of time debugging test failures in CI that worked fine locally
Depending on GhcSessionDeps means we do not need to reload all the module
dependencies in the GHC session. On the other hand, with the GhcSession
dependency we *do* have to reload them (from interface files, hopefully)

Unfortunately, the ModSummary objects that GhcSessionDeps puts in the GHC
session are not suitable for reuse since they clear out the timestamps to avoid
internal bugs. This can probably be relaxed so that plugins like Eval can reuse
them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(steps towards an) Eval plugin
7 participants