| Summary: | [serializer] error in DefaultLinkingService#getLinkText() | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Knut Wannheden <knut.wannheden> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | moritz.eysholdt, stephane, sven.efftinge |
| Version: | 0.7.1 | Flags: | sven.efftinge:
helios+
|
| Target Milestone: | M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Knut Wannheden
There is the same problem in content assist: See AbstractJavaBasedContentProposalProvider.DefaultProposalCreator#apply(IScopedElement). I think it would be better to allow the definition of a link text <-> parse text conversion than a link text <-> datatype object conversion. Should this conversion be the responsibility of the linking service or a new service? The alternative simpler approach probably *also* needs to be implemented. At least as getLinkText() is used by the serializer. Otherwise the link text won't be preserved if it isn't the "default" link text (i.e. name of first scoped element in the scope corresponding to the given object). Any thoughts on this? The if LinkingServerice.getLinkText() would return a datatype (instead of text), the serializer could use the ValueConverter to create the textual representation. In case the cross reference is unresolved, this would shift the responsibility to reconstruct the textual representation from the node model from the LinkingService to the ValueConverter. (In reply to comment #2) > The if LinkingServerice.getLinkText() would return a datatype (instead of > text), the serializer could use the ValueConverter to create the textual > representation. > This would require the LinkingService to apply a link text -> datatype conversion. This is typically not the same as the parse text -> datatype conversion performed by the ValueConverter (e.g. an ID may have a leading caret as parse text, but not as link text). > In case the cross reference is unresolved, this would shift the responsibility > to reconstruct the textual representation from the node model from the > LinkingService to the ValueConverter. > I don't quite see how unresolved cross references are different. If the LinkingService is to return a datatype, as you suggest, it would have to apply ValueConverter#toValue() on the node model (which then must exist). However, also for resolved cross references I think the LinkingService should first try to extract the link text from the node model, as this result may differ from what the ScopeProvider yields. Reported problem with preservation of "default" link text (see comment #1) as bug #287813. This bug now only covers the problem with the conversion between parse text and link text. In cross references it is no longer allowed to use other than EString returning rules. Closing bug which were set to RESOLVED before Eclipse Neon.0. |