-
Notifications
You must be signed in to change notification settings - Fork 441
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
When setting date variables in typeComment and generate comment manually, some variables can't be parse. #2052
Comments
Currently only creating new file consumed these variable templates. Generating javadoc didn't. |
As @testforstephen mentioned, it seems to work for newly created files for fileHeader templates, but the mechanism should be the same for typeComment. In fact, I remembered #1987 , which I really should merge. Since ${year} is getting resolved (and not other placeholders, I wonder if there's some resolution happening on the language server side that we could potentially extend. |
Our docs are slightly inaccurate at https://github.com/redhat-developer/vscode-java/wiki/Predefined-Variables-for-Java-Template-Snippets . fileHeader is handled by vscode-java (which defines the terms directly in fileEventHandler.ts . However typeComment uses JDT-LS, and doesn't seem to support month, day, hour minute. We could probably contribute these back into JDT at : https://git.eclipse.org/c/gerrit/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/core/manipulation/CodeTemplateContextType.java#n181 . The implementation is pretty easy : https://git.eclipse.org/c/platform/eclipse.platform.text.git/tree/org.eclipse.text/src/org/eclipse/jface/text/templates/GlobalTemplateVariables.java#n208 |
We could also just make the change on our end until it finally makes it upstream.
|
- Fixes redhat-developer/vscode-java#2052 Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
Thanks for replay and support @rgrunber |
- Fixes redhat-developer/vscode-java#2052 - Ensure that all single digit representations are 0-prefixed Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
- Fixes redhat-developer/vscode-java#2052 - Ensure that all single digit representations are 0-prefixed Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
- References redhat-developer/vscode-java#2052 Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
- References redhat-developer/vscode-java#2052 Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
When setting "${year}-${month}-${day} ${hour}:${minute}" in "java.templates.typeComment" and generate comment manually, some variables can't be parse.
Environment
Steps To Reproduce
Current Result
Expected Result
Additional Informations
Such case happened when generate class comment manually. Create java file is OK.
The text was updated successfully, but these errors were encountered: