1
1
using JetBrains . Application . Settings ;
2
2
using JetBrains . Collections . Viewable ;
3
+ using JetBrains . DataFlow ;
4
+ using JetBrains . Lifetimes ;
3
5
using JetBrains . ProjectModel ;
6
+ using JetBrains . ProjectModel . DataContext ;
4
7
using JetBrains . ReSharper . Plugins . Unity . ProjectModel ;
5
8
using JetBrains . ReSharper . Plugins . Unity . Settings ;
6
9
using JetBrains . ReSharper . Psi . Cpp . Tree ;
@@ -10,18 +13,30 @@ namespace JetBrains.ReSharper.Plugins.Unity.HlslSupport.Daemon
10
13
[ SolutionComponent ]
11
14
public class UnityHlslAllErrorsPredicate : IHlslUnresolvedUnqualifiedNamesErrorsPredicate {
12
15
private readonly UnitySolutionTracker myUnitySolutionTracker ;
16
+ private readonly IProperty < bool > mySuppressShaderErrors ;
17
+ private readonly IProperty < bool > mySuppressShaderErrorsInRenderPipeline ;
13
18
14
- public UnityHlslAllErrorsPredicate ( UnitySolutionTracker unitySolutionTracker )
19
+ public UnityHlslAllErrorsPredicate ( Lifetime lifetime , ISolution solution , UnitySolutionTracker unitySolutionTracker , ISettingsStore settingsStore )
15
20
{
16
21
myUnitySolutionTracker = unitySolutionTracker ;
22
+ mySuppressShaderErrors = settingsStore . BindToContextLive ( lifetime , ContextRange . Smart ( solution . ToDataContext ( ) ) )
23
+ . GetValueProperty ( lifetime , ( UnitySettings key ) => key . SuppressShaderErrorHighlighting ) ;
24
+ mySuppressShaderErrorsInRenderPipeline = settingsStore . BindToContextLive ( lifetime , ContextRange . Smart ( solution . ToDataContext ( ) ) )
25
+ . GetValueProperty ( lifetime , ( UnitySettings key ) => key . SuppressShaderErrorHighlightingInRenderPipelinePackages ) ;
17
26
}
18
27
19
28
public bool SuppressUnresolvedErrors ( CppFile cppFile , IContextBoundSettingsStore settingsStore )
20
29
{
21
30
if ( ! myUnitySolutionTracker . IsUnityProject . HasTrueValue ( ) )
22
31
return false ;
23
32
24
- return settingsStore . GetValue ( ( UnitySettings k ) => k . SuppressShaderErrorHighlighting ) ;
33
+ if ( mySuppressShaderErrorsInRenderPipeline . Value )
34
+ {
35
+ var location = cppFile . File ;
36
+ if ( location . FullPath . Contains ( ".render-pipelines" ) )
37
+ return true ;
38
+ }
39
+ return mySuppressShaderErrors . Value ;
25
40
}
26
41
27
42
public bool SuppressUnresolvedUnqualifiedErrors ( CppFile cppFile , IContextBoundSettingsStore settingsStore )
0 commit comments