From d3e50c63d6b83619db26b9986ec8c2ab28e6473a Mon Sep 17 00:00:00 2001 From: m0rkeulv Date: Thu, 15 Feb 2024 16:59:44 +0100 Subject: [PATCH] honoring NoUsing meta when resolving extension methods. --- .../java/com/intellij/plugins/haxe/lang/psi/HaxeResolver.java | 3 ++- .../java/com/intellij/plugins/haxe/model/HaxeMethodModel.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/intellij/plugins/haxe/lang/psi/HaxeResolver.java b/src/main/java/com/intellij/plugins/haxe/lang/psi/HaxeResolver.java index 3f77b1524..6e545d051 100644 --- a/src/main/java/com/intellij/plugins/haxe/lang/psi/HaxeResolver.java +++ b/src/main/java/com/intellij/plugins/haxe/lang/psi/HaxeResolver.java @@ -933,7 +933,8 @@ private List resolveChain(HaxeReference lefthandExpression for (int i = usingModels.size() - 1; i >= 0; --i) { foundMethod = usingModels.get(i) .findExtensionMethod(identifier, leftExpression.getSpecificClassReference(reference, leftExpression.getGenericResolver())); - if (null != foundMethod) { + if (null != foundMethod && !foundMethod.HasNoUsingMeta()) { + reference.putUserData(isExtensionKey, true); if (log.isTraceEnabled()) log.trace("Found method in 'using' import: " + foundMethod.getName()); return asList(foundMethod.getBasePsi()); diff --git a/src/main/java/com/intellij/plugins/haxe/model/HaxeMethodModel.java b/src/main/java/com/intellij/plugins/haxe/model/HaxeMethodModel.java index d9c6e426d..91f9e58fc 100644 --- a/src/main/java/com/intellij/plugins/haxe/model/HaxeMethodModel.java +++ b/src/main/java/com/intellij/plugins/haxe/model/HaxeMethodModel.java @@ -244,5 +244,9 @@ public HaxeGenericResolver getGenericResolver(HaxeGenericResolver parentResolver } return resolver; } + + public boolean HasNoUsingMeta() { + return HaxeMetadataUtils.hasMeta(getBasePsi(), HaxeMeta.NO_USING); + } }