Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize Xpect #320

Closed
10 tasks done
cdietrich opened this issue Jul 6, 2023 · 10 comments
Closed
10 tasks done

Modernize Xpect #320

cdietrich opened this issue Jul 6, 2023 · 10 comments
Milestone

Comments

@cdietrich
Copy link
Member

cdietrich commented Jul 6, 2023

Xpect still uses the old xtext workflow (see what new Xtext project wizard generates) and the old xtext generator.(xpand based)
this is cause of
https://github.com/eclipse/Xpect/blob/018800b3af074c402b2aa53174e2457ea6f48046/org.eclipse.xpect/src/org/eclipse/xpect/GenerateXpect.mwe2#L124C6-L124C6
which uses
https://github.com/meysholdt/xtext_stateful_lexer/blob/48a4201ea3e0e52743af553ffaea89ba2d79144c/de.itemis.statefullexer/src/de/itemis/statefullexer/StatefulLexerFragment.xtend#L22

we should move the new fragment to a new plugin in the xpect project.
we also need to make sure content assist and highlighting lexer get put to the ide project.

once this is done we can move in xpect

  • to a newer minimal Xtext version (ExternalAntlrLexerFragment above requires at lease 2.20), i propose a much newer version
  • the new xtext workflow (also create an ide project), compare generated code, specially the runtime and ui moduels for diffs
  • thus get rid of xpand and dependency to xtexts for removal old generator
  • then we can change the pom to get rid of the fornax plugin to execute the workflow which is also no longer maintained (see also what new Xtext project wizard generates)
  • we can and should also use newer tycho version (and get rid of outdated tycho 1.7/2.x stuff)
  • and with that have better separation between compile time and runtime deps (put dep. to xtext.xtext.generator to build.properties, e.g. as new xtext project wizard generates it)
  • simplifiy target file setup in tycho as in xtext
  • Optional: repair oomph
  • Check if we can fix some Xtext and Java deprecations

also the workflows in the examples need to be modernized, but that should be straight forward.
we also should get of deprecated xtext junit4 there

maybe we also should create a 0.2.0 branch with the current state and bump master to 0.3.0 then

in an alternative approach we would update target platform, xtext+java version, workflow, tycho and pom first and use fragment adapter (see history of /org.eclipse.xtext.ui.codetemplates/src/org/eclipse/xtext/ui/codetemplates/GenerateCodetemplateLanguages.mwe2) to call old workflow and then create the new fragment.
in this case we could make sure the "new dependencies" work first before introducing the changed code.

regardings versions:

  • Java 11 + Eclipse 2022-03 + Xtext 2.31
  • Java 17 + Eclipse 2023-06 + Xtext 2.31 (or 2.32 when it is already out) (as we will have to drop 11 Support in Xtext anyway one day i propose to go this way)
@merks
Copy link
Contributor

merks commented Jul 18, 2023

Wow, this doesn't sound fun at all. 😱

@merks
Copy link
Contributor

merks commented Jul 18, 2023

These are the dependencies I see:

image

@cdietrich
Copy link
Member Author

yes. and xpand is not maintained since 2016

@cdietrich
Copy link
Member Author

see also
eclipse-xtext/xtext#2676

@cdietrich cdietrich added this to the 0.3.0 milestone Jul 19, 2023
@cdietrich
Copy link
Member Author

This will also fix #300

@cdietrich
Copy link
Member Author

with merging the complete logic from stateful lexer to modernizeXpect branch (see #322)
all dependencies to xpand, stateful lexer, icu and org.eclipse.xtext.generator (the old one) should be removable

@merks
Copy link
Contributor

merks commented Jul 31, 2023

That sounds very promising!

@tjeske tjeske mentioned this issue Aug 27, 2023
@cdietrich
Copy link
Member Author

many thanks for your contribution @tjeske

@cdietrich
Copy link
Member Author

cdietrich commented Sep 12, 2023

open tasks

  • do another integ test round at sponsor of this feature
  • wait for community feedback (asked in xtext forum and on mailing lists)
  • suppresswarnings for generated lexer generate supresswarnings for stateful lexers #326
  • fix the adapter warnings and use the common pattern of <T> T getAdapter( ... Class<T>) and someclass.cast(someObject) fix adapter warnings #327
  • check other warnings

@cdietrich
Copy link
Member Author

will close this for now. open points can be handled separately
many thanks for your efforts @tjeske

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants