1 write to _writer
Microsoft.CodeAnalysis (1)
CommandLine\SarifErrorLogger.cs (1)
32_writer = new JsonWriter(new StreamWriter(stream));
169 references to _writer
Microsoft.CodeAnalysis (169)
CommandLine\SarifErrorLogger.cs (13)
43_writer.Dispose(); 49_writer.WriteObjectStart("region"); 50_writer.Write("startLine", span.StartLinePosition.Line + 1); 51_writer.Write("startColumn", span.StartLinePosition.Character + 1); 52_writer.Write("endLine", span.EndLinePosition.Line + 1); 53_writer.Write("endColumn", span.EndLinePosition.Character + 1); 54_writer.WriteObjectEnd(); // region 95_writer.WriteObjectStart("properties"); 99_writer.Write("warningLevel", diagnostic.WarningLevel); 104_writer.WriteObjectStart("customProperties"); 108_writer.Write(pair.Key, pair.Value); 111_writer.WriteObjectEnd(); 114_writer.WriteObjectEnd(); // properties
CommandLine\SarifV1ErrorLogger.cs (55)
36_writer.WriteObjectStart(); // root 37_writer.Write("$schema", "http://json.schemastore.org/sarif-1.0.0"); 38_writer.Write("version", "1.0.0"); 39_writer.WriteArrayStart("runs"); 40_writer.WriteObjectStart(); // run 42_writer.WriteObjectStart("tool"); 43_writer.Write("name", toolName); 44_writer.Write("version", toolAssemblyVersion.ToString()); 45_writer.Write("fileVersion", toolFileVersion); 46_writer.Write("semanticVersion", toolAssemblyVersion.ToString(fieldCount: 3)); 50_writer.Write("language", culture.Name); 52_writer.WriteObjectEnd(); // tool 54_writer.WriteArrayStart("results"); 61_writer.WriteObjectStart(); // result 62_writer.Write("ruleId", diagnostic.Id); 67_writer.Write("ruleKey", ruleKey); 70_writer.Write("level", GetLevel(diagnostic.Severity)); 75_writer.Write("message", message); 80_writer.WriteArrayStart("suppressionStates"); 81_writer.Write("suppressedInSource"); 82_writer.WriteArrayEnd(); 88_writer.WriteObjectEnd(); // result 95_writer.WriteArrayStart("locations"); 96_writer.WriteObjectStart(); // location 97_writer.WriteKey(PrimaryLocationPropertyName); 101_writer.WriteObjectEnd(); // location 102_writer.WriteArrayEnd(); // locations 112_writer.WriteArrayStart("relatedLocations"); 118_writer.WriteObjectStart(); // annotatedCodeLocation 119_writer.WriteKey("physicalLocation"); 123_writer.WriteObjectEnd(); // annotatedCodeLocation 127_writer.WriteArrayEnd(); // relatedLocations 142_writer.WriteObjectStart(); 143_writer.Write("uri", GetUri(span.Path)); 147_writer.WriteObjectEnd(); 154_writer.WriteObjectStart("rules"); 160_writer.WriteObjectStart(pair.Key); // rule 161_writer.Write("id", descriptor.Id); 166_writer.Write("shortDescription", shortDescription); 172_writer.Write("fullDescription", fullDescription); 175_writer.Write("defaultLevel", GetLevel(descriptor.DefaultSeverity)); 179_writer.Write("helpUri", descriptor.HelpLinkUri); 182_writer.WriteObjectStart("properties"); 186_writer.Write("category", descriptor.Category); 189_writer.Write("isEnabledByDefault", descriptor.IsEnabledByDefault); 193_writer.WriteArrayStart("tags"); 197_writer.Write(tag); 200_writer.WriteArrayEnd(); // tags 203_writer.WriteObjectEnd(); // properties 204_writer.WriteObjectEnd(); // rule 207_writer.WriteObjectEnd(); // rules 213_writer.WriteArrayEnd(); // results 217_writer.WriteObjectEnd(); // run 218_writer.WriteArrayEnd(); // runs 219_writer.WriteObjectEnd(); // root
CommandLine\SarifV2ErrorLogger.cs (101)
45_writer.WriteObjectStart(); // root 46_writer.Write("$schema", "http://json.schemastore.org/sarif-2.1.0"); 47_writer.Write("version", "2.1.0"); 48_writer.WriteArrayStart("runs"); 49_writer.WriteObjectStart(); // run 51_writer.WriteArrayStart("results"); 58_writer.WriteObjectStart(); // result 59_writer.Write("ruleId", diagnostic.Id); 61_writer.Write("ruleIndex", ruleIndex); 63_writer.Write("level", GetLevel(diagnostic.Severity)); 68_writer.WriteObjectStart("message"); 69_writer.Write("text", message); 70_writer.WriteObjectEnd(); 77_writer.WriteArrayStart("suppressions"); 78_writer.WriteObjectStart(); // suppression 79_writer.Write("kind", "inSource"); 83_writer.Write("justification", justification); 102_writer.WriteObjectStart("properties"); 104_writer.Write("suppressionType", suppressionType); 106_writer.WriteObjectEnd(); // properties 109_writer.WriteObjectEnd(); // suppression 110_writer.WriteArrayEnd(); 117_writer.WriteObjectEnd(); // result 134_writer.WriteArrayStart("locations"); 135_writer.WriteObjectStart(); // location 136_writer.WriteKey(PrimaryLocationPropertyName); 140_writer.WriteObjectEnd(); // location 141_writer.WriteArrayEnd(); // locations 151_writer.WriteArrayStart("relatedLocations"); 157_writer.WriteObjectStart(); // annotatedCodeLocation 158_writer.WriteKey("physicalLocation"); 162_writer.WriteObjectEnd(); // annotatedCodeLocation 166_writer.WriteArrayEnd(); // relatedLocations 176_writer.WriteObjectStart(); // physicalLocation 178_writer.WriteObjectStart("artifactLocation"); 179_writer.Write("uri", GetUri(span.Path)); 180_writer.WriteObjectEnd(); // artifactLocation 184_writer.WriteObjectEnd(); 189_writer.WriteArrayEnd(); //results 193_writer.WriteObjectStart("properties"); 195_writer.Write("analyzerExecutionTime", _totalAnalyzerExecutionTime); 197_writer.WriteObjectEnd(); // properties 202_writer.Write("columnKind", "utf16CodeUnits"); 204_writer.WriteObjectEnd(); // run 205_writer.WriteArrayEnd(); // runs 206_writer.WriteObjectEnd(); // root 212_writer.WriteObjectStart("tool"); 213_writer.WriteObjectStart("driver"); 214_writer.Write("name", _toolName); 215_writer.Write("version", _toolFileVersion); 216_writer.Write("dottedQuadFileVersion", _toolAssemblyVersion.ToString()); 217_writer.Write("semanticVersion", _toolAssemblyVersion.ToString(fieldCount: 3)); 221_writer.Write("language", _culture.Name); 224_writer.WriteObjectEnd(); // driver 225_writer.WriteObjectEnd(); // tool 236_writer.WriteArrayStart("rules"); 241_writer.WriteObjectStart(); // rule 242_writer.Write("id", descriptor.Id); 247_writer.WriteObjectStart("shortDescription"); 248_writer.Write("text", shortDescription); 249_writer.WriteObjectEnd(); 255_writer.WriteObjectStart("fullDescription"); 256_writer.Write("text", fullDescription); 257_writer.WriteObjectEnd(); 264_writer.Write("helpUri", descriptor.HelpLinkUri); 281_writer.WriteObjectStart("properties"); 285_writer.Write("category", descriptor.Category); 290_writer.Write("isEverSuppressed", "true"); 292_writer.WriteArrayStart("suppressionKinds"); 296_writer.Write("external"); 301_writer.Write("inSource"); 304_writer.WriteArrayEnd(); // suppressionKinds 310_writer.Write("executionTimeInSeconds", executionTime); 313_writer.Write("executionTimeInPercentage", executionPercentage); 318_writer.WriteArrayStart("tags"); 322_writer.Write(tag); 325_writer.WriteArrayEnd(); // tags 328_writer.WriteObjectEnd(); // properties 331_writer.WriteObjectEnd(); // rule 342_writer.WriteArrayEnd(); // rules 375_writer.WriteArrayStart("invocations"); 376_writer.WriteObjectStart(); // invocation 381_writer.Write("executionSuccessful", true); 383_writer.WriteArrayStart("ruleConfigurationOverrides"); 391_writer.WriteObjectStart(); // ruleConfigurationOverride 393_writer.WriteObjectStart("descriptor"); 394_writer.Write("id", id); 395_writer.Write("index", index); 396_writer.WriteObjectEnd(); // descriptor 400_writer.WriteObjectStart("configuration"); 404_writer.Write("enabled", false); 409_writer.Write("level", level); 411_writer.WriteObjectEnd(); // configuration 413_writer.WriteObjectEnd(); // ruleConfigurationOverride 417_writer.WriteArrayEnd(); // ruleConfigurationOverrides 419_writer.WriteObjectEnd(); // invocation 420_writer.WriteArrayEnd(); // invocations 435_writer.WriteObjectStart("defaultConfiguration"); 439_writer.Write("level", defaultLevel); 444_writer.Write("enabled", descriptor.IsEnabledByDefault); 447_writer.WriteObjectEnd(); // defaultConfiguration