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

Fix rename refactoring type errors #559

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

Conversation

toinehartman
Copy link
Contributor

No description provided.

@toinehartman toinehartman marked this pull request as ready for review January 10, 2025 13:45
@@ -215,7 +215,7 @@ public InterruptibleFuture<ITuple> getRename(ITree cursorTree, Set<ISourceLocati
} catch (Throw e) {
if (e.getException() instanceof IConstructor) {
var exception = (IConstructor)e.getException();
if (exception.getType().getAbstractDataType().getName().equals("RenameException")) {
if (exception.getName().contains("Rename")) {

Choose a reason for hiding this comment

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

Is there anyway that now or in the future user code is called that could throw an exception? If so, is "having Rename" in the name discerning enough? Maybe we can also check the type including the "package" part to make sure it is an "official" Rename exception?

@@ -27,6 +27,7 @@ POSSIBILITY OF SUCH DAMAGE.
module lang::rascal::tests::rename::Grammars

import lang::rascal::tests::rename::TestUtils;
import lang::rascal::lsp::refactor::Exception;

Choose a reason for hiding this comment

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

Extra import but no use of the import? The same goes for imports in ProjectOnDisk.rsc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These imports fix errors regarding undefined @expected exceptions in these modules.

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.

2 participants