Skip to content

Commit 7ab7d98

Browse files
feat(jdtls): add PomPath to metadata
1 parent cdd4a27 commit 7ab7d98

File tree

1 file changed

+6
-0
lines changed
  • jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/model

1 file changed

+6
-0
lines changed

jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/model/PackageNode.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ public class PackageNode {
8888

8989
private static final String MAX_SOURCE_VERSION = "MaxSourceVersion";
9090

91+
private static final String POM_PATH = "PomPath";
92+
9193
/**
9294
* The name of the PackageNode.
9395
*/
@@ -181,6 +183,10 @@ public static PackageNode createNodeForProject(IJavaElement javaElement) {
181183
int jdkLevel = (int) (CompilerOptions.versionToJdkLevel(sourceVersion, true) >>> 16);
182184
int majorVersion = Math.max(0, jdkLevel - ClassFileConstants.MAJOR_VERSION_0);
183185
projectNode.setMetaDataValue(MAX_SOURCE_VERSION, majorVersion);
186+
IFile existingPom = proj.getFile("pom.xml");
187+
if (existingPom.exists()) {
188+
projectNode.setMetaDataValue(POM_PATH, existingPom.getLocation().toOSString());
189+
}
184190
} catch (CoreException e) {
185191
// do nothing
186192
}

0 commit comments

Comments
 (0)