You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "IndependentCommunity (via GitHub)" <gi...@apache.org> on 2025/04/03 06:12:59 UTC

[I] JavaScript refactoring Renaming a variable [netbeans]

IndependentCommunity opened a new issue, #8390:
URL: https://github.com/apache/netbeans/issues/8390

   ### Description
   
   Is there a plan to add at least a draft version of variable refactoring for JavaScript to the environment?
   I think that when refactoring, a window with drains and checkboxes should be created in advance, where it is suggested to make a replacement, and the user could use checkboxes to choose where to make the replacement and where not. A regular replacement would be suitable for this approach.
   
   Overall the JavaScript editor is lightweight and fast, but it lacks refactoring.
   
   ### Use case/motivation
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [I] JavaScript refactoring Renaming a variable [netbeans]

Posted by "IndependentCommunity (via GitHub)" <gi...@apache.org>.
IndependentCommunity commented on issue #8390:
URL: https://github.com/apache/netbeans/issues/8390#issuecomment-2774637203

   I don't understand what the problem is with adding refactoring of variable renaming. Look at the code:
   
   ![Image](https://github.com/user-attachments/assets/e85aa13a-cdd7-4203-a013-7d4f6e7fccfb)
   
   I select the **const c** and the editor highlights it correctly inside the Test1 function. That is, it does not highlight a variable with the same name in another Test2 function. Only needs to add a replacement in the highlighted places.
   
   In fact, there is already a lot to refactor, all that remains is to add the replacement itself.
   
   (Testing was carried out in version 15)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [I] JavaScript refactoring Renaming a variable [netbeans]

Posted by "IndependentCommunity (via GitHub)" <gi...@apache.org>.
IndependentCommunity commented on issue #8390:
URL: https://github.com/apache/netbeans/issues/8390#issuecomment-2792485815

   Thanks. About key combination CTRL+R : yes, it really works. But then I go to the menu Refactor->Rename...
   
   ![Image](https://github.com/user-attachments/assets/80772f90-e396-425d-8e2a-c27440879f22)
   
   and as you can see, it also says about CTRL+R. I press Rename... in this menu item and it doesn't work, it gives an error:
   
   ![Image](https://github.com/user-attachments/assets/87b9b247-7b18-47ef-b6e7-3050b4627c7a)
   
   Although in both cases it's CTRL+R.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [I] JavaScript refactoring Renaming a variable [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on issue #8390:
URL: https://github.com/apache/netbeans/issues/8390#issuecomment-2776608368

   What you are showing the screenshot already works. Place cursor on variable, press "CTRL + r"
   
   ![Image](https://github.com/user-attachments/assets/18cd97e4-d125-41a2-9908-d80b0f4fc7c1)
   
   Make the modifications to the variable name
   
   ![Image](https://github.com/user-attachments/assets/5e432541-6fdf-4a96-95c3-88ce41fcc38f)
   
   Press enter
   
   ![Image](https://github.com/user-attachments/assets/203b9038-2f29-4512-b056-57d89863c58b)
   
   When NetBeans talks about "Refactoring", it means the potential to rename functions, fields, classes and adjust all call sites throught the whole codebase. The problem here is, that JS has very loose coupling between related files and you can only guess when the same name means the same thing. This only becomes easier with modules, but even the globals exist.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists