You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/03/27 05:25:11 UTC

[GitHub] [netbeans] mbien opened a new pull request #3876: removed some less useful template links

mbien opened a new pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876


   proposal to remove some of the in-editor links to their template files.
   
   Some templates, specifically in the code snippet category, are unlikely to be ever edited by the user - except for the lone purpose of removing the comment with the link.
   
   example:
   ```java
           List.of(1,2,3).sort((o1, o2) -> {
               return 0; // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/LambdaBody
           });
   ```
   It is unlikely that the user will ever want to change the template for a lambda body, since there is simply not a lot to change. I think a better default would be to not have a link, the templates can be still found via Tools -> Templates.
   
   links are removed from: GeneratedMethodBody, LambdaBody and OverriddenMethodBody
   
   I found also a bug in the URL highlighter, it adds the ')' to the url which creates an invalid link. Does anyone know where the code for that is?


-- 
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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837606724



##########
File path: java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/CreateMethodTest.java
##########
@@ -223,7 +222,7 @@ public void test223011b() throws Exception {
                         "        Field f = method(c1, c2);\n" +
                         "    }\n" +
                         "    private <T extends Number & CharSequence, E extends Integer> Field method(Class<E> c1, Class<T> c2) {\n" +
-                        "        throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +

Review comment:
       Moreover the `Tools -> Templates` UI isn't in VSCode. Clicking the URL is the only way to customize the template in VSCode.




-- 
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


[GitHub] [netbeans] mbien commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
mbien commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837019631



##########
File path: ide/projectui/src/org/netbeans/modules/project/ui/resources/license-default.txt
##########
@@ -1,4 +1,4 @@
 ${licenseFirst!""}
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template

Review comment:
       It could be a sign. But maybe its sufficient to explain how the link works at least until someone is interested to implement a deeper fix.




-- 
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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837016332



##########
File path: java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/CreateMethodTest.java
##########
@@ -223,7 +222,7 @@ public void test223011b() throws Exception {
                         "        Field f = method(c1, c2);\n" +
                         "    }\n" +
                         "    private <T extends Number & CharSequence, E extends Integer> Field method(Class<E> c1, Class<T> c2) {\n" +
-                        "        throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +

Review comment:
       I have always known the template is in Tools -> Templates. But I never bothered searching for it! Having the link/action/hint next to the generated text block at the time the incorrect (as perceived by user) block is inserted is essential for people to really invoke the customization.




-- 
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


[GitHub] [netbeans] neilcsmith-net commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837611759



##########
File path: ide/projectui/src/org/netbeans/modules/project/ui/resources/license-default.txt
##########
@@ -1,4 +1,4 @@
 ${licenseFirst!""}
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template

Review comment:
       +1 to `Visit nbfs:...`, and possibly thinking about better ways of guiding the user into how to click things separately.




-- 
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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837604864



##########
File path: ide/projectui/src/org/netbeans/modules/project/ui/resources/license-default.txt
##########
@@ -1,4 +1,4 @@
 ${licenseFirst!""}
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template

Review comment:
       I'd like to point out that users not knowing how to "click" in the editor (e.g. with Ctrl or Cmd) probably don't know how to navigate to symbol definitions either!  _"Addressing"_ just the URL problem without fixing the underlying usability issue makes little sense to me.
   
   I am fine with some rewording - for example `Visit nbfs:...` or `Navigate to nbfs:` - and then letting the user intelligence work - but I find `Ctrl/Cmd+Click` so ugly, that I cannot adore it... even if it helped even a single user.




-- 
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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837003141



##########
File path: java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/CreateMethodTest.java
##########
@@ -223,7 +222,7 @@ public void test223011b() throws Exception {
                         "        Field f = method(c1, c2);\n" +
                         "    }\n" +
                         "    private <T extends Number & CharSequence, E extends Integer> Field method(Class<E> c1, Class<T> c2) {\n" +
-                        "        throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +

Review comment:
       This is a useful link that I used as I am not satisfied with `new UnsupportedOperationException(\"Not supported yet.\")`.

##########
File path: ide/projectui/src/org/netbeans/modules/project/ui/resources/license-default.txt
##########
@@ -1,4 +1,4 @@
 ${licenseFirst!""}
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template

Review comment:
       `Ctrl/Cmd` sounds horrible. I don't have Cmd on my keyboard! Would `See nbfs:/....` work?




-- 
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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837014059



##########
File path: ide/projectui/src/org/netbeans/modules/project/ui/resources/license-default.txt
##########
@@ -1,4 +1,4 @@
 ${licenseFirst!""}
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template

Review comment:
       I have noticed the complaint on mailing list as well. Yes, we have a usability problem. 
   
   > I don't have Cmd either. If I wouldn't have added it someone would have commented that they had no Ctrl on their kb.
   
   Probably a sign that the user experience deserves deeper fix than `Ctrl/Cmd` prefix.




-- 
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


[GitHub] [netbeans] mbien commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
mbien commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837881152



##########
File path: java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/CreateMethodTest.java
##########
@@ -223,7 +222,7 @@ public void test223011b() throws Exception {
                         "        Field f = method(c1, c2);\n" +
                         "    }\n" +
                         "    private <T extends Number & CharSequence, E extends Integer> Field method(Class<E> c1, Class<T> c2) {\n" +
-                        "        throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +

Review comment:
       > Moreover the `Tools -> Templates` UI isn't in VSCode. Clicking the URL is the only way to customize the template in VSCode.
   
   now I understand the problem. VSCode is missing a feature.




-- 
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


[GitHub] [netbeans] mbien commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
mbien commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837013414



##########
File path: java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/CreateMethodTest.java
##########
@@ -223,7 +222,7 @@ public void test223011b() throws Exception {
                         "        Field f = method(c1, c2);\n" +
                         "    }\n" +
                         "    private <T extends Number & CharSequence, E extends Integer> Field method(Class<E> c1, Class<T> c2) {\n" +
-                        "        throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +

Review comment:
       its also editable via Tools -> Templates -> Java/Code Snippets. It should be picked up during a NB version upgrade too as far as i know, so you have edit it only once.




-- 
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


[GitHub] [netbeans] mbien commented on pull request #3876: removed some less useful template links

Posted by GitBox <gi...@apache.org>.
mbien commented on pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#issuecomment-1080014374


   > If the VSCODE and IDE variants of the templates are now identical I think it would be good to remove the duplication.
   
   I don't want to change too much there since I don't know the requirements. I also don't understand why for example a maven project has its own new project template instead of just using the template for "new java main class" as it used to be the case if I remember correctly. (this added new bugs and confusion as seen on the mailing list or issue #3678)
   
   this reminds me: going to try to update the txt on the other templates to mention that users have to hold down ctrl while clicking since that was also brought up on the ml.


-- 
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


[GitHub] [netbeans] mbien commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
mbien commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837011309



##########
File path: ide/projectui/src/org/netbeans/modules/project/ui/resources/license-default.txt
##########
@@ -1,4 +1,4 @@
 ${licenseFirst!""}
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
-${licensePrefix}Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template

Review comment:
       the problem was that many didn't know how to click the link as seen in issues and on the mailing list. I don't have Cmd either. If I wouldn't have added it someone would have commented that they had no Ctrl on their kb.




-- 
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


[GitHub] [netbeans] neilcsmith-net commented on a change in pull request #3876: removed some less useful template links and other minor updates

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on a change in pull request #3876:
URL: https://github.com/apache/netbeans/pull/3876#discussion_r837610520



##########
File path: java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/CreateMethodTest.java
##########
@@ -223,7 +222,7 @@ public void test223011b() throws Exception {
                         "        Field f = method(c1, c2);\n" +
                         "    }\n" +
                         "    private <T extends Number & CharSequence, E extends Integer> Field method(Class<E> c1, Class<T> c2) {\n" +
-                        "        throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +

Review comment:
       @JaroslavTulach what happens if the user deletes the link in the template then?!




-- 
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