diff --git a/jdtls.ext/com.microsoft.jdtls.ext.core/.settings/org.eclipse.jdt.core.prefs b/jdtls.ext/com.microsoft.jdtls.ext.core/.settings/org.eclipse.jdt.core.prefs
index 5b3d27d8..a7e5d63e 100644
--- a/jdtls.ext/com.microsoft.jdtls.ext.core/.settings/org.eclipse.jdt.core.prefs
+++ b/jdtls.ext/com.microsoft.jdtls.ext.core/.settings/org.eclipse.jdt.core.prefs
@@ -104,8 +104,11 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
+org.eclipse.jdt.core.formatter.align_with_spaces=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -115,6 +118,7 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_e
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
@@ -158,6 +162,8 @@ org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=false
+org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true
@@ -382,6 +388,9 @@ org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=160
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
@@ -399,10 +408,10 @@ org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common
org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
diff --git a/jdtls.ext/com.microsoft.jdtls.ext.core/.settings/org.eclipse.jdt.ui.prefs b/jdtls.ext/com.microsoft.jdtls.ext.core/.settings/org.eclipse.jdt.ui.prefs
index 9c075644..9cfef937 100644
--- a/jdtls.ext/com.microsoft.jdtls.ext.core/.settings/org.eclipse.jdt.ui.prefs
+++ b/jdtls.ext/com.microsoft.jdtls.ext.core/.settings/org.eclipse.jdt.ui.prefs
@@ -58,8 +58,8 @@ cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
cleanup_settings_version=2
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_JDTLS.EXT
-formatter_settings_version=13
+formatter_profile=_Java Dependency
+formatter_settings_version=14
org.eclipse.jdt.ui.javadoc=true
org.eclipse.jdt.ui.text.custom_code_templates=/**\n * @return the ${bare_field_name}\n *//**\n * @param ${param} the ${bare_field_name} to set\n *//**\n * ${tags}\n *//*******************************************************************************\n * Copyright (c) ${year} Red Hat Inc. and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * Red Hat Inc. - initial API and implementation\n *******************************************************************************//**\n * @author ${user}\n *\n * ${tags}\n *//**\n * \n *//**\n * ${tags}\n *//* (non-Javadoc)\n * ${see_to_overridden}\n *//**\n * ${tags}\n * ${see_to_target}\n */${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}\n\n\n\n// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();// ${todo} Auto-generated method stub\n${body_statement}${body_statement}\n// ${todo} Auto-generated constructor stubreturn ${field};${field} \= ${param};
sp_cleanup.add_default_serial_version_id=true
diff --git a/jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/JarFileContentProvider.java b/jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/JarFileContentProvider.java
index 3970b017..5be1940c 100644
--- a/jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/JarFileContentProvider.java
+++ b/jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/JarFileContentProvider.java
@@ -15,13 +15,16 @@
import java.io.InputStream;
import java.net.URI;
import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJarEntryResource;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.core.JarEntryDirectory;
@@ -64,6 +67,24 @@ private String getContent(String rootId, String path, IProgressMonitor pm) {
}
}
}
+ // if the file exists in the java packages
+ String[] segments = StringUtils.split(path, "/");
+ String packageName = StringUtils.join(Arrays.asList(segments).subList(0, segments.length - 1), '.');
+ IPackageFragment packageFragment = packageRoot.getPackageFragment(packageName);
+ if (packageFragment != null && packageFragment.exists()) {
+
+ Object[] objs = packageFragment.getNonJavaResources();
+ for (Object obj : objs) {
+ if (obj instanceof IJarEntryResource) {
+ IJarEntryResource child = (IJarEntryResource) obj;
+ if (child instanceof JarEntryFile && child.getFullPath().toPortableString().equals(path)) {
+ return readFileContent((JarEntryFile) child);
+ }
+ }
+
+ }
+ }
+
}
} catch (CoreException e) {
JavaLanguageServerPlugin.logException("Problem get JarEntryFile content ", e);
diff --git a/jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/PackageCommand.java b/jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/PackageCommand.java
index bfca48eb..e45bd645 100644
--- a/jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/PackageCommand.java
+++ b/jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/PackageCommand.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package com.microsoft.jdtls.ext.core;
+import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -19,11 +20,15 @@
import java.util.function.BiFunction;
import java.util.stream.Collectors;
+import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
@@ -38,6 +43,7 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.ITypeRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.core.JarEntryDirectory;
@@ -72,7 +78,7 @@ public class PackageCommand {
commands.put(NodeKind.CONTAINER, PackageCommand::getPackageFragmentRoots);
commands.put(NodeKind.PACKAGEROOT, PackageCommand::getPackages);
commands.put(NodeKind.PACKAGE, PackageCommand::getRootTypes);
- commands.put(NodeKind.Folder, PackageCommand::getFolderChildren);
+ commands.put(NodeKind.FOLDER, PackageCommand::getFolderChildren);
}
/**
@@ -118,26 +124,45 @@ public static List resolvePath(List