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

YEdit Format command removes YAML comments: fix or disable auto-format #99

Closed
tedepstein opened this issue Feb 14, 2016 · 8 comments
Closed

Comments

@tedepstein
Copy link
Collaborator

As reported here, auto-format in YEdit removes all YAML comments from the source file, without warning:

oyse/yedit#15

IMO, YAML comments are important, and we should disable auto-format until we can fix this bug.

@tfesenko
Copy link
Member

@tedepstein , can you please clarify what is expected from the fix?
To me. "Auto-Format" sounds like an action which happens automatically, which is not explicitly invoked by the user. I don't see that format is invoked automatically.

If I manually call formatting the the comments are removed as noted in the issue.
Should I remove the action from the context menu and possibly other entries in UI, and also remove a key binding?

@tedepstein
Copy link
Collaborator Author

I meant manually invoked formatting. We should remove the shortcut key binding (normally ctrl+shift+f on Windows), and the context menu item. If you find other UI entries, you should probably remove those too.

@tfesenko
Copy link
Member

The good news is that it's always "Ctrl+Shift+F", even on Mac where it should be "CMD+shift-F".
The regular key binding for code formatting does not do anything in YEdit on Mac

@tedepstein tedepstein changed the title YEdit Auto-Format removes YAML comments: fix or disable auto-format YEdit Format command removes YAML comments: fix or disable auto-format Feb 19, 2016
@tedepstein
Copy link
Collaborator Author

@tfesenko , we fixed this in API Studio.
https://github.com/ModelSolv/RepreZen/pull/873/files

Can the same fix be applied here?

@tfesenko
Copy link
Member

tfesenko commented Mar 8, 2016

@tedepstein asked:

we fixed this in API Studio. Can the same fix be applied here?

We fixed in by overriding preferences in our RCP application so the key binding is disabled. We can't apply the same fix as is, but we can think of variations, e.g. create a SwagEdit perspective and change preferences when the user switches to our perspective.

Another approach is to contact YEdit and see if we can ask them to disable the action by default (I don't know if they will be thrilled to do it though).

The users can manually disable the binding too. We can add this issue and a step-by-step solution to our documentation.

@tedepstein
Copy link
Collaborator Author

The users can manually disable the binding too. We can add this issue and a step-by-step solution to our documentation.

I think that's the best approach for now. If you can please write up a short paragraph or two in the Readme, I'll review.

@tfesenko
Copy link
Member

tfesenko commented Mar 8, 2016

@tedepstein , I added a description how to disable the key binding to https://github.com/RepreZen/SwagEdit/blob/master/README.md#troubleshooting
yedit_disableformat

@tedepstein
Copy link
Collaborator Author

@tfesenko , your screenshot and additions to the README look good. I think this is "fixed", to the extent we're able to address the issue in the SwagEdit context. Not much more we can do now, therefore closing. Please reopen if you think I've missed anything.

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

No branches or pull requests

2 participants