From 1c8eb75b4f610941039eb29db014d46c07dbdb66 Mon Sep 17 00:00:00 2001 From: Dave Holoway Date: Wed, 17 Jun 2020 00:09:49 +0100 Subject: [PATCH] fix resolving imported enclosed types --- langserver/java/type-resolver.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/langserver/java/type-resolver.js b/langserver/java/type-resolver.js index c9335e5..31eddf5 100644 --- a/langserver/java/type-resolver.js +++ b/langserver/java/type-resolver.js @@ -311,10 +311,9 @@ function resolveTypeOrPackage(ident, type_variables, scope, imports, typemap) { } if (!types[0]) { - // is it a top-level type from the imports - const top_level_type = '/' + ident; + // is it a type from the imports for (let i of imports) { - const fqn = i.fullyQualifiedNames.find(fqn => fqn.endsWith(top_level_type)); + const fqn = i.fullyQualifiedNames.find(fqn => fqn.endsWith(ident) && /[$/]/.test(fqn[fqn.length-ident.length-1])); if (fqn) { types.push(i.types.get(fqn)); }