the-carlisle-group / Acre-Desktop

A simple Dyalog APL IDE plugin that introduces "projects" and allows you to keep your source code in Unicode text files.
MIT License
11 stars 1 forks source link

Editor callbacks in Dyalog v18.0 #220

Closed PhilLast closed 4 years ago

PhilLast commented 4 years ago

fao @PaulMansour

The specific symptoms of a problem Kai encountered reminded me that for several months now acre in Dyalog v18.0 has been using Adam's experimental "interface" to the Fix and AfterFix events.

Prior to this and continuing in all below v18.0, acre assigns the callbacks directly to the Event property of an object being the result of ⎕SE.⎕WG 'Editor'.

Therefore only one client can use the events.

To mitigate this acre passes the callbacks' arguments to SALT's callbacks if it can't handle the item itself.

What Adam has done is to change the default callbacks to the events such that if a namespace called "⎕SE.Dyalog.Hooks" exists containing vars "Fix" and "AfterFix" then they are proxy lists of callbacks to be called for each of a number of clients.

At present this is still experimental; there is no convenient interface to the vars; and they have to be set or extended by each client by direct assignment. It's expected that this will be remedied before v18.0 public release. At that time it's likely that acre in v18.0 will either cease to work or to handshake with SALT. I don't envisage a great deal of work to incorporate the changes, whatever they are, but it will almost certainly require some.

 version < 18.0                 version ≥ 18.0                       

  ┌───────┐                          ┌───────┐               
  │ Event │                          │ Event │               
  └───┬───┘                          └───┬───┘               
      │                                  │                   
   ┌──┴───┐   ┌──────┐               ┌───┴───┐               
   │ acre ├─?─┤ SALT │               │ Hooks │               
   └──────┘   └──────┘               └───┬───┘               
                                         │                   
                             ┌───────────┼──────────┐        
                             │           │          │        
                        ┌────┴───┐  ┌────┴───┐  ┌───┴────┐   
                        │ client │  │ client │  │ client │   
                        └────────┘  └────────┘  └────────┘   
PhilLast commented 4 years ago

see #222