Skip to content

Commit d3653b0

Browse files
akarpov89intellij-monorepo-bot
authored andcommitted
RSRP-500888 Long Delay in Resolving Candidate Symbols
Fixes RSRP-500888 Using of annotation provider on a hot path from code completion caused lots of unnecessary and expensive computation (especially `TypeElementUtil.GetAllSuperTypes`). This commit removes the `EmbeddedAnnotationProvider` altogether, and replaces its usage with direct call to `HasAttributeInstance` which is actually super fast on type elements. This commit also changes the API itself: from `DeclaredElementExtensions.IsInternalsVisibleToApplies(this IDeclaredElement, IPsiModule)` to `AccessUtil.IsInternalSymbolAccessible(ITypeMember, IPsiModule)` GitOrigin-RevId: e62a6e0fba186f7705e9cb7ecb15a88b3088935f
1 parent 31d42f9 commit d3653b0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ReSharper.FSharp/src/FSharp/FSharp.Psi/src/IFSharpDeclaredElement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface IFSharpDeclaredElement : IClrDeclaredElement
1515
string SourceName { get; }
1616
}
1717

18-
public interface IFSharpTypeElement : IFSharpDeclaredElement, ITypeElement, IAccessRightsOwner
18+
public interface IFSharpTypeElement : IFSharpDeclaredElement, ITypeElement, ITypeMember
1919
{
2020
ModuleMembersAccessKind AccessKind { get; }
2121
}

ReSharper.FSharp/src/FSharp/FSharp.Psi/src/Impl/FSharpAccessRights.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using JetBrains.ReSharper.Psi;
1313
using JetBrains.ReSharper.Psi.Modules;
1414
using JetBrains.ReSharper.Psi.Tree;
15+
using JetBrains.ReSharper.Psi.Util;
1516

1617
namespace JetBrains.ReSharper.Plugins.FSharp.Psi.Impl;
1718

@@ -160,7 +161,7 @@ public static bool IsAccessible(ITypeElement typeElement, ITreeNode context)
160161
if (accessRights == AccessRights.PRIVATE && !IsTheSameOwner(fsTypeElement, context))
161162
return false;
162163

163-
if (accessRights == AccessRights.INTERNAL && !typeElement.IsInternalsVisibleToApplies(context.GetPsiModule()))
164+
if (accessRights == AccessRights.INTERNAL && !AccessUtil.IsInternalSymbolAccessible(fsTypeElement, context.GetPsiModule()))
164165
return false;
165166

166167
if (fsTypeElement is IFSharpSourceTypeElement fsSourceTypeElement)

0 commit comments

Comments
 (0)