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

LSP4E context menu Format action should not be allowed in read-only documents #1078

Open
rubenporras opened this issue Aug 23, 2024 · 2 comments

Comments

@rubenporras
Copy link
Contributor

rubenporras commented Aug 23, 2024

Currently, if you open a read-only file and try to perform any of the Format action, the contents of the file will appear to change.

Note that it is not possible to save the file with these modifications.

Nevertheless, it should not be possible to apply commenting to a read-only document, even just at the UI level, if the document is read only, the menu item should be disabled, as for the delete/copy actions in the screenshot.

image-2024-08-13-15-37-13-332

Probably same problem and same pattern for the fix as in eclipse-tm4e/tm4e#789

@sebthom
Copy link
Contributor

sebthom commented Aug 23, 2024

If we just disable the menu the user does not know the reason. I think instead we should display the dialog you get when you try to manually modify a read-only file:
image

@rubenporras
Copy link
Contributor Author

I would prefer the greyed out behavior for TM4E, just because it is the same as for all of the menu items contributed by the editor (and I guess it is also easier to implement).

Regarding the dialog, thanks for the screenshot. I have never seen it :). I guess you can only have that dialog if you actually have the rights to make the file writable, or can it happen that you press "Yes" and it fails? That would not be a good user experience, otherwise I think it is a good idea but, if we plan to do the same for the items contributed by the editor (to me consistency is more important)

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

No branches or pull requests

2 participants