Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 17:16 Go to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
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 18:57 Go to previous messageGo to next message
Maxim Frolov is currently offline Maxim FrolovFriend
Messages: 20
Registered: March 2010
Location: Aachen
Junior Member
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 06:46 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7670
Registered: July 2009
Senior Member
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 09:13 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
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
Previous Topic:Xtext 2.0: rename refactoring - how to update non-xtext resources
Next Topic:Re: [Xtext2] Extending Xbase expressions
Goto Forum:
  


Current Time: Tue Sep 24 14:29:07 GMT 2024

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

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

Back to the top