|
Re: Xtext formatting and scoping with external functions? [message #653552 is a reply to message #653505] |
Thu, 10 February 2011 08:49 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
Orthodox counterquestion: If the generated services work out-of-the-box,
why not use them ? ;-) As opposed to your approach, these will
automatically sync with changes in the language.
As far s the formatter is concerned, I guess it is easier to hook it
into the UI as a formatting action (operating on the text only) without
adapting it to Xtext's API, which is quite specific to the needs of
Xtext. That only works if you're not depending on semantic changes being
(selectively) serialized, e.g. semantic quickfixes or the upcoming
refactoring.
Your second question: Sounds like you could hook that into the
ILocationInFileProvider, at least partially. But I'd expect the generic
Xtext version to be working out-of-the-box.
Am 10.02.11 02:56, schrieb Jon Riecke:
> Two possibly heretical questions:
>
> 1. Suppose I have an existing Java function for formatting that, given a
> string, returns a formatted string. Can I hook that function into Xtext
> instead of using the Formatting API?
>
> 2. Suppose I have an existing Java function that, given a position in a
> string representing a name, returns the file and position of the
> definition of the name. Can I hook that function into Xtext instead of
> using the ScopeProvider API?
>
> It's not that I dislike the infrastructure provided by Xtext---far from
> it! But I already have these functions, and would like to use them
> instead of reimplementing them and keeping them in sync with the
> versions using the Xtext API.
>
> Thanks,
> -Jon
--
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.03269 seconds