-
Notifications
You must be signed in to change notification settings - Fork 28
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
enhanced xpect editor override feature #354
enhanced xpect editor override feature #354
Conversation
@iloveeclipse can you please review this functionality and code whise.... |
OK, I checked the functionality, works as expected. |
Composite disableOverrideComposite = new Composite(group, SWT.NONE); | ||
GridLayoutFactory.fillDefaults().margins(5, 5).applyTo(disableOverrideComposite); | ||
GridDataFactory.fillDefaults().grab(true, false).applyTo(disableOverrideComposite); | ||
addField(new BooleanFieldEditor(DISABLE_EDITOR_OVERRIDE_PREFERENCE_NAME, "Disable editor override.", SWT.NONE, disableOverrideComposite)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the full stop symbol here, its unusual to see it in a preference page.
Composite skipFileExtListComposite = new Composite(group, SWT.NONE); | ||
GridLayoutFactory.fillDefaults().margins(5, 5).applyTo(skipFileExtListComposite); | ||
GridDataFactory.fillDefaults().grab(true, false).applyTo(skipFileExtListComposite); | ||
addField(new SkipFileExtensionList(LIVE_TEST_EXECUTION_PREFERENCE_NAME, "Skip content check for XPECT for extensions (will not be used if override is disabled):", skipFileExtListComposite)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can skip the "will not be used if override is disabled", there is an overlap of the 2 preferences but I doubt the user cares.
Maybe you can disable the entire group with the settings per preference, if the checkbox for the global disable is ticket. A nice to have though, I don't think we need much fancy UI work here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Skip content check for XPECT for extensions" doesn't seem like optimal wording.
"Disable Xpect editor override for the following file extensions"? Not ideal but maybe better.
Would not hurt to explain what the editor override is, maybe with a hint hover... But again I don't think we need to invest much UI effort here. In the end its unlikely most users are aware the editor override even exists. Though that is a good reason to add an explanation...
Thank you for merging Christian, but please wait a bit for reviews. |
@trancexpress sry. follow up pr is welcome |
All involved: I wonder why do we have provided ability to skip the override for some file types but not the ability to enable override for some types? Background: we have a fixed set of Xpect language related file extensions and an open set of all other file types. For me, it makes more sense to restrict the list to the fixed known set of file types, as the set will not change/grow in same way as the unlimited set of all possible file types that shouldn't be touched fy Xpect at all. |
Sounds fine to me. Should be simple to reverse the logic? |
you mean by extending the extension point(s)? |
I mean the code So we added a check for files that we don't want to handle with Xpect before. Fine: Xpect/org.eclipse.xpect.ui/src/org/eclipse/xpect/ui/editor/XpectEditorAssociationOverride.java Lines 79 to 85 in b37f5dd
Instead (or additionally) we could add check if the file in the list of "known" Xpect files, because this is a smaller & fixed set, something like:
|
i am not sure what side effects that would have and what a this is why i pointed to the extension point. that registers file extensions to xpect. |
Same was we populate The The product has 10 "Xpect" file types, IDE has zero. |
The Extension point is not usable, because the file extensions are necessary in the IDE where the DSL (and of course its tests) is/are developed, that's why I've introduced the new settings in the preferences page. But I am ok with the idea that we should reverse the logic. To not break anything else we should disable this by default. |
Added the ability to disable editor override at all or exclude override by extension.