-
Notifications
You must be signed in to change notification settings - Fork 914
removed some less useful template links and other minor updates #3876
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
Conversation
matthiasblaesing
left a comment
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.
I think it is valid to remove the links here. The templates are indeed mostly place holders, with little incentive for customization.
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. |
- some snippet templates are so trivial that they don't need a link. - updated template header to mention ctrl/cmd buttons. - updated freemarker url. - tests needed repairs after the change.
6bf995e to
16306f7
Compare
JaroslavTulach
left a comment
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.
Until NetBeans continues to provide template modifying functionality, it is important to promote it to the user. Removing the links goes against that effort. I'd rather not see this PR integrated.
| " 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" + |
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.
This is a useful link that I used as I am not satisfied with new UnsupportedOperationException(\"Not supported yet.\").
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.
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.
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.
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.
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.
Moreover the Tools -> Templates UI isn't in VSCode. Clicking the URL is the only way to customize the template in VSCode.
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.
@JaroslavTulach what happens if the user deletes the link in the template then?!
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.
Moreover the
Tools -> TemplatesUI 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.
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.
@mbien not entirely. The text suggesting that a generated snippet can be customized has been there for a long time. Especially novice users reminded that they can adjust the IDE to his/her own style (i.e. the UnsupportedException default body is seen as good or bad, depending on coding style).
I opt for leaving the live links in there. If a presentation does not seem nice (?), we can enhance Folding SPI (now allows only to provide plaintext for the placeholder, could provide i.e. JComponent or TextLayout for the entire fold contents.
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.
would be curious what templates you guys are using for the generated methods
| ${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 |
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.
Ctrl/Cmd sounds horrible. I don't have Cmd on my keyboard! Would See nbfs:/.... work?
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.
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.
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.
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.
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.
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.
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.
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.
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.
+1 to Visit nbfs:..., and possibly thinking about better ways of guiding the user into how to click things separately.
jtulach
left a comment
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.
Looks like the overall concensus is that this needs some changes:
- Use
Visit nbfs://....as proposed by Neil - Avoid removing of URLs from code snippets
|
going to close this since I don't think there is going to be a consensus
edit: i also did not consider that VSCode does not have a template editor, so there is a non-NetBeans requirement for providing those until someone adds that feature I suppose |
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:
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
edit: made some other minor improvements, see commit msg.
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?