|
|
|
|
|
Re: Modifying a file that's not open in an editor? [message #865444 is a reply to message #865169] |
Mon, 30 April 2012 11:55 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Stephan,
please file a ticket. IModificationContext#getXtextDocument could work
with the plain IXtextDocument and use the IDocumentProvider to save the
changes.
You may want to customize the
org.eclipse.xtext.ui.editor.model.edit.IssueModificationContext.Factory
to achieve that for your language.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 30.04.12 11:13, schrieb Stephan Herrmann:
> Thanks for suggestions.
>
> Christian Dietrich wrote on Fri, 27 April 2012 21:48
>> Hi,
>>
>> what about letting Xtext opening the editor for you by calling
>> org.eclipse.xtext.ui.editor.model.edit.IModificationContext.getXtextDocument(URI)
>>
>>
>> ~Christian
>
>
> This seems to be the one closest to what I want to do, great.
>
> One caveat: it seems the URI must be a platform URI, classpath: doesn't
> work (might be worth documenting in API doc :)
>
> Actually opening editors for secondary files is tolerable in my case
> since normally only one additional file is affected. However, if a quick
> fix should affect more files opening all these might become an issue.
>
> Especially when I start implementing refactorings I don't want to open
> all affected files in editors.
> Is there any other API for rewriting that does not depend on an editor?
> Anything similar to JDT's ASTRewrite? (I wouldn't want to go back to
> serializing entire files because the layout of the source code must be
> preserved as much as possible.)
>
> thanks,
> Stephan
|
|
|
|
|
|
|
Re: Modifying a file that's not open in an editor? [message #865931 is a reply to message #865886] |
Mon, 30 April 2012 16:52 |
|
Hi,
it is hard to give advice since i did not leverage the rename refactoring myself. but it is there. you can use it out of the box. no quickfix, no menu action. for everything else you have to dig into the code yourself i fear. use the package org.eclipse.xtext.ui.refactoring and its subpackages in the org.eclipse.xtext.ui plugin as starting point
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.02373 seconds