-
Notifications
You must be signed in to change notification settings - Fork 408
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
Use StubUtility from o.e.jdt.core.manipulation. #793
Conversation
1f5ffc8
to
9a9add8
Compare
@snjeza can you check how jdt.ls behaves on a 32bits VM? does it start with/without this PR? |
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.
can you check how jdt.ls behaves on a 32bits VM? does it start with/without this PR?
@fbricon jdt.ls starts on JDK 1.8.0_181 32bits with and without this PR. I have tested on Linux, Windows and docker 32bit VM (https://github.com/cortinico/docker-java8-32bit)
private static final String CODETEMPLATES_PREFIX = "java.codetemplates."; //$NON-NLS-1$ | ||
public static final String COMMENT_SUFFIX = ".comment"; //$NON-NLS-1$ | ||
public static final String BODY_SUFFIX = ".body"; //$NON-NLS-1$ | ||
private static final String CODETEMPLATES_PREFIX = "org.eclipse.jdt.ui.text.codetemplates."; //$NON-NLS-1$ |
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.
why do we need a jdt.ui namespaced 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.
This is in order to access the following code template definitions, https://github.com/eclipse/eclipse.jdt.ui/blob/master/org.eclipse.jdt.ui/templates/default-codetemplates.xml . Currently they're defined in jdt.ui. Perhaps they could be moved in the future and even have their namespace changed but haven't looked into it yet.
I'll definitely take care of the other issues mentioned.
}; | ||
|
||
TemplatePersistenceData [] templateData = new TemplatePersistenceData [templates.length]; | ||
for (int i = 0; i < templates.length; i++) { |
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.
enhanced for loop please :-)
TemplateReaderWriter trw = new TemplateReaderWriter(); | ||
try (Writer wrt = new StringWriter()) { | ||
trw.save(templateData, wrt); | ||
defEclipsePrefs.put("org.eclipse.jdt.ls.core.custom_code_templates", wrt.toString()); |
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.
extract "org.eclipse.jdt.ls.core.custom_code_templates" as constant
- With http://eclip.se/534221 complete, we can can reduce copies for classes like StubUtility, CodeTemplateContext, and CodeTemplateContextType. - Update target platform to use 4.10 I-builds. - 32 bit architectures have been removed from 4.10 Signed-off-by: Roland Grunberg <[email protected]>
9a9add8
to
e5fbb61
Compare
classes like StubUtility, CodeTemplateContext, and CodeTemplateContextType.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=536766 for information on the dropping of 32 bit support in 4.10.