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

Add "Init" function call to acre config #108

Closed aplteam closed 6 years ago

aplteam commented 6 years ago

We already have a kind of ⎕LX function in acre. That function is executed after acre has done its job.

I am proposing an additional Init. If that is found in the acre config file it should be executed before acre does anything in terms of opening a project,

That would allow to load stuff, for example via a packet manager, the project to be opened depends on, It might be a useful feature for other purposes as well.

PhilLast commented 6 years ago

Initial thoughts: Obviously what I'm describing is the way acre happens to be at 2018-07-25 10.04 and none of it is set in stone.

  1. checks that the path leads to a project, sets up the project data space (not the project space), and reads in and evaluates the config file if it exists.
  2. checks that the project is not to be tracked inside another tracked project.
  3. opens the project dependencies.
  4. checks that none of the dependencies has usurped the target project space.
  5. creates the project space and loads the project code.
  6. executes startup in the project space if the project is to be tracked and is the top level project opened by ⎕SE.UCMD rather than as a dependency of another project.

init could not be executed before 0. Were it executed any time before 3 there is still a chance that acre could give up at a later stage.

At what point do you imagine before acre does anything in terms of opening a project?

Would init be executed conditionally with the same provisos as startup?

In what way would this differ from enhancing the dependency code to recognise "packages" vs "projects" along lines proposed by @PaulMansour and @e9gille?

e9gille commented 6 years ago

That would allow to load stuff, for example via a packet manager, the project to be opened depends on, It might be a useful feature for other purposes as well.

Package dependencies must be resolved upfront before Acre loads anything. Given a project that defines its dependencies in a metadata file, the package manager is asked to build up a dependency tree and download any missing dependencies. Acre is then used to load the code into the active workspace. I don't think the feature you are requesting is required for package support.

aplteam commented 6 years ago

I was intrigued by the idea to have that Init function available which would allow me to do it one way now and a different way later.

However, I realize that I can execute as well my own user command ]foo doing als the prep upfront and then call ]acre.OpenProject, therefore I withdraw my request,