-
Notifications
You must be signed in to change notification settings - Fork 9
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
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
@@ -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")) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
No description provided.