Skip to content

File / New File... Business Process Intersystems Objectscript -selection doesn't create directory path automatically #1535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mtaitton opened this issue Apr 17, 2025 · 5 comments · May be fixed by #1545

Comments

@mtaitton
Copy link

Tried the following in VSCode with ObjectScript extension version 3.0.1:

  1. File / New File...
  2. Chose Business Process Intersystems Objectscript
  3. Entered class name eg. Test.Process.TestClass

VSCode opened a dialog to save the class file (TestClass.cls) in some previous directory.

In version 2.12.10 VSCode creates the following directories under the workspace folder: src\Test\Process\TestClass. Also the class file (TestClass.cls) was created automatically. No save dialog was opened.

@isc-bsaviano
Copy link
Contributor

@mtaitton This was a deliberate change. Version 2.x had a ton of functionality that depended on the objectscript.export settings, but was unrelated to exporting and the dependency wasn't documented. In this case, I still use the objectscript.export settings to generate the default URI, but instead of using that without the user's consent, I open a save dialog to confirm and allow them to pick a different location. The save dialog must not display nicely when the URI contains subdirectories that don't exist yet. I think that having a save dialog is reasonable; VS Code itself will prompt you for it if you try to save an untitled new file, which is essentially what this command is doing.

@isc-bsaviano
Copy link
Contributor

@mtaitton Did my answer explain the change sufficiently?

@mtaitton
Copy link
Author

mtaitton commented May 2, 2025

@isc-bsaviano Not really fond of this change. I downgraded InterSystems ObjectScript to version 2.12.10.

@isc-bsaviano
Copy link
Contributor

@mtaitton I understand your frustration, but sticking on an old version is not a good long-term plan. I'm planning on doing a new release of this extension soon, and I'd like to include a change that I think addresses your frustration:

  • Generate the URI using the export settings.
  • Show a prompt with that URI asking the user to confirm it's ok.
  • If they confirm, save the file right away without showing a save dialog. This will create the file the same way that 2.x did, including creating intermediate directories.
  • If they request a different URI, show the save dialog. This is the new 3.x behavior.

With this change, the only delta between 2.x and 3.x is that you'll have to answer a prompt before the file is written. I think this is a fair tradeoff between the convenience of the 2.x behavior and the transparency of the 3.x behavior.

@isc-bsaviano
Copy link
Contributor

@mtaitton If you want to test my changes in the linked PR you can install the VSIX in the zip found here:

vscode-objectscript-3.0.2-dev.1545.vsix.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants