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

Rename refactoring for grammars #418

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

toinehartman
Copy link
Contributor

@toinehartman toinehartman commented Aug 1, 2024

Implements grammar support for the rename refactoring.

Complementary to #397. Allows renaming of productions, constructors, fields/labels in grammars.

@toinehartman toinehartman added the enhancement New feature or request label Aug 1, 2024
@toinehartman toinehartman self-assigned this Aug 1, 2024
@toinehartman toinehartman force-pushed the feature/rename-refactoring/grammars branch 2 times, most recently from bc2970e to e0b7c41 Compare August 7, 2024 08:57
@toinehartman toinehartman force-pushed the feature/rename-refactoring/grammars branch from e0b7c41 to 91a1c75 Compare August 20, 2024 16:53
Base automatically changed from feature/rename-refactoring/cross-module to main September 5, 2024 12:21
@toinehartman toinehartman force-pushed the feature/rename-refactoring/grammars branch from a735cbe to cf68cfd Compare September 11, 2024 12:57
@toinehartman toinehartman marked this pull request as ready for review September 11, 2024 13:01
Copy link

sonarcloud bot commented Sep 11, 2024

Copy link
Member

@rodinaarssen rodinaarssen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be valuable to add a paragraph on when certain definitions are merged and when they're not. It is implied by the the "module structure" tests (of which only some have documentation as to what a <X> module structure is).

All in all: LGTM!

} catch ParseError(_): {
return {invalidName(name)};
set[IllegalRenameReason] rascalCheckLegalName(str name, set[IdRole] defRoles) {
set[IllegalRenameReason] tryParseAs(type[&T<:Tree] begin, str idDescription) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP:

Suggested change
set[IllegalRenameReason] tryParseAs(type[&T<:Tree] begin, str idDescription) {
set[IllegalRenameReason] tryParseAs(type[&T <: Tree] begin, str idDescription) {

, decls = "syntax Foo[&T] = Foo[&T] child &T t;"
, oldName = "Foo", newName = "Bar");

test bool startPoduction() = testRenameOccurrences({0, 1}, ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test bool startPoduction() = testRenameOccurrences({0, 1}, ""
test bool startProduction() = testRenameOccurrences({0, 1}, ""

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

Successfully merging this pull request may close these issues.

2 participants