eclipse-xtext / eclipse-xtext/xtext

ITransientValueService is non-API; documentation indicates the wrong ITransientValueService

Open
#2,553 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
831
Forks
330
Avg merge
3d 7h
Merged PRs (30d)
12

Description

If a user wishes to customize the decision whether or not a value is considered transient by the Xtext serializer, they can bind a custom ITransientValueService.

However, there are two different interfaces called ITransientValueService:

  1. org.eclipse.xtext.serializer.sequencer.ITransientValueService
  2. org.eclipse.xtext.parsetree.reconstr.ITransientValueService

Both are used, but only the org.eclipse.xtext.serializer.sequencer.ITransientValueService seems to have the final say on whether or not to serialize a model element - at least in my use case, which is to have Xtend serialize model elements that have default values. This post by Christian Dietrich seems to agree.

The issues are, then:

  1. Non-API
    org.eclipse.xtext.serializer.sequencer.ITransientValueService and the default implementation org.eclipse.xtext.serializer.sequencer.LegacyTransientValueService are non-API. This seems undesirable, as provinding a custom binding is a valid usecase (per the above).
  2. Javadoc
    The Javadoc of org.eclipse.xtext.parsetree.reconstr.ITransientValueService and that of its isTransient() method imply that it decides whether a value needs to be serialized, while this is not 100% true.
  3. Documentation
    The documentation links to org.eclipse.xtext.parsetree.reconstr.ITransientValueService. (This may be correct for some usecases; I don't fully understand the difference in role between the two ITransientValueServices.)
  4. The DefaultRuntimeModule contains a method that binds an org.eclipse.xtext.parsetree.reconstr.ITransientValueService. That means that Eclipse's content assist will offer to overwrite that method, which nudges the user to do that instead of creating a binding method for org.eclipse.xtext.serializer.sequencer.ITransientValueService.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing org.eclipse.xtext.serializer.sequencer.ITransientValueService and LegacyTransientValueService with org.eclipse.xtext.parsetree.reconstr.ITransientValueService, then inspect the DefaultRuntimeModule binding. Review the linked runtime concepts documentation and Javadocs; done means the documented interface, API status, and binding guidance accurately reflect the serializer behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.