racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
444 stars 93 forks source link

generalize `drracket:define-popup` to callbacks #621

Closed mflatt closed 1 year ago

mflatt commented 1 year ago

Predictably, having just a pair of symbol options is not configurable enough for the popup "define" menu. Remove the option symbols and instead support callback functions for the definition-finding and name-extracting tasks. Each callback receives the default implementation, in case it finds that helpful, and the former option symbols have turned into optional keyword arguments for the default definition-finding implementation.

Rhombus branch that uses the new protocol: https://github.com/mflatt/rhombus-prototype/tree/define-popup2, implementation in https://github.com/mflatt/rhombus-prototype/blob/define-popup2/rhombus/private/define-popup.rkt.

rfindler commented 1 year ago

Not having done any testing myself, I think this looks okay.

rfindler commented 1 year ago

I've pushed this to master -- one note: the guards added here are incorrect; they should be thunks, not just the default values.

Thanks!