intersystems-community / vscode-objectscript

InterSystems ObjectScript extension for Visual Studio Code
https://docs.intersystems.com/components/csp/docbook/DocBook.UI.Page.cls?KEY=GVSCO
Other
106 stars 48 forks source link

Set file readonly if class is deployed or if server-side source control reports it not editable #1399

Closed gjsjohnmurray closed 2 months ago

gjsjohnmurray commented 2 months ago

This PR closes #1397

In some circumstances the current VS Code (1.91.1) doesn't correctly switch an editor to be readonly. My PR https://github.com/microsoft/vscode/pull/221023 will resolve this. Meanwhile I am creating this PR as a Draft.

gjsjohnmurray commented 2 months ago

Set as ready so a testable VSIX gets built.

isc-bsaviano commented 2 months ago

Thanks for making those changes

isc-bsaviano commented 2 months ago

Should I wait until that linked Pull Request is merged before I test/approve this?

gjsjohnmurray commented 2 months ago

The issue the linked PR fixes is only likely to affect how this new feature behaves with Deltanji's server-side source control class, because of how when we cancel a checkout we reset the mtime of the document to that of the reinstated version.

Please go ahead and review it.

isc-bsaviano commented 2 months ago

@gjsjohnmurray I installed the dev VSIX and it appears to work as designed. However, the new setting is showing up as an "unknown configuration setting" in the JSON and doesn't appear in the UI. The setting is respected if it's manually added to the JSON though. Also, you don't need to add the explicit default values for the boolean settings within objectscript.export because the parent object has a default configured:

https://github.com/intersystems-community/vscode-objectscript/blob/c426c7a039b9de9185417d61b766e8109c7d68cd/package.json#L1334-L1347

gjsjohnmurray commented 2 months ago

I pushed a change to remove those defaults.

As for the settings problem, I haven't been able to reproduce this. The setting displays for me in Settings Editor, and when present in JSON it's not marked / tipped as having a problem.