Ticket #109 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Completion with choice modifiers

Reported by: boris Owned by: boris
Priority: major Milestone:
Version: Keywords: completion
Cc:

Description

Currently function completeWord receives a function to produce a list of possible completions and passes it a word which should be completed. The function does not know about other user input.

For example, if user entered ":m - Data.Lis" and " -" are in list of characters which count as whitespaces, the function which suggests completion will receive only "Data.Lis".

I want to pass modifiers(a bad term, perhaps) to the function as well. The modifier is a single optional character before word.

Use case: If function in ghci knows that modules will be removed, it will be more convenient if it suggests only modules which have already been added to the context.

I have written the function completeWordWithModifier and based already present completeWord on it. The behavior of completeWord was not modified. The modified file Completion.hs is attached.

Attachments

Completion.hs (7.5 kB) - added by boris 4 years ago.

Change History

Changed 4 years ago by boris

Changed 4 years ago by judah

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

Resolved with the following patch:

Mon Aug 16 21:46:09 PDT 2010  Judah Jacobson <judah.jacobson@gmail.com>
  * #109: Add function completeWordWithWithPrev.

Thanks again for your suggestion and help! It should be fine to send the GHC developers an updated patch for :m now, rather than waiting for 0.6.3 to be released. They've already been using Haskeline's HEAD for their local repo (though they'll need to pull this extra patch), and I plan to release haskeline-0.6.3 well before ghc-6.14.1 is done.

Note: See TracTickets for help on using tickets.