mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 06:09:17 +01:00
ASTGen: don't allow renaming nodes not declared in sketch
This commit is contained in:
@@ -1276,6 +1276,13 @@ public class ASTGenerator {
|
||||
return;
|
||||
}
|
||||
|
||||
ASTNode decl = ps.compilationUnit.findDeclaringNode(binding.getKey());
|
||||
if (decl == null) {
|
||||
editor.statusMessage(name.getIdentifier() + " isn't defined in this sketch, " +
|
||||
"so it cannot be renamed", EditorStatus.ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
EventQueue.invokeLater(() -> gui.handleRename(binding));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user