Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [xtext 2] Is Refactoring available in Indigo M6?
[xtext 2] Is Refactoring available in Indigo M6? [message #663341] Mon, 04 April 2011 13:16 Go to next message
Eclipse UserFriend
Greetings,

I attended EclipseCon and during the Xtext session (which BTW, was the best in the conference) Sven mentioned that Xtext supports refactoring.

I'm working with Indigo M6 and I've been looking around and I haven't found any trace of refactoring (maybe I'm looking at the wrong place.)

Is Refactoring part of M6 or is it coming with M7?

Many thanks in advance,
-Alex
Re: [xtext 2] Is Refactoring available in Indigo M6? [message #663359 is a reply to message #663341] Mon, 04 April 2011 14:57 Go to previous messageGo to next message
Eclipse UserFriend
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 {}
...
Re: [xtext 2] Is Refactoring available in Indigo M6? [message #663444 is a reply to message #663359] Tue, 05 April 2011 02:46 Go to previous messageGo to next message
Eclipse UserFriend
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 {}
> ..
Re: [xtext 2] Is Refactoring available in Indigo M6? [message #663708 is a reply to message #663444] Wed, 06 April 2011 05:13 Go to previous message
Eclipse UserFriend
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
Previous Topic:Xtext 2.0: rename refactoring - how to update non-xtext resources
Next Topic:Re: [Xtext2] Extending Xbase expressions
Goto Forum:
  


Current Time: Sun Jul 06 13:37:03 EDT 2025

Powered by FUDForum. Page generated in 0.04688 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top