Skip to content

Prepares the removal of the final annotation (Tree@\loc), including its definition and all of its uses. #1974

Draft
jurgenvinju wants to merge 18 commits intomainfrom
remove-tree-loc-annotation
Draft

Prepares the removal of the final annotation (Tree@\loc), including its definition and all of its uses. #1974
jurgenvinju wants to merge 18 commits intomainfrom
remove-tree-loc-annotation

Conversation

@jurgenvinju
Copy link
Copy Markdown
Member

@jurgenvinju jurgenvinju commented Jun 12, 2024

This PR implements the first step in a bootstrap cycle to replace Tree@\loc by loc Tree.src

  1. The refactorig is 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.
  4. The standard library in particular the ParseTree module is not binary compatible to its previous version. So this must be a "major" version bump and a big bang release for all libraries.
  5. This change requires thoughtful revising of the documentation in the website project, including the reference manual and recipes. For a separate PR.

This change impacts all projects with code that uses Tree.\@loc; so that's a lot. The first of the typepal project on which the Compiler and the checker on the current project depend. Releasing a refactored version of typepal is the next step.

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

  1. that would break the code that has not migrated yet. However, the refactoring will change the exceptional behavior for a missing .src field. From now on it will produce the default instead of throwing NoSuchAnnotation!
  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

@jurgenvinju
Copy link
Copy Markdown
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.

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 17, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46%. Comparing base (53d2faa) to head (1dd0c8c).

Additional details and impacted files
@@           Coverage Diff            @@
##              main   #1974    +/-   ##
========================================
- Coverage       46%     46%    -1%     
+ Complexity    6737    6717    -20     
========================================
  Files          794     794            
  Lines        65923   65923            
  Branches      9888    9888            
========================================
- Hits         30858   30747   -111     
- Misses       32684   32795   +111     
  Partials      2381    2381            

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

@jurgenvinju jurgenvinju changed the title 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. Prepares the removal of the final annotation (Tree@\loc), including its definition and all of its uses. Apr 7, 2026
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