From 3720f3d46b85788f07d3832ad4502d4c2ae14137 Mon Sep 17 00:00:00 2001 From: Sheng Chen Date: Fri, 5 Aug 2022 09:26:35 +0800 Subject: [PATCH] Address comments Signed-off-by: Sheng Chen --- .../internal/managers/InvisibleProjectImporter.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/InvisibleProjectImporter.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/InvisibleProjectImporter.java index db3719545a..451845d4c3 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/InvisibleProjectImporter.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/InvisibleProjectImporter.java @@ -181,8 +181,7 @@ public static boolean loadInvisibleProject(IPath javaFile, IPath rootPath, boole * Based on the trigger file and its belonging source folder, search more places and collect * the valid source paths. * @param triggerFilePath the path of the import trigger file. - * @param triggerFolder the folder which contains the trigger file. A search will be executed - * based on the trigger folder. + * @param triggerFolder the folder which is the source root of the trigger file. * @param linkedFolder the invisible project's linked folder. */ private static Collection collectSourcePaths(IPath triggerFilePath, IFolder triggerFolder, @@ -215,8 +214,7 @@ private static Collection collectSourcePaths(IPath triggerFilePath, IFold /** * Collect folders that may contain Java source files. * @param triggerFilePath the path of the import trigger file. - * @param triggerFolder the folder which contains the trigger file. A search will be executed - * based on the trigger folder. + * @param triggerFolder the folder which is the source root of the trigger file. * @param linkedFolderPath the path of invisible project's linked folder. */ private static Collection collectFoldersToSearch(IPath triggerFilePath, IFolder triggerFolder, @@ -248,9 +246,9 @@ private static Collection getDirectChildFolders(IPath triggerFilePath, IFo continue; } - Path eclipsePath = new Path(dir.getAbsolutePath()); + Path dirPath = new Path(dir.getAbsolutePath()); // skip ancestor folder of the trigger file. - if (eclipsePath.isPrefixOf(triggerFilePath)) { + if (dirPath.isPrefixOf(triggerFilePath)) { continue; } @@ -261,7 +259,7 @@ private static Collection getDirectChildFolders(IPath triggerFilePath, IFo /** * Get the sibling folders of the trigger folder. - * @param triggerFolder the trigger folder + * @param triggerFolder the folder which is the source root of the trigger file. * @param linkedFolderPath the path of invisible project's linked folder. */ private static Collection getSiblingFolders(IFolder triggerFolder, IPath linkedFolderPath) {