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

OpenProject with rename errors loads namespace into []SE.SALT... #179

Closed norberturkiewicz closed 5 years ago

norberturkiewicz commented 5 years ago
 ⎕se.acreAPI.version''
 Acre  5.1.0+186  2019-05-13  20.45 
Booting C:\GitHub\CarlisleGroup\CAS7\start.dyapp
Please wait - Reading 9768 files from .../CarlisleGroup/CAS7/APLSource
Cannot rename file "C:/GitHub/CarlisleGroup/CAS7/APLSource/WIZ-7/TimeSeries-11/Step-1.aplf" to "C:/GitHub/CarlisleGroup/CA
      S7/APLSource/WIZ/TimeSeries/Step.aplf"
Cannot rename file "C:/GitHub/CarlisleGroup/CAS7/APLSource/WIZ-7/Shell-1/GetUsername-9.aplf" to "C:/GitHub/CarlisleGroup/C
      AS7/APLSource/WIZ/Shell/GetUsername.aplf"
Cannot rename file "C:/GitHub/CarlisleGroup/CAS7/APLSource/WIZ-7/Sampling-1/RANDOM-3f.aplf" to "C:/GitHub/CarlisleGroup/CA
      S7/APLSource/WIZ/Sampling/RANDOM.aplf"
...
...
...
      PLSource/CASHFLOW/MTG/PV.aplf"
Cannot rename file "C:/GitHub/CarlisleGroup/CAS7/APLSource/CASHFLOW-ff/DOHR-f/USER-f/YIELD-1f.aplf" to "C:/GitHub/Carlisle
      Group/CAS7/APLSource/CASHFLOW/DOHR/USER/YIELD.aplf"
Cannot rename file "C:/GitHub/CarlisleGroup/CAS7/APLSource/CAS3-7/EXPLORER-ff/RTVITEM-7f.aplf" to "C:/GitHub/CarlisleGroup
      /CAS7/APLSource/CAS3/EXPLORER/RTVITEM.aplf"
Cannot rename file "C:/GitHub/CarlisleGroup/CAS7/APLSource/CAS3-7/EXPLORER-ff/UNIQUENAME-3ff.aplf" to "C:/GitHub/CarlisleG
      roup/CAS7/APLSource/CAS3/EXPLORER/UNIQUENAME.aplf"
⎕SE.SALT.CAS7
PhilLast commented 5 years ago

I have a very old version of CAS7 but can't find (probably lack access to) it on GitHub to replace with the latest that might display the errors you describe.

norberturkiewicz commented 5 years ago

@PhilLast I made you a collaborator.

PhilLast commented 5 years ago

Having failed to read the config file acre computes the target as the name of the project folder.

I can't remember why at present and will have to test the difference if it's removed but this is then prefixed by the location from which the ]openproject command was called, in this case presumably ⎕SE.SALT.

This technique is used successfully in various item commands such as ]erase so that an item can be entered as other than an FQN if the user is in the project space when that location is prefixed.

PhilLast commented 5 years ago

Here is the reason for the current behaviour:

      ]openproject project #.space 
Please wait - Reading 4 files from .../acre4projects/project/APLSource
#.space
      '#.TOP'⎕NS''
      )CS #.TOP
#.TOP
      ]openproject project space 
Please wait - Reading 4 files from .../acre4projects/project/APLSource
#.TOP.space

If the supplied project space is not already prefixed with "#." acre prefixes it with the calling space which is normally or likely to be "#." anyway. The examples above demonstrate that this is a not unreasonable outcome. Problems arise when no project space is supplied either by the config file or the argument and it defaults to the folder name which is unlikely to begin with "#." and need not even be a valid APL name. Also as in this issue where the command is called from within ⎕SE.

The code will be changed to use only "#." rather than the current space in those situations described. I can't be sure but nor can I imagine any situation where this change could cause any undesired change in behaviour.

And where an error occurs in reading an existing config file acre will signal out immediately rather than behaving as though the file didn't exist and thus compounding the problem.

norberturkiewicz commented 5 years ago

@PhilLast I agree with the error signal if the config file fails. Now that we've worked with Acre-Desktop 4 for a while, I'm more inclined to omit automatic failover behavior when settings are invalid or missing and not optional. Also. I agree that hash should be the default parent for all projects without an explicit root namespace.