eclipse-xtext / eclipse-xtext/xtext

ImplicitlyImportedFeatures: make `getExtensionClasses()` and `getStaticImportClasses()` static methods

Open
#3,692 0 comments 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

A class, which extends ImplicitlyImportedFeatures and overrides getExtensionClasses() and getStaticImportClasses(), should call super.getExtensionClasses() and super.getStaticImportClasses(). My understanding is that getExtensionClasses() and getStaticImportClasses are called for each model (XBase-derivative). So for each model instance, the lists from the above methods are supposed to be constructed anew.

It would be better, if the lists are constructed in a static block and the methods return the ready list. For this to wok in a meaningful way, super.getExtensionClasses() and super.getStaticImportClasses() should be static, so that a derived class can call them from a static block.

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 at ImplicitlyImportedFeatures and locate getExtensionClasses() and getStaticImportClasses(), then inspect their overrides and call sites. Confirm how model instances currently invoke the methods and whether derived classes need superclass access during static initialization. Done means the methods support the requested static usage without breaking existing overrides or callers.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.