Ticket #1468 (closed merge: fixed)

Opened 6 years ago

Last modified 4 years ago

:browse should browse currently loaded module

Reported by: iampure@… Owned by: igloo
Priority: normal Milestone: 6.8.1
Component: GHCi Version: 6.6.1
Keywords: Cc: josef.svenningsson@…, ndmitchell@…, iampure@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

With module Foo loaded, :browse should be equivalent to :browse Foo.

Attachments

cmds.ghci Download (1.0 KB) - added by claus 6 years ago.
example .ghci file implementation

Change History

Changed 6 years ago by josef

  • cc josef.svenningsson@… added

Changed 6 years ago by neil

  • cc ndmitchell@… added

Changed 6 years ago by guest

  • cc iampure@… added

Changed 6 years ago by igloo

  • milestone set to 6.8

Good idea. The only slight niggle is that you can have multiple modules loaded (e.g. :m + System.Cmd System.Exit). I don't know if this issue comes up for any other commands, but if not we could just use the first or the last in the list of loaded modules or something.

Changed 6 years ago by claus

starting somewhere in 6.7, you can define something like that yourself. the trick is to have a :redir command that allows you to capture ghci command output. then you simply do :show modules, capture the output, and grab one of the modules listed there for :browse.

add the attached cmds.ghci to your .ghci, or source it with :cmd readFile "cmds.ghci". then, :b <mod> will call :browse <mod>, and just :b will call :browse on the first module listed in :show modules. adapt the code to your needs.

there is a patch pending for ghc head that will allow us to avoid having to compress ghci definitions into single lines, which will make things like this a lot more readable and maintainable..

Changed 6 years ago by claus

example .ghci file implementation

Changed 6 years ago by simonmar

  • owner set to igloo
  • priority changed from low to normal
  • type changed from feature request to merge

Done:

Fri Oct 19 04:57:51 PDT 2007  Simon Marlow <simonmar@microsoft.com>
  * implement #1468, :browse on its own uses the currently-loaded module
Fri Oct 19 05:32:14 PDT 2007  Simon Marlow <simonmar@microsoft.com>
  * add test for #1468

Changed 6 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

First merged; second is in the shared testsuite, so no merge needed.

Changed 6 years ago by igloo

  • milestone changed from 6.8 branch to 6.8.1

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.