unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.81k stars 271 forks source link

foldless edit doesn't handle numbered arg inputs correctly #5435

Closed ceedubs closed 3 weeks ago

ceedubs commented 3 weeks ago

Describe and demonstrate the bug

@cloud/nimbus/structured-interruption> dependents remote.run                                                           

  Dependents of: remote.run                                                                                            

    Terms:                                                                                                             

    1. handleIncomingConnection                                                                                        
    2. handleIncomingRequest                                                                                           
    3. handleIncomingWsForkRequest                                                                                     
    4. handleServiceHttpRequest                                                                                        
    5. README                                                                                                          
    6. toWS                                                                                                            
    7. updateAll                                                                                                       

  Tip: Try `view 7` to see the source of any numbered item in the above list.                                          

InputPattern: 3.78 ms (cpu), 5.33 ms (system)                                                                          
@cloud/nimbus/structured-interruption> edit 1-7                                                                        
@cloud/nimbus/structured-interruption> edit handleIncomingConnection handleIncomingRequest handleIncomingWsForkRequest handleServiceHttpRequest README toWS updateAll                                                                         

  ☝️                                                                                                                    

  I added 0 definitions to the top of /home/unison/code/unison/nimbus-structured-interrupts.u                          

  You can edit them there, then run `update` to replace the definitions currently in this
  namespace.

If I do the same with edit.new (which is actually the old edit???) it works fine:

@cloud/nimbus/structured-interruption> edit.new 1-7
@cloud/nimbus/structured-interruption> edit.new handleIncomingConnection handleIncomingRequest handleIncomingWsForkRequest handleServiceHttpRequest README toWS updateAll

  ☝️

  I added 7 definitions to the top of /home/unison/code/unison/nimbus-structured-interrupts.u

  You can edit them there, then run `update` to replace the definitions currently in this
  namespace.

Environment (please complete the following information):

ceedubs commented 3 weeks ago

Oops I think that this was user error. I didn't realize that edit no longer adds definitions to the scratch file if they are already there.