Skip to content
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

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

Merged

Conversation

gjsjohnmurray
Copy link
Contributor

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 microsoft/vscode#221023 will resolve this. Meanwhile I am creating this PR as a Draft.

package.json Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/providers/FileSystemProvider/FileSystemProvider.ts Outdated Show resolved Hide resolved
src/providers/FileSystemProvider/FileSystemProvider.ts Outdated Show resolved Hide resolved
@gjsjohnmurray gjsjohnmurray marked this pull request as ready for review July 12, 2024 13:59
@gjsjohnmurray
Copy link
Contributor Author

Set as ready so a testable VSIX gets built.

@isc-bsaviano
Copy link
Contributor

Thanks for making those changes

@isc-bsaviano
Copy link
Contributor

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

@gjsjohnmurray
Copy link
Contributor Author

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
Copy link
Contributor

@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:

"default": {
"folder": "src",
"addCategory": false,
"map": {},
"atelier": true,
"generated": false,
"filter": "",
"exactFilter": "",
"category": "*",
"noStorage": false,
"dontExportIfNoChanges": false,
"maxConcurrentConnections": 0,
"mapped": true
},

@gjsjohnmurray
Copy link
Contributor Author

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.

Copy link
Contributor

@isc-bsaviano isc-bsaviano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gjsjohnmurray I installed the latest dev vsix and everything looks good. Thanks for this PR!

@gjsjohnmurray gjsjohnmurray merged commit 54a0e43 into intersystems-community:master Jul 15, 2024
5 checks passed
@gjsjohnmurray gjsjohnmurray deleted the statReadonly branch July 15, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow server-side file to readonly if server-side source control class for namespace returns that status
2 participants