-
Notifications
You must be signed in to change notification settings - Fork 44
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
Preference store provider extension point #109
Preference store provider extension point #109
Conversation
Signed-off-by: azerr <[email protected]>
This PR is just a draft, because it depends from another PRs: It provides the capability to add custom IPreferenceStore in the store of the generic editor with a new extension point
<extension
point="org.eclipse.ui.genericeditor.preferenceStoreProviders">
<provider
class="org.eclipse.text.editorconfig.internal.EditorConfigPreferenceStoreProvider"
contentType="org.eclipse.core.runtime.text">
</provider>
</extension>
I have a POC to customize insert spaces for XML with UI preferences I use the new extension point like this:
|
@mickaelistria I know we disccus about using adapter factory for .editorconfig, but insert spaces / tab width for WWD becomes a priority I think and after a long investigation with this topic, I can manage all usescases:
The API is not linked to an editor or source viewer, just with IResource that it is requires for .editorconfig (give me the preference store of the given resource, so the preference store could not be linked to an editor, just a resource file): package org.eclipse.core.resources.proposed;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.preference.IPreferenceStore;
public interface IPreferenceStoreProvider {
IPreferenceStore getPreferenceStore(IResource resource);
} In the case of .editorconfig, I need to work with editor to retrieve the preference store and update it fire property declared in .editorconfig and update the editor with proper insert spaces / tab widh See the following demo: To access to the editor, I return an instance of IPreferenceStore which implements ITextEditorAware in order to the extension point inject the instance of the generic editor. I create the API in #108 |
I think this PR (which includes other PRs that I did) is very important for WWD specialy this issue eclipse-wildwebdeveloper/wildwebdeveloper#872 There are more and more users who complain that they cannot configure spaces / tabs for XML, HTML, etc although they could do that with Eclipse WTP and my fear is that users will start hating WWD because of missing preferences. WWD with Generic Editor is so powerfull, combined with TM4e, LSP4e, and can provide the same features than other custom editor, but the custom preferences in Generic Editor is not possible and for a given editor I think it is very important to have the capability to customize it like insert spaces. Once preference store provider for generic editor will be available, It will open the door for many features to customize the generic editor like
I know that @mickaelistria is very busy, so I wonder if some other people could help me to review some PRs to provide step by step this preference store provider extension point. Thanks for your help. |
Close for #130 |
Preference store provider extension point
Signed-off-by: azerr [email protected]