eclipse-xtext / eclipse-xtext/xtext
Mixing generateStubs with java and xtend files
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 831
- Forks
- 330
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
Description
My understanding is that in .mwe2 files code { preferXtendStubs = } controls whether .java or .xtend files should be generated. If the destination .xtend or .java file exists, it is not overwritten, otherwise a stub file is created.
Sometimes some people think that some files should be in .java and others in .xtend, e.g. …serializer/SemanticSequencer.xtend and serializer/…SyntacticSequencer.java . The problem report is that in such cases it is not possible to prevent the generation of serializer/…SyntacticSequencer.xtend, if serializer/…SyntacticSequencer.java does exist. And if both files coexist at the end the compilation does not work. So:
- when generating stubs in Xtend, avoid creating files, if the same filename but with extension
.javaexists. - when generating stubs in Java, avoid creating files, if the same filename but with extension
.xtendexists.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the generateStubs behavior controlled by preferXtendStubs in the .mwe2 configuration. Check the existing stub-generation tests, if present, and verify that generation skips a .xtend file when the matching .java file exists, and vice versa.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100