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

Prepares the removal of the final annotation (Tree@\loc), including its definition and all of its uses. PR to be merged when rascal-core project is stable. #1974

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

jurgenvinju
Copy link
Member

@jurgenvinju jurgenvinju commented Jun 12, 2024

This PR allows for some testing until we've decided it is a good time to merge; when rascal-core is stable.

  1. The refactorig was automated fully by lang::rascal::upgrade::UpgradeAnnotationsToKeywordParameters
  2. Used report from this module first to see what the relevance and impact would be
  3. No manual changes were necessary but some additional documentation (deprecation) lines were added as by-catch.

This change impacts all projects with code that uses Tree.\@loc; so that's a lot. It makes sense to document how to use the automated refactoring or to link this into a UI feature (lenses?) for easy-of-use.

This branch does not remove the old feature yet for two reasons:

  1. that would break the code that has not migrated yet, and people would not be able to run their tests before and after the upgrade easily. However, it is unknown how code that uses Tree@\loc works against a definition of Tree(loc src=|unknown:///|)! So everybody will have to run update(myProjectSourceFolder) anyway.
  2. at least the synax definition is still required to be able to execute the refactoring.

Commits:

  • borrowed upgrade folder from no-more-annotations branch to reuse refactoring code
  • ran update function on Assignment test module
  • rewrote the annotation tests using the update refactoring
  • automatically refactored all declarations and uses of annotations
  • folded src kw parameter into the primary definition of Tree
  • added deprecation messages of old annotations/keyword parameters that only work for Eclipse. We can upgrade Eclipse to also use util::IDEServices and util::LanguageServer, or we can drop them as soon as we drop Eclipse

@jurgenvinju
Copy link
Member Author

The update functionality that refactors uses of annotation syntax to keyword parameter syntax is a candidate for inclusion in the Rascal LSP server:

  • as a lense
  • as a refactoring?

It has to run on the entire project to make sense as the refactoring is "dumb"; it does not follow name resolution links it just replaces all syntactical constructs in a consistent manner.

Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49%. Comparing base (572a62d) to head (eafd290).
Report is 5 commits behind head on main.

Current head eafd290 differs from pull request most recent head 958934a

Please upload reports for the commit 958934a to get more accurate results.

Additional details and impacted files
@@           Coverage Diff            @@
##              main   #1974    +/-   ##
========================================
- Coverage       49%     49%    -1%     
+ Complexity    6297    6244    -53     
========================================
  Files          664     665     +1     
  Lines        59558   59624    +66     
  Branches      8639    8645     +6     
========================================
- Hits         29437   29294   -143     
- Misses       27908   28140   +232     
+ Partials      2213    2190    -23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

1 participant