|
|
|
Re: [xtext 2] Is Refactoring available in Indigo M6? [message #663708 is a reply to message #663444] |
Wed, 06 April 2011 09:13 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
Hi Ed, hi Maxim
Xbase is not a pre-requisite for the refactoring support.
As the implementation is generic, the RefactorElementNameFragment only
produces plugin.xml entries to register. In the Domain Model example,
the generated classes provide support for the derived JVM model (the
Java view on the model, used for linking) and are produced by the
XbaseFragment.
Documentation will follow soon. Here are a few pointers
1) Enable rename refactoring by using the RefactorElementNameFragment.
Remember updating the plugin.xml manually.
2) Services you might want to customize:
IRenameStrategy: Performs the rename on the semantic level. Customize
e.g. if your names are not stored in a String EAttribute "name"
IDependentElementsCalculator: provides the elements whose names
depend on the renamed element, e.g. inner classes if the containing
class is renamed.
3) In order to update external references, the referring models (and
especially the references) must be indexed. See the Xtext docs on Scoping.
4) For references from non-Xtext resources, you have to bind an
EmfResourceReferenceUpdater by implementing an IResourceServiceProvider,
similar for what we do for Ecore.
Hope that helps you get started
Jan
Am 05.04.11 08:46, schrieb Ed Willink:
> Hi Maxim
>
> Thanks, that at least provides me with a working reference to debug
> against.
>
> [It's the Domain Model example]
>
> [It produces a Rename Element menu entry; perhaps Refactor->Rename is
> more extensible.]
>
> [It needs a launch config since the example is too big for default VM
> size.]
>
> Unfortunately it doesn't work for me. No ...ui.refactoring package is
> created.
>
> Is Xbase support perhaps a silent pre-requisite?
>
> Regards
>
> Ed Willink
>
>
> On 04/04/2011 19:57, Maxim Frolov wrote:
>> Look at: org.eclipse.xtext.ui.generator.refactoring.RefactorElementNa
>> meFragment
>> It's enabled in the workflow of the by Xtext example project:
>>
>> ..
>> // rename refactoring fragment =
>> refactoring.RefactorElementNameFragment {}
>> ..
>
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
Powered by
FUDForum. Page generated in 0.03866 seconds