Currently, if you open a read-only file and try to perform any of the comment actions (Toggle Line Comment, Add Block Comment, Remove Block Comment), 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 items should be disabled, as for the delete/copy actions in the screenshot.
Currently, if you open a read-only file and try to perform any of the comment actions (Toggle Line Comment, Add Block Comment, Remove Block Comment), 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 items should be disabled, as for the delete/copy actions in the screenshot.
Probably same problem and same pattern for the fix as in https://github.com/eclipse/lsp4e/issues/1078