12
12
package com .microsoft .jdtls .ext .core .model ;
13
13
14
14
import java .net .URI ;
15
+ import java .util .ArrayList ;
16
+ import java .util .Arrays ;
15
17
import java .util .HashMap ;
16
18
import java .util .List ;
17
19
import java .util .Map ;
43
45
*/
44
46
public class PackageNode {
45
47
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
-
53
48
public static final String K_TYPE_KIND = "TypeKind" ;
54
49
55
50
/**
@@ -67,15 +62,26 @@ public class PackageNode {
67
62
*/
68
63
public static final int K_ENUM = 3 ;
69
64
65
+ public static final String REFERENCED_LIBRARIES_PATH = "REFERENCED_LIBRARIES_PATH" ;
70
66
private static final String REFERENCED_LIBRARIES_CONTAINER_NAME = "Referenced Libraries" ;
71
67
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" ;
74
68
public static final ContainerNode REFERENCED_LIBRARIES_CONTAINER = new ContainerNode (REFERENCED_LIBRARIES_CONTAINER_NAME , REFERENCED_LIBRARIES_PATH ,
75
69
NodeKind .CONTAINER , IClasspathEntry .CPE_CONTAINER );
76
70
public static final ContainerNode IMMUTABLE_REFERENCED_LIBRARIES_CONTAINER = new ContainerNode (IMMUTABLE_REFERENCED_LIBRARIES_CONTAINER_NAME ,
77
71
REFERENCED_LIBRARIES_PATH , NodeKind .CONTAINER , IClasspathEntry .CPE_CONTAINER );
78
72
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
+
79
85
/**
80
86
* The name of the PackageNode.
81
87
*/
@@ -158,10 +164,12 @@ public static PackageNode createNodeForProject(IJavaElement javaElement) {
158
164
PackageNode projectNode = new PackageNode (proj .getName (), proj .getFullPath ().toPortableString (), NodeKind .PROJECT );
159
165
projectNode .setUri (ProjectUtils .getProjectRealFolder (proj ).toFile ().toURI ().toString ());
160
166
try {
161
- projectNode . setMetaDataValue ( NATURE_ID , proj .getDescription ().getNatureIds ());
167
+ List < String > natureIds = new ArrayList <>( Arrays . asList ( proj .getDescription ().getNatureIds () ));
162
168
if (!ProjectUtils .isVisibleProject (proj )) {
169
+ natureIds .add (UNMANAGED_FOLDER_NATURE_ID );
163
170
projectNode .setMetaDataValue (UNMANAGED_FOLDER_INNER_PATH , proj .getLocationURI ().toString ());
164
171
}
172
+ projectNode .setMetaDataValue (NATURE_ID , natureIds );
165
173
} catch (CoreException e ) {
166
174
// do nothing
167
175
}
0 commit comments