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 6
6
using UnityEditor ;
7
7
using UnityEngine ;
8
8
using LVersion = Coffee . CSharpCompilerSettings . CSharpLanguageVersion ;
9
+ using System . Collections . Generic ;
9
10
10
11
namespace Coffee . CSharpCompilerSettings
11
12
{
@@ -247,6 +248,30 @@ public static CscSettingsAsset CreateFromJson(string json = "")
247
248
}
248
249
}
249
250
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
+
250
275
return setting ;
251
276
}
252
277
You can’t perform that action at this time.
0 commit comments