Home » Modeling » TMF (Xtext) » [Xtext 2.0] Bug in PreferenceStoreAccessImpl?
[Xtext 2.0] Bug in PreferenceStoreAccessImpl? [message #677526] |
Wed, 08 June 2011 18:20 |
Alex Ruiz Messages: 103 Registered: March 2011 |
Senior Member |
|
|
Greetings,
(Before posting this question, I did search for an existing bug in the bug database, but I didn't find anything)
I'm trying to fix a bug in my Xtext 2-based editor. When changing preferences for a particular project, the changes get saved to all the projects in the workspace.
After some debugging, I think the problem is in PreferenceStoreAccessImpl, in the method getWritablePreferenceStore(Object), line 59:
public IPreferenceStore getWritablePreferenceStore(Object context) {
lazyInitialize();
if (context instanceof IFileEditorInput) {
context = ((IFileEditorInput) context).getFile().getProject();
}
if (context instanceof IProject) {
ProjectScope projectScope = new ProjectScope((IProject) context);
ScopedPreferenceStore result = new ScopedPreferenceStore(projectScope, getQualifier());
result.setSearchContexts(new IScopeContext[] {
projectScope,
new InstanceScope(),
new ConfigurationScope()
});
}
return getWritablePreferenceStore();
}
when the context is a IProject, this method creates a ScopedPreferenceStore using the passed IProject as one of the scopes. I think the problem is, the created ScopedPreferenceStore is never returned, instead, this method always returns the one from getWritablePreferenceStore().
I'm so sorry that at this point I can't confirm this bug (by actually changing Xtext's code and running my project again.) Does anybody know if this is a known bug?
Many thanks in advance,
-Alex
|
|
|
(no subject) [message #677569 is a reply to message #677526] |
Wed, 08 June 2011 18:57 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Alex,
this is not a know bug. Please file a ticket. Thanks.
Workaround: Bind your own subtype of PreferenceStoreAccessImpl for your
language.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 08.06.11 20:20, schrieb Alex Ruiz:
> Greetings,
>
> (Before posting this question, I did search for an existing bug in the
> bug database, but I didn't find anything)
>
> I'm trying to fix a bug in my Xtext 2-based editor. When changing
> preferences for a particular project, the changes get saved to all the
> projects in the workspace.
>
> After some debugging, I think the problem is in
> PreferenceStoreAccessImpl, in the method
> getWritablePreferenceStore(Object), line 59:
>
>
> public IPreferenceStore getWritablePreferenceStore(Object context) {
> lazyInitialize();
> if (context instanceof IFileEditorInput) {
> context = ((IFileEditorInput) context).getFile().getProject();
> }
> if (context instanceof IProject) {
> ProjectScope projectScope = new ProjectScope((IProject) context);
> ScopedPreferenceStore result = new ScopedPreferenceStore(projectScope,
> getQualifier());
> result.setSearchContexts(new IScopeContext[] {
> projectScope,
> new InstanceScope(),
> new ConfigurationScope()
> });
> }
> return getWritablePreferenceStore();
> }
>
>
> when the context is a IProject, this method creates a
> ScopedPreferenceStore using the passed IProject as one of the scopes. I
> think the problem is, the created ScopedPreferenceStore is never
> returned, instead, this method always returns the one from
> getWritablePreferenceStore().
>
> I'm so sorry that at this point I can't confirm this bug (by actually
> changing Xtext's code and running my project again.) Does anybody know
> if this is a known bug?
> Many thanks in advance,
> -Alex
|
|
| | | | |
Goto Forum:
Current Time: Fri Apr 19 20:33:02 GMT 2024
Powered by FUDForum. Page generated in 0.02747 seconds
|