File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
resharper/resharper-unity/src/Unity/Utils Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 4
4
using JetBrains . ReSharper . Plugins . Unity . Core . ProjectModel ;
5
5
using JetBrains . ReSharper . Plugins . Unity . UnityEditorIntegration . Api ;
6
6
using JetBrains . ReSharper . Psi ;
7
+ using JetBrains . ReSharper . Psi . CSharp ;
7
8
using JetBrains . ReSharper . Psi . Impl . Reflection2 ;
8
9
using JetBrains . ReSharper . Psi . Modules ;
9
10
@@ -13,7 +14,8 @@ public static class DeclaredElementExtensions
13
14
{
14
15
public static bool IsFromUnityProject ( [ NotNull ] this IDeclaredElement element )
15
16
{
16
- return element . GetSourceFiles ( ) . Any ( sf => sf . GetProject ( ) . IsUnityProject ( ) ) ;
17
+ // GetSourceFiles may be heavy for C++ IDeclaredElement
18
+ return element . PresentationLanguage . Is < CSharpLanguage > ( ) && element . GetSourceFiles ( ) . Any ( sf => sf . GetProject ( ) . IsUnityProject ( ) ) ;
17
19
}
18
20
19
21
public static bool IsBuiltInUnityClass ( this IDeclaredElement element )
You can’t perform that action at this time.
0 commit comments