Skip to content

Add test described by #233#293

Merged
alt-romes merged 1 commit into
masterfrom
fix/233-imported-modules-repl-test
Apr 28, 2026
Merged

Add test described by #233#293
alt-romes merged 1 commit into
masterfrom
fix/233-imported-modules-repl-test

Conversation

@alt-romes

@alt-romes alt-romes commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@alt-romes alt-romes force-pushed the fix/233-imported-modules-repl-test branch from 0359222 to 5c31ecc Compare April 24, 2026 16:11
@alt-romes alt-romes changed the title test: check imported module bindings available in REPL/Evaluate contexts (#233) WIP (#233) Apr 24, 2026
@alt-romes alt-romes force-pushed the fix/233-imported-modules-repl-test branch from 5c31ecc to e7d1e36 Compare April 24, 2026 16:50
@alt-romes

Copy link
Copy Markdown
Collaborator Author

Interestingly, when I set two breakpoints by line it crashes on the second breakpoint it sends, with:

      Imported module bindings available in evaluate context (issue #233):     FAIL (0.49s)
        test/haskell/Test/DAP/Init.hs:173:
        Aborted debugger thread: ghc-internal:GHC.Internal.Exception.ErrorCall:

        IntMap.!: key 14 is not an element of the map

        IPE backtrace:
          Development.Debug.Adapter.Interface.handleAbort (hdb/Development/Debug/Adapter/Interface.hs:31:18-27)
          DAP.Types. (:)
          Data.Aeson.KeyMap. (:)
          DAP.Types.explicitToField (src/Data/Aeson/Types/ToJSON.hs:361:5-50)
          Data.Aeson.KeyMap. (:)
          Data.Aeson.KeyMap. (:)
          DAP.Adaptor. (:)
          Data.Aeson.Encode.Pretty.encodePrettyToTextBuilder' (./Data/Aeson/Encode/Pretty.hs:160:64)
          Data.Aeson.Encode.Pretty.encodePretty' (./Data/Aeson/Encode/Pretty.hs:148:48-78)
          DAP.Adaptor. (:)
          DAP.Internal.withLock (src/DAP/Internal.hs:23:43-59)
          DAP.Internal. (:)
          DAP.Adaptor.logWithAddr (src/DAP/Adaptor.hs:114:28-32)
          DAP.Adaptor. (:)
          DAP.Event.sendOutputEvent (src/DAP/Event.hs:110:38-52)
          Development.Debug.Adapter.Interface.>> (src/DAP/Types.hs:251:7-11)
          Development.Debug.Adapter.Breakpoints.>>= (src/DAP/Types.hs:251:7-11)
          DAP.Adaptor.runAdaptorRequest (src/DAP/Adaptor.hs:486:50)
          DAP.Server.serviceClient.lcl' (src/DAP/Server.hs:147:18-45)
        HasCallStack backtrace:
          error, called at libraries/containers/containers/src/Data/IntMap/Internal.hs:639:17 in containers-0.8-8df4:Data.IntMap.Internal

I'll have to look next week why setting a second breakpoint via the testsuite has this disastrous result.
Also find where this error message is coming from and make it easier to debug next time.

@alt-romes

Copy link
Copy Markdown
Collaborator Author

(This is failing because of #297)

@alt-romes alt-romes force-pushed the fix/233-imported-modules-repl-test branch from e7d1e36 to 2b638b4 Compare April 28, 2026 14:03
@alt-romes alt-romes changed the title WIP (#233) Add test described by #233 Apr 28, 2026
Checks that the bindings imported from other modules at a specific
breakpoint can be used when stopped there, with the same qualified
names. E.g. `sort` and `nub` are imported, and `Map.lookup` works where
`Map` is imported `qualified as Map` at the module in which we break.

A second one tests that continuing from a breakpoint that has `Map` in
scope, and stopping at a breakpoint which doesn't, then `Map` should no
longer be available in scope. This one is currently failing. The
evaluation succeeds somehow.

Fixes #233
@alt-romes alt-romes force-pushed the fix/233-imported-modules-repl-test branch from 2b638b4 to 569babf Compare April 28, 2026 14:13
@alt-romes alt-romes merged commit 96e920b into master Apr 28, 2026
5 checks passed
@alt-romes

Copy link
Copy Markdown
Collaborator Author

I created #299 as a follow up

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.

1 participant