1212package com .microsoft .jdtls .ext .core .model ;
1313
1414import java .net .URI ;
15+ import java .util .ArrayList ;
16+ import java .util .Arrays ;
1517import java .util .HashMap ;
1618import java .util .List ;
1719import java .util .Map ;
4345 */
4446public class PackageNode {
4547
46- /**
47- * Nature Id for the IProject.
48- */
49- private static final String NATURE_ID = "NatureId" ;
50-
51- private static final String UNMANAGED_FOLDER_INNER_PATH = "UnmanagedFolderInnerPath" ;
52-
5348 public static final String K_TYPE_KIND = "TypeKind" ;
5449
5550 /**
@@ -67,15 +62,26 @@ public class PackageNode {
6762 */
6863 public static final int K_ENUM = 3 ;
6964
65+ public static final String REFERENCED_LIBRARIES_PATH = "REFERENCED_LIBRARIES_PATH" ;
7066 private static final String REFERENCED_LIBRARIES_CONTAINER_NAME = "Referenced Libraries" ;
7167 private static final String IMMUTABLE_REFERENCED_LIBRARIES_CONTAINER_NAME = "Referenced Libraries (Read-only)" ;
72-
73- public static final String REFERENCED_LIBRARIES_PATH = "REFERENCED_LIBRARIES_PATH" ;
7468 public static final ContainerNode REFERENCED_LIBRARIES_CONTAINER = new ContainerNode (REFERENCED_LIBRARIES_CONTAINER_NAME , REFERENCED_LIBRARIES_PATH ,
7569 NodeKind .CONTAINER , IClasspathEntry .CPE_CONTAINER );
7670 public static final ContainerNode IMMUTABLE_REFERENCED_LIBRARIES_CONTAINER = new ContainerNode (IMMUTABLE_REFERENCED_LIBRARIES_CONTAINER_NAME ,
7771 REFERENCED_LIBRARIES_PATH , NodeKind .CONTAINER , IClasspathEntry .CPE_CONTAINER );
7872
73+ /**
74+ * Nature Id for the IProject.
75+ */
76+ private static final String NATURE_ID = "NatureId" ;
77+
78+ private static final String UNMANAGED_FOLDER_INNER_PATH = "UnmanagedFolderInnerPath" ;
79+
80+ /**
81+ * Nature Id for the unmanaged folder.
82+ */
83+ private static final String UNMANAGED_FOLDER_NATURE_ID = "org.eclipse.jdt.ls.core.unmanagedFolder" ;
84+
7985 /**
8086 * The name of the PackageNode.
8187 */
@@ -158,10 +164,12 @@ public static PackageNode createNodeForProject(IJavaElement javaElement) {
158164 PackageNode projectNode = new PackageNode (proj .getName (), proj .getFullPath ().toPortableString (), NodeKind .PROJECT );
159165 projectNode .setUri (ProjectUtils .getProjectRealFolder (proj ).toFile ().toURI ().toString ());
160166 try {
161- projectNode . setMetaDataValue ( NATURE_ID , proj .getDescription ().getNatureIds ());
167+ List < String > natureIds = new ArrayList <>( Arrays . asList ( proj .getDescription ().getNatureIds () ));
162168 if (!ProjectUtils .isVisibleProject (proj )) {
169+ natureIds .add (UNMANAGED_FOLDER_NATURE_ID );
163170 projectNode .setMetaDataValue (UNMANAGED_FOLDER_INNER_PATH , proj .getLocationURI ().toString ());
164171 }
172+ projectNode .setMetaDataValue (NATURE_ID , natureIds );
165173 } catch (CoreException e ) {
166174 // do nothing
167175 }
0 commit comments