File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Plugins/CSharpCompilerSettings Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 66using UnityEditor ;
77using UnityEngine ;
88using LVersion = Coffee . CSharpCompilerSettings . CSharpLanguageVersion ;
9+ using System . Collections . Generic ;
910
1011namespace Coffee . CSharpCompilerSettings
1112{
@@ -247,6 +248,30 @@ public static CscSettingsAsset CreateFromJson(string json = "")
247248 }
248249 }
249250
251+ if ( ! serializedJson . Contains ( "\" m_AnalyzerPackages\" :" ) )
252+ {
253+ var m = Regex . Match ( json , "\" m_AnalyzerPackages\" :\\ s*(\\ [[^\\ ]]+\\ ])" ) ;
254+ if ( m . Success )
255+ {
256+ var packages = new List < NugetPackage > ( ) ;
257+ foreach ( Match match in Regex . Matches ( m . Groups [ 1 ] . Value , "{[^}]+}" ) )
258+ {
259+ packages . Add ( JsonUtility . FromJson < NugetPackage > ( match . Value ) ) ;
260+ }
261+
262+ setting . m_AnalyzerPackages = packages . ToArray ( ) ;
263+ }
264+ }
265+
266+ if ( ! serializedJson . Contains ( "\" m_AnalyzerFilter\" :" ) )
267+ {
268+ var m = Regex . Match ( json , "\" m_AnalyzerFilter\" :\\ s*({[^}]+})" ) ;
269+ if ( m . Success )
270+ {
271+ setting . m_AnalyzerFilter = JsonUtility . FromJson < AssemblyFilter > ( m . Groups [ 1 ] . Value ) ;
272+ }
273+ }
274+
250275 return setting ;
251276 }
252277
You can’t perform that action at this time.
0 commit comments