Skip to content

Fixed Kotlin refactoring menu and caret restoration - #146

Open
oleg68 wants to merge 2 commits into
nbplugins:mainfrom
oleg68:bugfix/move-nested-member-safety
Open

oleg68 wants to merge 2 commits into
nbplugins:mainfrom
oleg68:bugfix/move-nested-member-safety

Conversation

@oleg68

@oleg68 oleg68 commented Oct 16, 2026 •

Copy link
Copy Markdown

Summary

  • restored immediate Refactor availability for Kotlin file and package nodes
  • removed the duplicate standalone Rename presentation
  • preserved open-editor carets during Change Kotlin Package and undo
  • routed Rename from an open Kotlin editor to declaration rename before filesystem-file fallback
  • made case-only file and directory renames recover their original spelling when the final rename leg fails
  • added regression coverage for failed second case-only rename legs
  • updated the manual test plan and bumped the development version to 0.11.288-SNAPSHOT

Verification

  • python3 build-scripts/update-copyright.py --check
  • focused refactoring tests (32 tests passed)
  • mvn clean test
  • mvn clean package -DskipTests (NBM built successfully)
  • NBM: Nbm/target/nbm/netbeans-plugin-kotlin-nbm-0.11.288-SNAPSHOT.nbm

🤖 Generated with Claude Code

Co-Authored-By: Claude Code <noreply@anthropic.com>
@oleg68

oleg68 commented Oct 16, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T09:05:46.331446Z 1ea00b9 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f809cf7e4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Co-Authored-By: Claude Code <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ea00b902f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

UI.openRefactoringUI(
new KotlinRenameRefactoringUI(psi, new RenameRefactoring(Lookups.fixed(psi, doc, caretPosition))),
TopComponent.getRegistry().getActivated());
if (ec != null && ec.getOpenedPanes() != null && ec.getOpenedPanes().length > 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve filesystem rename for open project nodes

When a Kotlin file is already open and Rename is invoked from its Projects/Files node, that DataNode lookup exposes an EditorCookie with nonempty opened panes, so this branch consumes the node request and launches symbol rename at the editor caret instead of reaching selectedKotlinFile() for physical rename. Fresh evidence after the earlier branch-order fix is that an open project node carries both node and editor cookies, so opened-pane state still cannot identify the invocation source; check the selected-node/Explorer context before choosing the editor route.

Useful? React with 👍 / 👎.

* @return selected valid Kotlin file, or {@code null} for folders and unrelated selections
*/
private FileObject selectedKotlinFile(Lookup lookup) {
FileObject file = lookup.lookup(FileObject.class);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject multi-selection before choosing a Kotlin file

When at least two unopened Kotlin file nodes are selected, NetBeans' merged node lookup makes lookup(FileObject.class) return one match rather than reporting ambiguity. canRename() consequently returns true and doRename() opens physical rename for an arbitrary file, whereas the surrounding node actions require exactly one node; validate lookupAll(Node.class) or equivalent file cardinality before returning a target.

Useful? React with 👍 / 👎.

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