16563 references to Length
AnalyzerRunner (5)
aspire (84)
Aspire.Azure.Messaging.ServiceBus (3)
Aspire.Azure.Npgsql (1)
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL (1)
Aspire.Cli.EndToEnd.Tests (3)
Aspire.Cli.Tests (11)
Aspire.Dashboard (343)
Aspire.Dashboard.Components.Tests (3)
Aspire.Dashboard.Tests (13)
Model\AIAssistant\AIHelpersTests.cs (5)
76var result = AIHelpers.TryGetSingleResult(items, x => x.Length == 3, out var value);
108var (items, message) = SharedAIHelpers.GetLimitFromEndWithSummary(values, totalValues: values.Count, limit: 20, "test item", "test items", s => s, s => ((string)s).Length);
126var (items, message) = SharedAIHelpers.GetLimitFromEndWithSummary(values, totalValues: 100, limit: 20, "test item", "test items", s => s, s => ((string)s).Length);
144var (items, message) = SharedAIHelpers.GetLimitFromEndWithSummary(values, totalValues: 100, limit: 5, "test item", "test items", s => s, s => ((string)s).Length);
169var (items, message) = SharedAIHelpers.GetLimitFromEndWithSummary(values, limit: 10, "test item", "test items", s => s, s => ((string)s).Length);
Aspire.Deployment.EndToEnd.Tests (9)
Aspire.EndToEnd.Tests (1)
Aspire.Hosting (206)
Aspire.Hosting.Analyzers (4)
Aspire.Hosting.Analyzers.Tests (1)
Aspire.Hosting.Azure (14)
Aspire.Hosting.Azure.AppContainers (1)
Aspire.Hosting.Azure.AppService (1)
Aspire.Hosting.Azure.Functions (7)
Aspire.Hosting.Azure.KeyVault (1)
Aspire.Hosting.CodeGeneration.Go (1)
Aspire.Hosting.CodeGeneration.Java (2)
Aspire.Hosting.CodeGeneration.Python (1)
Aspire.Hosting.CodeGeneration.Rust (1)
Aspire.Hosting.CodeGeneration.TypeScript (2)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
Aspire.Hosting.DevTunnels (5)
Aspire.Hosting.Docker (3)
Aspire.Hosting.GitHub.Models (2)
Aspire.Hosting.JavaScript (1)
Aspire.Hosting.Kubernetes (1)
Aspire.Hosting.Maui (3)
Aspire.Hosting.OpenAI (6)
Aspire.Hosting.Orleans (1)
Aspire.Hosting.RabbitMQ (4)
Aspire.Hosting.SqlServer.Tests (1)
Aspire.Hosting.Testing (4)
Aspire.Hosting.Testing.Tests (7)
Aspire.Hosting.Tests (22)
Dashboard\DashboardServiceTests.cs (7)
67l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length),
68l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length));
72l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length),
120l => Assert.Equal(DashboardServiceImpl.LogMaxBatchCharacters, l.Text.Length));
124l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length),
125l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length));
129l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length));
Aspire.Playground.Tests (5)
Aspire.Templates.Tests (1)
Aspire.TestUtilities (1)
aspire-server (2)
BasicWebSite (1)
BasketService (24)
BoundTreeGenerator (1)
BuildActionTelemetryTable (4)
BuildBoss (3)
BuildValidator (2)
ClientSample (7)
CodeGenerator (35)
ConfigurationSchemaGenerator (6)
Crossgen2Tasks (3)
csc (3)
CSharpSyntaxGenerator (9)
CustomPolicyProvider (2)
DemoConsole (1)
DevTunnels.ApiService (1)
Diagnostics.EFCore.FunctionalTests (3)
dotnet-dev-certs (9)
dotnet-getdocument (7)
dotnet-openapi (7)
dotnet-razorpagegenerator (6)
dotnet-sql-cache (7)
dotnet-svcutil.xmlserializer (17)
dotnet-svcutil-lib (1398)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (38)
476if (url == null || url.Length == 0)
516if (context == null || context.BaseURI == null || context.BaseURI.Length == 0)
583if (url.Length == 0)
614if (context.BaseURI != null && context.BaseURI.Length > 0 &&
617if (baseUriStr.Length > 0)
707if (context.BaseURI != null && context.BaseURI.Length > 0 &&
710if (baseUriStr.Length > 0)
2439if (_ps.baseUriStr.Length > 0 && _ps.baseUri == null && _xmlResolver != null)
2656Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0));
2692RegisterConsumedCharacters(internalDtd.Length, false);
3030int len = str.Length;
3032str.CopyTo(0, _ps.chars, 0, str.Length);
3133Debug.Assert(_url != null && _url.Length > 0);
4462if (prefixLen == _lastPrefix.Length && XmlConvert.StrEqual(chars, startPos, prefixLen, _lastPrefix))
4605string qname = (prefix.Length == 0) ? defaultAttributeInfo.LocalName : (prefix + ':' + defaultAttributeInfo.LocalName);
4625int prefLen = startTagNode.prefix.Length;
4626int locLen = startTagNode.localName.Length;
4638if (startTagNode.prefix.Length == 0)
5030if (attr.prefix.Length == 0)
5091if (_curNode.prefix.Length == 0)
5106if (at.type == XmlNodeType.Attribute && at.prefix.Length > 0)
5177if (ns.Length == 0)
6305_curNode.lineInfo.linePos += _curNode.localName.Length;
7825if (prefixLen == _lastPrefix.Length && XmlConvert.StrEqual(_ps.chars, startPos, prefixLen, _lastPrefix))
7944if (uri.Length == 0 && prefix.Length > 0)
7958if (prefix.Length == 0)
8188RegisterConsumedCharacters(entity.Text.Length, true);
8958if (Ref.Equal(_nodes[i].localName, name) && _nodes[i].prefix.Length == 0)
9316if (defAttrInfo.Prefix.Length > 0)
9369if (prefix.Length == 0 && ns.Length > 0)
9405NodeData attr = AddAttribute(localName, prefix, prefix.Length > 0 ? null : localName);
9417if (attr.prefix.Length == 0)
9427if (_nodes[_index].prefix.Length == 0)
9701Debug.Assert(endPos < str.Length);
9745int len = value.Length;
FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (23)
281if (docTypeName == null || docTypeName.Length == 0)
301if (systemId != null && systemId.Length > 0)
311if (publicId != null && publicId.Length > 0)
321if (internalSubset != null && internalSubset.Length > 0)
481if (_systemId != null && _systemId.Length > 0)
496if (_systemId != null && _systemId.Length > 0)
694if (attrDef != null && attrDef.Prefix.Length > 0 && attrDef.Prefix.Equals("xml") && attrDef.Name.Name == "space")
718if (attrDef.Prefix.Length > 0 && attrDef.Prefix.Equals("xml"))
956SendValidationEvent(_curPos - name.Name.Length, XmlSeverityType.Error, ResXml.Sch_DupElementDecl, GetNameString());
1240entity.DeclaredURI = (_externalDtdBaseUri.Length == 0) ? _documentBaseUri : _externalDtdBaseUri;
1344SendValidationEvent(_curPos - notationName.Name.Length, XmlSeverityType.Error, ResXml.Sch_DupNotation, notationName.Name);
1377UndeclaredNotation un = new UndeclaredNotation(notationName, LineNo, LinePos - notationName.Length);
1507Throw(_curPos - systemId.Length - 1, ResXml.Xml_FragmentId, new string[] { systemId.Substring(systemId.IndexOf('#')), systemId });
1525ThrowInvalidChar(_curPos - 1 - publicId.Length + i, publicId, i);
3333Throw(_curPos - entityName.Name.Length - 1, ResXml.Xml_InvalidParEntityRef);
3343Throw(_curPos - entityName.Name.Length - 1, paramEntity ? ResXml.Xml_RecursiveParEntity : ResXml.Xml_RecursiveGenEntity, entityName.Name);
3357if (entity.Text.Length == 0)
3436SendValidationEvent(_curPos - entityName.Name.Length - 1, XmlSeverityType.Error, ResXml.Xml_UndeclaredParEntity, entityName.Name);
3445SendValidationEvent(_curPos - entityName.Name.Length - 1, XmlSeverityType.Error, ResXml.Xml_UndeclaredEntity, entityName.Name);
3450Throw(_curPos - entityName.Name.Length - 1, ResXml.Xml_UndeclaredEntity, entityName.Name);
3458Throw(_curPos - entityName.Name.Length - 1, ResXml.Xml_UnparsedEntityRef, entityName.Name);
3463Throw(_curPos - entityName.Name.Length - 1, ResXml.Xml_ExternalEntityInAttValue, entityName.Name);
3624int len = value.Length;
FrameworkFork\Microsoft.Xml\Xml\schema\Inference\infer.cs (62)
270if (ns.Length != 0)
346if (childURI.Length == 0)
362if (childURI.Length != 0)
366if (prefix.Length != 0 && String.Compare(prefix, "xml", StringComparison.OrdinalIgnoreCase) != 0)
377if (childURI.Length != 0) //BUGBUG It need not be an attribute reference if there is a namespace, it can be attribute with attributeFormDefault = qualified
487if (childURI.Length != 0)
502Debug.Assert(targetNS == null || targetNS.Length > 0, "targetns for schema is empty");
557if (prefix.Length != 0)
1065if (childURI.Length == 0)
1442if (attr.RefName.Name.Length == 0)
1771if (s.Length == 0) return TF_string;
1798if (i == s.Length)
1817i++; if (i == s.Length) return TF_decimal | TF_float | TF_double | TF_string; //"9999.9" was matched
1830i++; if (i == s.Length) return TF_string;
1843i++; if (i == s.Length) return TF_string; //".9999e+" was matched
1849i++; if (i == s.Length) return TF_float | TF_double | TF_string; //".9999e+99" was matched
1856i++; if (i == s.Length) return TF_string;
1872i++; if (i == s.Length) return TF_string;
1886i++; if (i == s.Length) return TF_string;
1897i++; if (i == s.Length) return TF_string; //"P999" was matched
1914if (i == s.Length)
1930i++; if (i == s.Length) return TF_string; //"P999Y9" was matched
1945if (i == s.Length)
1961i++; if (i == s.Length) return TF_string; //"P999Y999M9" was matched
1974if (i == s.Length)
1987i++; if (i == s.Length) return TF_string; //"P999Y999M9999DT" was matched
1993i++; if (i == s.Length) return TF_string; //"___T9" was matched
2012if (i == s.Length)
2022i++; if (i == s.Length) return TF_string; //"___T999H9" was matched
2039if (i == s.Length)
2049i++; if (i == s.Length) return TF_string; //"___T999H999M9" was matched
2064if (i == s.Length)
2074i++; if (i == s.Length) return TF_string; //"___T999H999M999.9" was matched
2087if (i == s.Length)
2105if (i == s.Length)
2136if (i == s.Length)
2165if (i == s.Length)
2190if (i == s.Length)
2218i++; if (i == s.Length) return TF_string; //"9999-"
2221i++; if (i == s.Length) return TF_string; //"9999-9"
2225if (i == s.Length)
2245i++; if (i == s.Length) return TF_string; //"9999-99-"
2248i++; if (i == s.Length) return TF_string; //"9999-99-9"
2251i++; if (i == s.Length) return DateTime(s, bDate, bTime); //"9999-99-99"
2271if (i == s.Length)
2286i++; if (i == s.Length) return TF_string;
2289i++; if (i == s.Length) return TF_string;
2292i++; if (i == s.Length) return TF_string;
2296i++; if (i == s.Length) return TF_string;
2299i++; if (i == s.Length) return TF_string;
2303if (i == s.Length)
2317i++; if (i == s.Length) return TF_string;
2320i++; if (i == s.Length) return TF_string;
2323i++; if (i == s.Length) return TF_string;
2327i++; if (i == s.Length) return TF_string;
2330i++; if (i == s.Length) return TF_string;
2333i++; if (i == s.Length) return TF_string;
2336i++; if (i == s.Length) return TF_string;
2339i++; if (i == s.Length) return TF_string;
2342i++; if (i == s.Length) return DateTime(s, bDate, bTime);
2357i++; if (i == s.Length) return TF_string;
2361i++; if (i == s.Length) return DateTime(s, bDate, bTime);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlWriterDelegator.cs (1)
85if (ns.Length == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\OperationDescription.cs (1)
43if (name.Length == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\MessageContractMemberAttribute.cs (1)
31if (value.Length > 0)
FrameworkFork\System.Web.Services\Services\Description\ServiceDescriptionSerializer.cs (80)
681if ((((global::System.String)o.@Encoding) != null) && (((global::System.String)o.@Encoding).Length != 0))
730if ((((global::System.String)o.@Encoding) != null) && (((global::System.String)o.@Encoding).Length != 0))
1141if ((((global::System.String)o.@Namespace) != null) && (((global::System.String)o.@Namespace).Length != 0))
1145if ((((global::System.String)o.@Encoding) != null) && (((global::System.String)o.@Encoding).Length != 0))
1181if ((((global::System.String)o.@Namespace) != null) && (((global::System.String)o.@Namespace).Length != 0))
1185if ((((global::System.String)o.@Encoding) != null) && (((global::System.String)o.@Encoding).Length != 0))
1223if ((((global::System.String)o.@Encoding) != null) && (((global::System.String)o.@Encoding).Length != 0))
1227if ((((global::System.String)o.@Namespace) != null) && (((global::System.String)o.@Namespace).Length != 0))
1265if ((((global::System.String)o.@Encoding) != null) && (((global::System.String)o.@Encoding).Length != 0))
1269if ((((global::System.String)o.@Namespace) != null) && (((global::System.String)o.@Namespace).Length != 0))
1306if ((((global::System.String)o.@Encoding) != null) && (((global::System.String)o.@Encoding).Length != 0))
1310if ((((global::System.String)o.@Namespace) != null) && (((global::System.String)o.@Namespace).Length != 0))
1348if ((((global::System.String)o.@Encoding) != null) && (((global::System.String)o.@Encoding).Length != 0))
1352if ((((global::System.String)o.@Namespace) != null) && (((global::System.String)o.@Namespace).Length != 0))
1841if ((((global::System.String)o.@ParameterOrderString) != null) && (((global::System.String)o.@ParameterOrderString).Length != 0))
2861if ((((global::System.String)o.@Name) != null) && (((global::System.String)o.@Name).Length != 0))
3006if ((((global::System.String)o.@XPath) != null) && (((global::System.String)o.@XPath).Length != 0))
5245((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
5348((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
5434((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
5712((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
5806((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
5909((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
6166((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
7196((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
7837((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
7925((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8019((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8101((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8183((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8261((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8352((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8425((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8538((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8660((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8760((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8838((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8918((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
8996((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
9085((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
9197((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
9289((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
9393((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
9483((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
9623((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
9710((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
9797((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
9884((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
9971((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
10058((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
10145((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
10232((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
10319((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
10406((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
10493((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
10580((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
10662((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
10858((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
10968((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
11059((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
11142((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
11234((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
11346((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
11477((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
11569((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
11681((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
11769((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
11886((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
11963((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
12056((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
12153((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
12301((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
12394((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
12510((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
12625((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
12732((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
12815((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
12917((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
12999((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
13081((Microsoft.Xml.Serialization.XmlSerializerNamespaces)o.@Namespaces).Add(Reader.Name.Length == 5 ? "" : Reader.LocalName, Reader.Value);
dotnet-svcutil-lib.Tests (3)
dotnet-user-jwts (11)
dotnet-user-secrets (7)
EventSourceGenerator (1)
GenerateAnalyzerNuspec (12)
GenerateDocumentationAndConfigFiles (198)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
391if (name.Length > 0)
GenerateRulesMissingDocumentation (1)
GenericHostWebSite (1)
GetDocument.Insider (7)
HelixTestRunner (1)
http2cat (14)
HttpStress (7)
IdeBenchmarks (2)
IdeCoreBenchmarks (4)
IIS.Common.TestLib (1)
IIS.FunctionalTests (28)
IIS.LongTests (14)
IIS.NewHandler.FunctionalTests (14)
IIS.ShadowCopy.Tests (3)
IISExpress.FunctionalTests (26)
illink (34)
ILLink.RoslynAnalyzer (28)
ILLink.Tasks (4)
InMemory.FunctionalTests (48)
InProcessWebSite (8)
installer.tasks (2)
IntegrationTestsWebsite (16)
InteractiveHost.UnitTests (3)
Interop.FunctionalTests (7)
InteropClient (14)
InteropWebsite (12)
IOperationGenerator (4)
Kestrel.SampleApp (1)
Metrics (193)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
Metrics.Legacy (193)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
Microsoft.Analyzers.Extra (4)
Microsoft.Analyzers.Extra.Tests (2)
Microsoft.Analyzers.Local (3)
Microsoft.Analyzers.Local.Tests (2)
Microsoft.Arcade.Common (9)
Microsoft.Arcade.Test.Common (1)
Microsoft.AspNetCore (1)
Microsoft.AspNetCore.Analyzer.Testing (1)
Microsoft.AspNetCore.Antiforgery (9)
Microsoft.AspNetCore.App.Analyzers (24)
Microsoft.AspNetCore.App.Analyzers.Test (7)
Microsoft.AspNetCore.App.UnitTests (5)
Microsoft.AspNetCore.Authentication.BearerToken (1)
Microsoft.AspNetCore.Authentication.Cookies (7)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
Microsoft.AspNetCore.Authentication.Negotiate (5)
Microsoft.AspNetCore.Authentication.OpenIdConnect (3)
Microsoft.AspNetCore.Authentication.Test (3)
Microsoft.AspNetCore.Components (52)
Microsoft.AspNetCore.Components.Endpoints (18)
Microsoft.AspNetCore.Components.Endpoints.Tests (11)
Binding\FormDataMapperTests.cs (6)
2011var expected = new FormFileCollection { new FormFile(new MemoryStream(Encoding.UTF8.GetBytes(expectedString)), 0, expectedString.Length, "file", "file.txt") };
2028Assert.Equal(expectedString.Length, browserFile.Size);
2042new FormFile(new MemoryStream(Encoding.UTF8.GetBytes(expectedString1)), 0, expectedString1.Length, "file", "file1.txt"),
2043new FormFile(new MemoryStream(Encoding.UTF8.GetBytes(expectedString2)), 0, expectedString2.Length, "file", "file2.txt")
2063Assert.Equal(expectedString1.Length, browserFile1.Size);
2070Assert.Equal(expectedString2.Length, browserFile2.Size);
Microsoft.AspNetCore.Components.QuickGrid (3)
Microsoft.AspNetCore.Components.Server (3)
Microsoft.AspNetCore.Components.Server.Tests (1)
Microsoft.AspNetCore.Components.Web (3)
Microsoft.AspNetCore.Components.WebAssembly (4)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Microsoft.AspNetCore.Components.WebView (2)
Microsoft.AspNetCore.Components.WebView.Test (1)
Microsoft.AspNetCore.Components.WebViewE2E.Test (1)
Microsoft.AspNetCore.CookiePolicy.Test (6)
Microsoft.AspNetCore.Cryptography.Internal (1)
Microsoft.AspNetCore.Cryptography.Internal.Tests (12)
Microsoft.AspNetCore.Cryptography.KeyDerivation (5)
Microsoft.AspNetCore.DataProtection (4)
Microsoft.AspNetCore.DataProtection.Abstractions (6)
Microsoft.AspNetCore.DataProtection.Tests (2)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (2)
Microsoft.AspNetCore.Diagnostics (4)
Microsoft.AspNetCore.Grpc.JsonTranscoding (29)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (76)
Microsoft.AspNetCore.Grpc.Microbenchmarks (16)
Microsoft.AspNetCore.Grpc.Swagger (15)
Microsoft.AspNetCore.Grpc.Swagger.Tests (76)
Microsoft.AspNetCore.HeaderParsing (1)
Microsoft.AspNetCore.HostFiltering (1)
Microsoft.AspNetCore.Hosting (5)
Microsoft.AspNetCore.Hosting.FunctionalTests (1)
Microsoft.AspNetCore.Http (14)
Microsoft.AspNetCore.Http.Abstractions (29)
Microsoft.AspNetCore.Http.Abstractions.Tests (5)
Microsoft.AspNetCore.Http.Connections (6)
Microsoft.AspNetCore.Http.Connections.Client (1)
Microsoft.AspNetCore.Http.Extensions (17)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (4)
Microsoft.AspNetCore.Http.Results (3)
Microsoft.AspNetCore.HttpLogging (6)
Microsoft.AspNetCore.HttpLogging.Tests (16)
FileLoggerProcessorTests.cs (16)
49await WaitForFile(filePath, _messageOne.Length).DefaultTimeout();
88await WaitForFile(filePathToday, _messageOne.Length).DefaultTimeout();
95await WaitForFile(filePathTomorrow, _messageTwo.Length).DefaultTimeout();
135await WaitForFile(filePath2, _messageTwo.Length).DefaultTimeout();
178await WaitForFile(lastFilePath, _messageOne.Length).DefaultTimeout();
233await WaitForFile(lastFilePath, _messageOne.Length).DefaultTimeout();
292await WaitForFile(filePath, _messageOne.Length).DefaultTimeout();
305await WaitForFile(filePath, _messageOne.Length).DefaultTimeout();
327await WaitForFile(GetLogFilePath(path, options.FileName, _today, 6), _messageOne.Length).DefaultTimeout();
378await WaitForFile(filePath2, _messageTwo.Length).DefaultTimeout();
389await WaitForFile(filePath3, _messageThree.Length).DefaultTimeout();
444await WaitForFile(filePath3, _messageThree.Length).DefaultTimeout();
455await WaitForFile(filePath4, _messageFour.Length).DefaultTimeout();
510await WaitForFile(filePath1, _messageOne.Length).DefaultTimeout();
525await WaitForFile(filePath2, _messageTwo.Length).DefaultTimeout();
558if (File.ReadAllText(filePath).Length >= length)
Microsoft.AspNetCore.HttpOverrides (2)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
Microsoft.AspNetCore.Identity.InMemory.Test (1)
Microsoft.AspNetCore.Identity.UI (4)
Microsoft.AspNetCore.InternalTesting (11)
Microsoft.AspNetCore.InternalTesting.Tests (9)
Microsoft.AspNetCore.JsonPatch (3)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (3)
Microsoft.AspNetCore.Localization (2)
Microsoft.AspNetCore.Localization.Tests (1)
Microsoft.AspNetCore.Mvc.Abstractions (11)
Microsoft.AspNetCore.Mvc.Abstractions.Test (17)
ModelBinding\ModelStateDictionaryTest.cs (11)
327var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
757var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
816var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
860var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
890var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
918var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
980var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
1004var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
1094var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
1119var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
1194var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
Microsoft.AspNetCore.Mvc.Api.Analyzers (12)
Microsoft.AspNetCore.Mvc.Core (80)
Microsoft.AspNetCore.Mvc.Core.Test (22)
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (7)
162ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
185ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
208ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
231ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
254ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
421ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
642ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
ModelBinding\Metadata\DefaultValidationMetadataProviderTest.cs (5)
17var key = ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string));
37var key = ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string));
116var key = ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string));
135var key = ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string));
154var key = ModelMetadataIdentity.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string));
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (17)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
Microsoft.AspNetCore.Mvc.FunctionalTests (5)
Microsoft.AspNetCore.Mvc.IntegrationTests (10)
Microsoft.AspNetCore.Mvc.Localization (3)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (6)
Microsoft.AspNetCore.Mvc.Razor (10)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (21)
src\Mvc\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (13)
93areaRootEndIndex >= relativePath.Length - 1 || // There's at least one token after the area root.
102if (areaEndIndex == -1 || areaEndIndex == relativePath.Length)
110if (string.Compare(relativePath, areaEndIndex, AreaPagesRoot, 0, AreaPagesRoot.Length, StringComparison.OrdinalIgnoreCase) != 0)
117var pageNameIndex = areaEndIndex + AreaPagesRoot.Length - 1;
118var viewEnginePath = relativePath.Substring(pageNameIndex, relativePath.Length - pageNameIndex - RazorViewEngine.ViewExtension.Length);
131var startIndex = rootDirectory.Length - 1;
132var endIndex = path.Length - RazorViewEngine.ViewExtension.Length;
144return string.Create(1 + areaName.Length + viewEnginePath.Length, (areaName, viewEnginePath), (span, tuple) =>
152span = span.Slice(areaNameValue.Length);
176if (directory.Length > 1 && !directory.EndsWith('/'))
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (7)
TestInfrastructure\DirectoryNode.cs (7)
82var directoryLength = directory.Path.Length;
87if (string.Compare(path, directoryLength, filePath, directoryLength, path.Length - directoryLength, StringComparison.OrdinalIgnoreCase) == 0)
114if (path[path.Length - 1] != '/')
120while ((index = path.IndexOf('/', directory.Path.Length)) != -1 && index != path.Length)
155var startIndex = parentDirectory.Path.Length;
157if (string.Compare(path, startIndex, directoryPath, startIndex, directoryPath.Length - startIndex, StringComparison.OrdinalIgnoreCase) == 0)
Microsoft.AspNetCore.Mvc.Razor.Test (2)
Microsoft.AspNetCore.Mvc.RazorPages (22)
ApplicationModels\PageRouteModelFactory.cs (13)
93areaRootEndIndex >= relativePath.Length - 1 || // There's at least one token after the area root.
102if (areaEndIndex == -1 || areaEndIndex == relativePath.Length)
110if (string.Compare(relativePath, areaEndIndex, AreaPagesRoot, 0, AreaPagesRoot.Length, StringComparison.OrdinalIgnoreCase) != 0)
117var pageNameIndex = areaEndIndex + AreaPagesRoot.Length - 1;
118var viewEnginePath = relativePath.Substring(pageNameIndex, relativePath.Length - pageNameIndex - RazorViewEngine.ViewExtension.Length);
131var startIndex = rootDirectory.Length - 1;
132var endIndex = path.Length - RazorViewEngine.ViewExtension.Length;
144return string.Create(1 + areaName.Length + viewEnginePath.Length, (areaName, viewEnginePath), (span, tuple) =>
152span = span.Slice(areaNameValue.Length);
176if (directory.Length > 1 && !directory.EndsWith('/'))
Microsoft.AspNetCore.Mvc.TagHelpers (7)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (40)
Microsoft.AspNetCore.Mvc.ViewFeatures (11)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (8)
Microsoft.AspNetCore.OpenApi (2)
Microsoft.AspNetCore.OpenApi.SourceGenerators (2)
Microsoft.AspNetCore.OpenApi.Tests (2)
Microsoft.AspNetCore.OutputCaching (5)
Microsoft.AspNetCore.OutputCaching.Tests (2)
Microsoft.AspNetCore.Razor.Test (1)
Microsoft.AspNetCore.ResponseCaching (5)
Microsoft.AspNetCore.ResponseCompression.Tests (2)
Microsoft.AspNetCore.Rewrite (7)
Microsoft.AspNetCore.Routing (59)
Microsoft.AspNetCore.Routing.Microbenchmarks (11)
Microsoft.AspNetCore.Routing.Tests (11)
Microsoft.AspNetCore.Server.HttpSys (22)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (20)
Microsoft.AspNetCore.Server.IIS (19)
Microsoft.AspNetCore.Server.Kestrel.Core (90)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (67)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (9)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (3)
Microsoft.AspNetCore.Session (2)
Microsoft.AspNetCore.Shared.Tests (72)
Microsoft.AspNetCore.SignalR.Client.Tests (1)
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Microsoft.AspNetCore.StaticAssets.Tests (3)
Microsoft.AspNetCore.WebSockets (5)
Microsoft.AspNetCore.WebUtilities (24)
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (2)
Microsoft.AspNetCore.WebUtilities.Tests (2)
Microsoft.Build.Framework (38)
Microsoft.Build.Tasks.CodeAnalysis (18)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (18)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
Microsoft.Cci.Extensions (8)
Microsoft.CodeAnalysis (273)
DocumentationComments\XmlDocumentationCommentTextReader.XmlStream.cs (9)
64_position = RootStart.Length;
108_position += EncodeAndAdvance(CurrentStart, _position - RootStart.Length, buffer, ref index, ref count);
111_position += EncodeAndAdvance(_text, _position - RootStart.Length - CurrentStart.Length, buffer, ref index, ref count);
114_position += EncodeAndAdvance(CurrentEnd, _position - RootStart.Length - CurrentStart.Length - _text.Length, buffer, ref index, ref count);
129if (destCount == 0 || srcIndex < 0 || srcIndex >= src.Length)
134int charCount = Math.Min(src.Length - srcIndex, destCount);
Microsoft.CodeAnalysis.Analyzers (217)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
391if (name.Length > 0)
Microsoft.CodeAnalysis.Analyzers.UnitTests (7)
Microsoft.CodeAnalysis.AnalyzerUtilities (195)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
Microsoft.CodeAnalysis.BannedApiAnalyzers (203)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
391if (name.Length > 0)
Microsoft.CodeAnalysis.CodeStyle (206)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
Microsoft.CodeAnalysis.CodeStyle.Fixes (12)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
391if (name.Length > 0)
Microsoft.CodeAnalysis.Collections.Package (2)
Microsoft.CodeAnalysis.CSharp (102)
Microsoft.CodeAnalysis.CSharp.CodeStyle (26)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (12)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (11)
CommandLineTests.cs (11)
1896Assert.True(Array.IndexOf(acceptableSurroundingChar, actual[foundIndex + version.Length]) >= 0);
2428Assert.True(embed_cs.Length >= EmbeddedText.CompressionThreshold);
2429Assert.True(embed2_cs.Length < EmbeddedText.CompressionThreshold);
2906if (currentUICultureName.Length == 0 || currentUICultureName.StartsWith("en", StringComparison.OrdinalIgnoreCase))
5930var modfile = source1.Substring(0, source1.Length - 2) + "netmodule";
5942modfile = source2.Substring(0, source2.Length - 2) + "netmodule";
5967var modfile = source1.Substring(0, source1.Length - 2) + "netmodule";
5987var modfile = source1.Substring(0, source1.Length - 2) + "netmodule";
9426Assert.Equal(stringStart, text.Substring(0, stringStart.Length));
9732Assert.Equal('(', text[expectedPath.Length]);
10612index = source.IndexOf(word, index + word.Length, StringComparison.Ordinal);
Microsoft.CodeAnalysis.CSharp.CSharp15.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (25)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (14)
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (7)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenFunctionPointersTests.cs (3)
3279Diagnostic(ErrorCode.ERR_WrongFuncPtrCallingConvention, "M1").WithArguments("C.M1()", callingConvention).WithLocation(7, 33 + callingConventionKeyword.Length));
6349Diagnostic(ErrorCode.ERR_CantChangeReturnTypeOnOverride, "M2").WithArguments("Derived.M2()", "Base.M2()", $"delegate*<{refKind1}string, void>").WithLocation(10, 48 + refKind2.Length)
6380Diagnostic(ErrorCode.ERR_CantChangeReturnTypeOnOverride, "M2").WithArguments("Derived.M2()", "Base.M2()", $"delegate*<{(string.IsNullOrWhiteSpace(refKind1) ? "" : refKind1)}string>").WithLocation(10, 42 + refKind2.Length)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (21)
Semantics\RecordTests.cs (11)
13998Diagnostic(ErrorCode.ERR_CopyConstructorWrongAccessibility, "A").WithArguments("A.A(A)").WithLocation(4, 6 + accessibility.Length)
14085Diagnostic(ErrorCode.WRN_ProtectedInSealed, "A").WithArguments("A.A(A)").WithLocation(4, 6 + accessibility.Length)
15588Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Deconstruct").WithArguments("A.Deconstruct(out int)").WithLocation(4, 11 + accessibility.Length)
18481Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 19 + accessibility.Length),
18484Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 19 + accessibility.Length)
18507Diagnostic(ErrorCode.ERR_VirtualPrivate, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 19 + accessibility.Length),
18510Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 19 + accessibility.Length),
18513Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 19 + accessibility.Length)
19040Diagnostic(ErrorCode.ERR_NonProtectedAPIInRecord, "EqualityContract").WithArguments("A.EqualityContract").WithLocation(4, 26 + accessibility.Length)
19063Diagnostic(ErrorCode.ERR_VirtualPrivate, "EqualityContract").WithArguments("A.EqualityContract").WithLocation(4, 26 + accessibility.Length),
19066Diagnostic(ErrorCode.ERR_NonProtectedAPIInRecord, "EqualityContract").WithArguments("A.EqualityContract").WithLocation(4, 26 + accessibility.Length)
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (12)
Microsoft.CodeAnalysis.CSharp.Features (77)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (9)
ObjectFormatterTests.cs (4)
53Assert.Equal(51 + 3, str.Length);
57Assert.Equal(5 + 3, str.Length);
149string actualName = ObjectFormatterHelpers.ParseSimpleMemberName(value, 0, value.Length, out actualNoQuotes, out actualIsCallable);
154actualName = ObjectFormatterHelpers.ParseSimpleMemberName("---" + value + "-", 3, 3 + value.Length, out actualNoQuotes, out actualIsCallable);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (44)
Semantics\InterpolationTests.cs (12)
3667Diagnostic(ErrorCode.ERR_NotRefStructConstraintNotSatisfied, "{s}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted<T>(T, int, string)", "T", "S").WithLocation(6, 5 + expression.Length)
3752Diagnostic(ErrorCode.ERR_BadCtorArgCount, "new()").WithArguments("string", "0").WithLocation(1, 19 + expression.Length)
4385Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnMalformed, "{1}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted(object)").WithLocation(4, 15 + expression.Length)
4491Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnInconsistent, "{1}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted(object)", "bool").WithLocation(4, 15 + expression1.Length),
4494Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnInconsistent, "Text").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendLiteral(string)", "void").WithLocation(5, 14 + expression2.Length)
4529Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnInconsistent, "{1}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted(object)", "void").WithLocation(4, 15 + expression1.Length),
4532Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnInconsistent, "Text").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendLiteral(string)", "bool").WithLocation(5, 14 + expression2.Length)
7849Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerArgumentLocatedAfterInterpolatedString, "1").WithArguments("i", "c").WithLocation(1, 7 + expression.Length),
17766Diagnostic(ErrorCode.ERR_NotInstanceInvalidInterpolatedStringHandlerArgumentName, @"InterpolatedStringHandlerArgument("""")").WithArguments("M(CustomHandler)").WithLocation(6, 10 + mod.Length)
17827Diagnostic(ErrorCode.WRN_InterpolatedStringHandlerArgumentAttributeIgnoredOnLambdaParameters, @"InterpolatedStringHandlerArgument("""")").WithLocation(4, 12 + mod.Length),
17830Diagnostic(ErrorCode.ERR_NotInstanceInvalidInterpolatedStringHandlerArgumentName, @"InterpolatedStringHandlerArgument("""")").WithArguments("lambda expression").WithLocation(4, 12 + mod.Length)
17857Diagnostic(ErrorCode.WRN_InterpolatedStringHandlerArgumentAttributeIgnoredOnLambdaParameters, @"InterpolatedStringHandlerArgument(""i"")").WithLocation(5, 19 + mod.Length)
Semantics\RecordStructTests.cs (6)
4009Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Deconstruct").WithArguments("A.Deconstruct(out int)").WithLocation(4, 11 + accessibility.Length)
4316Diagnostic(ErrorCode.ERR_ProtectedInStruct, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length),
4319Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length),
4322Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 11 + accessibility.Length)
4346Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length),
4349Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 11 + accessibility.Length)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (321)
Symbols\DefaultInterfaceImplementationTests.cs (135)
6358Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "E1").WithArguments("I1.E1").WithLocation(4, 25 + declModifiers.Length)
6674Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "E1").WithArguments("I1.E1").WithLocation(4, 25 + declModifiers.Length)
6706Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "E1").WithArguments("I1.E1").WithLocation(4, 25 + declModifiers.Length)
6738Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "E1").WithArguments("I1.E1").WithLocation(4, 25 + declModifiers.Length)
6961Diagnostic(ErrorCode.WRN_UnreferencedEvent, "E7").WithArguments("Base.E7").WithLocation(10, 25 + implModifiers.Length)
7064Diagnostic(ErrorCode.WRN_UnreferencedEvent, "E7").WithArguments("Base.E7").WithLocation(10, 25 + implModifiers.Length)
7155Diagnostic(ErrorCode.WRN_UnreferencedEvent, "E7").WithArguments("Base.E7").WithLocation(10, 25 + implModifiers.Length)
7262Diagnostic(ErrorCode.WRN_UnreferencedEvent, "E7").WithArguments("Base.E7").WithLocation(10, 29 + implModifiers.Length)
33451Diagnostic(ErrorCode.ERR_ConcreteMissingBody, "M1").WithArguments("I1.I4.M1()").WithLocation(15, 13 + implModifiers.Length),
33454Diagnostic(ErrorCode.ERR_ConcreteMissingBody, "M1").WithArguments("I1.I2.M1()").WithLocation(14, 13 + implModifiers.Length)
33499Diagnostic(ErrorCode.ERR_ClassDoesntImplementInterface, "I4").WithArguments("I1.I4.M1()", "I4").WithLocation(18, 10 + implModifiers.Length),
33502Diagnostic(ErrorCode.ERR_ClassDoesntImplementInterface, "I2").WithArguments("I1.I2.M1()", "I2").WithLocation(14, 10 + implModifiers.Length)
33668Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("sealed").WithLocation(14, 28 + implModifiers.Length),
33671Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private").WithLocation(14, 28 + implModifiers.Length),
33674Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected").WithLocation(18, 32 + implModifiers.Length),
33677Diagnostic(ErrorCode.ERR_AbstractHasBody, "M1").WithArguments("I1.I4.M1()").WithLocation(18, 32 + implModifiers.Length),
33732Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private protected").WithLocation(14, 31 + implModifiers.Length),
33735Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected internal").WithLocation(18, 41 + implModifiers.Length),
33738Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("override").WithLocation(18, 41 + implModifiers.Length)
33778Diagnostic(ErrorCode.WRN_ExternMethodNoImplementation, "M1").WithArguments("I1.I2.M1()").WithLocation(9, 20 + implModifiers.Length)
33902Diagnostic(ErrorCode.ERR_ExternHasBody, "M1").WithArguments("I1.I2.M1()").WithLocation(9, 20 + implModifiers.Length)
34215Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I4.M1()").WithLocation(8, 13 + implModifiers.Length),
34218Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1()").WithLocation(4, 13 + implModifiers.Length)
34230Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I4.M1()").WithLocation(8, 13 + implModifiers.Length),
34233Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1()").WithLocation(4, 13 + implModifiers.Length)
35916Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "I1<string?>").WithLocation(11, 10 + implModifiers.Length)
36119Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "I1<string>").WithLocation(11, 10 + implModifiers.Length)
36826Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1()").WithLocation(4, 13 + implModifiers.Length),
36829Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I4.M1()").WithLocation(8, 13 + implModifiers.Length)
36876Diagnostic(ErrorCode.WRN_NewRequired, "M1").WithArguments("I2.M1()", "I1.M1()").WithLocation(10, 25 + implModifiers.Length),
37607Diagnostic(ErrorCode.ERR_ClassDoesntImplementInterface, "I2").WithArguments("I1.I2.M1", "I2").WithLocation(14, 9 + implModifiers.Length),
37610Diagnostic(ErrorCode.ERR_ClassDoesntImplementInterface, "I4").WithArguments("I1.I4.M1", "I4").WithLocation(15, 9 + implModifiers.Length)
37799Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("sealed").WithLocation(14, 27 + implModifiers.Length),
37802Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private").WithLocation(14, 27 + implModifiers.Length),
37808Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected").WithLocation(19, 31 + implModifiers.Length),
37868Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private protected").WithLocation(14, 30 + implModifiers.Length),
37874Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected internal").WithLocation(19, 40 + implModifiers.Length),
37877Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("override").WithLocation(19, 40 + implModifiers.Length),
38373Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1").WithLocation(4, 12 + implModifiers.Length),
38376Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I4.M1.set").WithLocation(11, 12 + implModifiers.Length)
39352Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected").WithLocation(19, 22 + implModifiers.Length)
39403Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected internal").WithLocation(19, 31 + implModifiers.Length)
39454Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private protected").WithLocation(19, 30 + implModifiers.Length)
39518Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "M1").WithArguments("I3", "I1<System.String>.M1").WithLocation(21, 21 + implModifiers.Length)
39930Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1").WithLocation(4, 12 + implModifiers.Length),
39933Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I4.M1.set").WithLocation(11, 12 + implModifiers.Length)
40633Diagnostic(ErrorCode.ERR_ClassDoesntImplementInterface, "I2").WithArguments("I1.I2.M1", "I2").WithLocation(9, 25 + implModifiers.Length)
40805Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("sealed").WithLocation(14, 43 + implModifiers.Length),
40808Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private").WithLocation(14, 43 + implModifiers.Length),
40811Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected").WithLocation(19, 47 + implModifiers.Length),
40871Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private protected").WithLocation(14, 53 + implModifiers.Length),
40874Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("extern").WithLocation(14, 53 + implModifiers.Length),
40877Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected internal").WithLocation(19, 56 + implModifiers.Length),
40880Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("override").WithLocation(19, 56 + implModifiers.Length)
40945Diagnostic(ErrorCode.ERR_ExplicitEventFieldImpl, "M1").WithLocation(30, 28 + implModifiers.Length),
40948Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "M1").WithArguments("I2.I1.M1").WithLocation(10, 28 + implModifiers.Length),
40951Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "M2").WithArguments("I2.I1.M2").WithLocation(14, 28 + implModifiers.Length),
40963Diagnostic(ErrorCode.ERR_ExplicitEventFieldImpl, ".").WithLocation(38, 27 + implModifiers.Length),
41149Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1").WithLocation(4, 28 + implModifiers.Length)
41161Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1").WithLocation(4, 28 + implModifiers.Length)
42495Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1").WithLocation(4, 28 + implModifiers.Length)
51969Diagnostic(ErrorCode.ERR_AbstractHasBody, "M1").WithArguments("I2.I1.M1()").WithLocation(9, 22 + implModifiers.Length),
52024Diagnostic(ErrorCode.ERR_AbstractAndExtern, "M1").WithArguments("I2.I1.M1()").WithLocation(9, 29 + implModifiers.Length),
52089Diagnostic(ErrorCode.ERR_PartialMemberNotExplicit, "M1").WithLocation(9, 30 + implModifiers.Length),
52092Diagnostic(ErrorCode.ERR_PartialMemberCannotBeAbstract, "M1").WithLocation(9, 30 + implModifiers.Length),
52147Diagnostic(ErrorCode.ERR_BadAsyncLacksBody, "M1").WithLocation(9, 28 + implModifiers.Length),
52212Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("public").WithLocation(9, 29 + implModifiers.Length),
52334Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "M1").WithArguments("I2.M1()").WithLocation(8, 22 + implModifiers.Length)
52383Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "I1").WithArguments("I1").WithLocation(4, 19 + implModifiers.Length),
52386Diagnostic(ErrorCode.ERR_ExplicitInterfaceImplementationNotInterface, "I1").WithArguments("I1").WithLocation(4, 19 + implModifiers.Length)
53713Diagnostic(ErrorCode.ERR_AbstractAndExtern, "P1").WithArguments("I2.I1.P1").WithLocation(9, 28 + implModifiers.Length),
53838Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("public").WithLocation(9, 28 + implModifiers.Length),
53867Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length)
53951Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length)
53981Diagnostic(ErrorCode.ERR_ExplicitPropertyMissingAccessor, "P1").WithArguments("I2.I1.P1", "I1.P1.set").WithLocation(9, 21 + implModifiers.Length),
54014Diagnostic(ErrorCode.ERR_ExplicitPropertyMissingAccessor, "P1").WithArguments("I2.I1.P1", "I1.P1.get").WithLocation(9, 21 + implModifiers.Length),
54047Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "set").WithArguments("I2.I1.P1.set", "I1.P1").WithLocation(9, 31 + implModifiers.Length),
54080Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "get").WithArguments("I2.I1.P1.get", "I1.P1").WithLocation(9, 26 + implModifiers.Length),
54113Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "set").WithArguments("I2.I1.P1.set", "I1.P1").WithLocation(9, 31 + implModifiers.Length),
54146Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "get").WithArguments("I2.I1.P1.get", "I1.P1").WithLocation(9, 26 + implModifiers.Length),
54181Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1").WithLocation(4, 21 + implModifiers.Length),
54275Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1.get").WithLocation(4, 21 + implModifiers.Length),
54310Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1.set").WithLocation(4, 21 + implModifiers.Length),
55722Diagnostic(ErrorCode.ERR_AbstractHasBody, "throw null").WithArguments("I2.I1.P1.get").WithLocation(9, 27 + implModifiers.Length),
55755Diagnostic(ErrorCode.ERR_AbstractAndExtern, "P1").WithArguments("I2.I1.P1").WithLocation(9, 28 + implModifiers.Length),
55788Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("public").WithLocation(9, 28 + implModifiers.Length),
55817Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length)
55843Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length)
55873Diagnostic(ErrorCode.ERR_ExplicitPropertyMissingAccessor, "P1").WithArguments("I2.I1.P1", "I1.P1.set").WithLocation(9, 21 + implModifiers.Length),
55876Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "get").WithArguments("I2.I1.P1.get", "I1.P1").WithLocation(9, 26 + implModifiers.Length),
55911Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1").WithLocation(4, 21 + implModifiers.Length),
56653Diagnostic(ErrorCode.ERR_AbstractAndExtern, "P1").WithArguments("I2.I1.P1").WithLocation(9, 28 + implModifiers.Length),
56686Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("public").WithLocation(9, 28 + implModifiers.Length),
56715Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length),
56718Diagnostic(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, "set").WithLocation(9, 26 + implModifiers.Length)
56744Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length),
56747Diagnostic(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, "set").WithLocation(9, 26 + implModifiers.Length)
56777Diagnostic(ErrorCode.ERR_ExplicitPropertyMissingAccessor, "P1").WithArguments("I2.I1.P1", "I1.P1.get").WithLocation(9, 21 + implModifiers.Length),
56780Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "set").WithArguments("I2.I1.P1.set", "I1.P1").WithLocation(9, 26 + implModifiers.Length),
56815Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1").WithLocation(4, 21 + implModifiers.Length),
57020Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "P1").WithArguments("I2.P1").WithLocation(8, 21 + implModifiers.Length)
57082Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length),
57085Diagnostic(ErrorCode.ERR_ExplicitInterfaceImplementationNotInterface, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length)
57113Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "P1").WithArguments("I2.P1").WithLocation(8, 21 + implModifiers.Length)
57140Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length),
57143Diagnostic(ErrorCode.ERR_ExplicitInterfaceImplementationNotInterface, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length)
57171Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "P1").WithArguments("I2.P1").WithLocation(8, 21 + implModifiers.Length)
57198Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length),
57201Diagnostic(ErrorCode.ERR_ExplicitInterfaceImplementationNotInterface, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length)
58598Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("extern").WithLocation(9, 44 + implModifiers.Length),
58631Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("public").WithLocation(9, 44 + implModifiers.Length),
58666Diagnostic(ErrorCode.ERR_ExplicitEventFieldImpl, "P1").WithLocation(9, 37 + implModifiers.Length),
58669Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 37 + implModifiers.Length)
58752Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 37 + implModifiers.Length)
58784Diagnostic(ErrorCode.ERR_ExplicitEventFieldImpl, "P1").WithLocation(9, 37 + implModifiers.Length),
58787Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 37 + implModifiers.Length)
58817Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 37 + implModifiers.Length)
58847Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
58880Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
58913Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
58946Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
58979Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
59012Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
59045Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
59078Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "P1").WithArguments("I1.P1").WithLocation(4, 25 + modifiers.Length),
59081Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "P1").WithArguments("I2.I1.P1.remove", "I1.P1").WithLocation(9, 37 + implModifiers.Length),
59118Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "P1").WithArguments("I1.P1").WithLocation(4, 25 + modifiers.Length),
59157Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "P1").WithArguments("I1.P1").WithLocation(4, 25 + modifiers.Length),
59160Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "P1").WithArguments("I2.I1.P1.add", "I1.P1").WithLocation(9, 37 + implModifiers.Length),
59197Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "P1").WithArguments("I1.P1").WithLocation(4, 25 + modifiers.Length),
59238Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1").WithLocation(4, 37 + implModifiers.Length),
59309Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "P1").WithArguments("I2.P1").WithLocation(8, 37 + implModifiers.Length)
59359Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "I1").WithArguments("I1").WithLocation(4, 34 + implModifiers.Length),
59362Diagnostic(ErrorCode.ERR_ExplicitInterfaceImplementationNotInterface, "I1").WithArguments("I1").WithLocation(4, 34 + implModifiers.Length)
59392Diagnostic(ErrorCode.ERR_ExplicitEventFieldImpl, ".").WithLocation(9, 36 + implModifiers.Length),
Symbols\StaticAbstractMembersInInterfacesTests.cs (174)
5691Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op.Substring(isChecked ? 8 : 0)).WithLocation(4, 31 + type.Length + (isChecked ? 8 : 0))
5738Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op.Substring(isChecked ? 8 : 0)).WithLocation(4, 31 + type.Length + (isChecked ? 8 : 0))
8668(prefixOp + postfixOp).Length == 1 ?
9116Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, prefixOp + postfixOp).WithLocation(12, 31 + checkedKeyword.Length)
12107Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(12, 33 + checkedKeyword.Length)
12257Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(12, 32 + checkedKeyword.Length)
17523Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17529Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
17535Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17538Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17547Diagnostic(ErrorCode.ERR_ExplicitInterfaceMemberReturnTypeMismatch, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6)", "C6", "I1<C6>.operator " + checkedKeyword + op + "(C6)").WithLocation(38, 32 + checkedKeyword.Length),
17565Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10)").WithLocation(67, 33 + checkedKeyword.Length)
17666Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17672Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
17678Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17681Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17690Diagnostic(ErrorCode.ERR_ExplicitInterfaceMemberReturnTypeMismatch, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6)", "C6", "I1<C6>.operator " + checkedKeyword + op + "(C6)").WithLocation(38, 32 + checkedKeyword.Length),
17708Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10)").WithLocation(67, 33 + checkedKeyword.Length)
17803Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17806Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
17809Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17812Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17815Diagnostic(ErrorCode.ERR_ExplicitInterfaceMemberReturnTypeMismatch, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6)", "C6", "I1<C6>.operator " + checkedKeyword + op + "(C6)").WithLocation(38, 32 + checkedKeyword.Length),
17821Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10)").WithLocation(67, 33 + checkedKeyword.Length)
17916Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17919Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
17922Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17925Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17928Diagnostic(ErrorCode.ERR_ExplicitInterfaceMemberReturnTypeMismatch, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6)", "C6", "I1<C6>.operator " + checkedKeyword + op + "(C6)").WithLocation(38, 32 + checkedKeyword.Length),
17934Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10)").WithLocation(67, 33 + checkedKeyword.Length)
18058Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2, int)").WithLocation(14, 24 + checkedKeyword.Length),
18064Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3, int)").WithLocation(20, 24 + checkedKeyword.Length),
18070Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4, int)").WithLocation(26, 24 + checkedKeyword.Length),
18073Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4, int)").WithLocation(26, 24 + checkedKeyword.Length),
18082Diagnostic(ErrorCode.ERR_ExplicitInterfaceMemberReturnTypeMismatch, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6, int)", "C6", "I1<C6>.operator " + checkedKeyword + op + "(C6, int)").WithLocation(38, 32 + checkedKeyword.Length),
18100Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10, int)").WithLocation(67, 33 + checkedKeyword.Length)
18195Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2, int)").WithLocation(14, 24 + checkedKeyword.Length),
18198Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3, int)").WithLocation(20, 24 + checkedKeyword.Length),
18201Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4, int)").WithLocation(26, 24 + checkedKeyword.Length),
18204Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4, int)").WithLocation(26, 24 + checkedKeyword.Length),
18207Diagnostic(ErrorCode.ERR_ExplicitInterfaceMemberReturnTypeMismatch, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6, int)", "C6", "I1<C6>.operator " + checkedKeyword + op + "(C6, int)").WithLocation(38, 32 + checkedKeyword.Length),
18213Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10, int)").WithLocation(67, 33 + checkedKeyword.Length)
18301ErrorCode badSignatureError = op.Length != 2 ? ErrorCode.ERR_BadUnaryOperatorSignature : ErrorCode.ERR_BadIncDecSignature;
18302ErrorCode badAbstractSignatureError = op.Length != 2 ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadAbstractIncDecSignature;
18307Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18310Diagnostic(badSignatureError, op).WithLocation(12, 17 + checkedKeyword.Length),
18313Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
18316Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18319Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18322Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
18325Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18328Diagnostic(badSignatureError, op).WithLocation(42, 16 + checkedKeyword.Length),
18331Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length)
18448ErrorCode badSignatureError = op.Length != 2 ? ErrorCode.ERR_BadUnaryOperatorSignature : ErrorCode.ERR_BadIncDecSignature;
18449ErrorCode badAbstractSignatureError = op.Length != 2 ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadAbstractIncDecSignature;
18454Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18457Diagnostic(ErrorCode.ERR_BadIncDecSignature, op).WithLocation(12, 17 + checkedKeyword.Length),
18460Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
18463Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18466Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18469Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
18472Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18475Diagnostic(ErrorCode.ERR_BadIncDecSignature, op).WithLocation(42, 16 + checkedKeyword.Length),
18478Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length)
18595ErrorCode badSignatureError = op.Length != 2 ? ErrorCode.ERR_BadUnaryOperatorSignature : ErrorCode.ERR_BadIncDecSignature;
18596ErrorCode badAbstractSignatureError = op.Length != 2 ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadAbstractIncDecSignature;
18601Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18604Diagnostic(badSignatureError, op).WithLocation(12, 17 + checkedKeyword.Length),
18607Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
18610Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18613Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18616Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
18619Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18622Diagnostic(badSignatureError, op).WithLocation(42, 16 + checkedKeyword.Length),
18625Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length),
18628Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(62, 39 + checkedKeyword.Length),
18631Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(67, 36 + checkedKeyword.Length)
18748ErrorCode badSignatureError = op.Length != 2 ? ErrorCode.ERR_BadUnaryOperatorSignature : ErrorCode.ERR_BadIncDecSignature;
18749ErrorCode badAbstractSignatureError = op.Length != 2 ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadAbstractIncDecSignature;
18754Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18757Diagnostic(ErrorCode.ERR_BadIncDecSignature, op).WithLocation(12, 17 + checkedKeyword.Length),
18760Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
18763Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18766Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18769Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
18772Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18775Diagnostic(ErrorCode.ERR_BadIncDecSignature, op).WithLocation(42, 16 + checkedKeyword.Length),
18778Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length),
18781Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(62, 39 + checkedKeyword.Length),
18784Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(67, 36 + checkedKeyword.Length)
18908Diagnostic(badSignatureError, op).WithLocation(12, 17 + checkedKeyword.Length),
18911Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
18914Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1, int)").WithLocation(22, 20 + checkedKeyword.Length),
18917Diagnostic(badSignatureError, op).WithLocation(42, 16 + checkedKeyword.Length),
18920Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length)
18932Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(12, 17 + checkedKeyword.Length),
18935Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(17, 24 + checkedKeyword.Length),
18944Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(42, 16 + checkedKeyword.Length),
18947Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(47, 23 + checkedKeyword.Length)
18957Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1, int)").WithLocation(12, 17 + checkedKeyword.Length),
18960Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1, int)").WithLocation(22, 20 + checkedKeyword.Length),
18963Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
18966Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T, int)").WithLocation(42, 16 + checkedKeyword.Length)
19094Diagnostic(badSignatureError, op).WithLocation(12, 17 + checkedKeyword.Length),
19097Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
19100Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1, int)").WithLocation(22, 20 + checkedKeyword.Length),
19103Diagnostic(badSignatureError, op).WithLocation(42, 16 + checkedKeyword.Length),
19106Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length),
19109Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(62, 39 + checkedKeyword.Length),
19112Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(67, 36 + checkedKeyword.Length)
19124Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(12, 17 + checkedKeyword.Length),
19127Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(17, 24 + checkedKeyword.Length),
19136Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(42, 16 + checkedKeyword.Length),
19139Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(47, 23 + checkedKeyword.Length)
19149Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1, int)").WithLocation(12, 17 + checkedKeyword.Length),
19152Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1, int)").WithLocation(22, 20 + checkedKeyword.Length),
19155Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
19158Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T, int)").WithLocation(42, 16 + checkedKeyword.Length)
19476Diagnostic(ErrorCode.ERR_InvalidModifierForLanguageVersion, op).WithArguments(modifier.Trim(), "10.0", "11.0").WithLocation(14, 33 + checkedKeyword.Length),
19485Diagnostic(ErrorCode.ERR_InvalidModifierForLanguageVersion, op).WithArguments(modifier.Trim(), "10.0", "11.0").WithLocation(19, 32 + checkedKeyword.Length),
19531Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfacesForMember, op).WithArguments("Test1.operator " + checkedKeyword + op + "(Test1)", "I1<Test1>.operator " + checkedKeyword + op + "(Test1)", "Test1").WithLocation(4, 34 + checkedKeyword.Length)
19541Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(9, 32 + checkedKeyword.Length)
19583Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfacesForMember, op).WithArguments("Test1.operator " + checkedKeyword + op + "(Test1, int)", "I1<Test1>.operator " + checkedKeyword + op + "(Test1, int)", "Test1").WithLocation(4, 34 + checkedKeyword.Length)
19593Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(9, 32 + checkedKeyword.Length)
19635Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(4, 27 + checkedKeyword.Length)
19645Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(4, 27 + checkedKeyword.Length),
19648Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(9, 33 + checkedKeyword.Length)
19690Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(4, 27 + checkedKeyword.Length)
19700Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(4, 27 + checkedKeyword.Length),
19703Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(9, 33 + checkedKeyword.Length)
22741Diagnostic(ErrorCode.ERR_ValConstraintNotSatisfied, "x").WithArguments("I1<T>", "T", "C2").WithLocation(14, 44 + op.Length - 1)
22786Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "x").WithArguments("I1<T>", "T", "C2").WithLocation(14, 44 + op.Length - 1)
28364Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, "int").WithArguments("C2." + op + " operator " + checkedKeyword + "int(C2)").WithLocation(14, 30 + checkedKeyword.Length),
28370Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, "int").WithArguments("C3." + op + " operator " + checkedKeyword + "int(C3)").WithLocation(20, 30 + checkedKeyword.Length),
28376Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, "int").WithArguments("C4." + op + " operator " + checkedKeyword + "int(C4)").WithLocation(26, 30 + checkedKeyword.Length),
28379Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("C4." + op + " operator " + checkedKeyword + "int(C4)").WithLocation(26, 30 + checkedKeyword.Length),
28388Diagnostic(ErrorCode.ERR_ExplicitInterfaceMemberReturnTypeMismatch, "long").WithArguments("C6." + op + " operator " + checkedKeyword + "long(C6)", "int", "I1<C6>." + op + " operator " + checkedKeyword + "int(C6)").WithLocation(38, 37 + checkedKeyword.Length),
28406Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("C10." + op + " operator " + checkedKeyword + "int(C10)").WithLocation(67, 38 + checkedKeyword.Length)
28501Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, "int").WithArguments("C2." + op + " operator " + checkedKeyword + "int(C2)").WithLocation(14, 30 + checkedKeyword.Length),
28504Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, "int").WithArguments("C3." + op + " operator " + checkedKeyword + "int(C3)").WithLocation(20, 30 + checkedKeyword.Length),
28507Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, "int").WithArguments("C4." + op + " operator " + checkedKeyword + "int(C4)").WithLocation(26, 30 + checkedKeyword.Length),
28510Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("C4." + op + " operator " + checkedKeyword + "int(C4)").WithLocation(26, 30 + checkedKeyword.Length),
28513Diagnostic(ErrorCode.ERR_ExplicitInterfaceMemberReturnTypeMismatch, "long").WithArguments("C6." + op + " operator " + checkedKeyword + "long(C6)", "int", "I1<C6>." + op + " operator " + checkedKeyword + "int(C6)").WithLocation(38, 37 + checkedKeyword.Length),
28519Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("C10." + op + " operator " + checkedKeyword + "int(C10)").WithLocation(67, 38 + checkedKeyword.Length)
28610Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(12, 23 + checkedKeyword.Length),
28613Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(12, 23 + checkedKeyword.Length),
28616Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(17, 30 + checkedKeyword.Length),
28619Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(17, 30 + checkedKeyword.Length),
28622Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, "int").WithArguments("I5<T>." + op + " operator " + checkedKeyword + "int(T)").WithLocation(22, 29 + checkedKeyword.Length),
28625Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("I5<T>." + op + " operator " + checkedKeyword + "int(T)").WithLocation(22, 29 + checkedKeyword.Length),
28628Diagnostic(ErrorCode.ERR_AbstractConversionNotInvolvingContainedType, "int").WithLocation(32, 39 + checkedKeyword.Length),
28631Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(42, 23 + checkedKeyword.Length),
28634Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(42, 23 + checkedKeyword.Length),
28637Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(47, 30 + checkedKeyword.Length),
28640Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(47, 30 + checkedKeyword.Length)
28767Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(12, 23 + checkedKeyword.Length),
28770Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(12, 23 + checkedKeyword.Length),
28773Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(17, 30 + checkedKeyword.Length),
28776Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(17, 30 + checkedKeyword.Length),
28779Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, "int").WithArguments("I5<T>." + op + " operator " + checkedKeyword + "int(T)").WithLocation(22, 29 + checkedKeyword.Length),
28782Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("I5<T>." + op + " operator " + checkedKeyword + "int(T)").WithLocation(22, 29 + checkedKeyword.Length),
28785Diagnostic(ErrorCode.ERR_AbstractConversionNotInvolvingContainedType, "int").WithLocation(32, 39 + checkedKeyword.Length),
28788Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(42, 23 + checkedKeyword.Length),
28791Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(42, 23 + checkedKeyword.Length),
28794Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(47, 30 + checkedKeyword.Length),
28797Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(47, 30 + checkedKeyword.Length),
28800Diagnostic(ErrorCode.ERR_BadMemberFlag, "int").WithArguments("virtual").WithLocation(62, 46 + checkedKeyword.Length),
28803Diagnostic(ErrorCode.ERR_BadMemberFlag, "int").WithArguments("virtual").WithLocation(67, 45 + checkedKeyword.Length)
28991Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfacesForMember, "int").WithArguments("Test1." + op + " operator " + checkedKeyword + "int(Test1)", "I1<Test1>." + op + " operator " + checkedKeyword + "int(Test1)", "Test1").WithLocation(4, 37 + checkedKeyword.Length)
29001Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, "int").WithLocation(9, 39 + checkedKeyword.Length)
29043Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, "int").WithLocation(4, 40 + checkedKeyword.Length)
29053Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, "int").WithLocation(4, 40 + checkedKeyword.Length),
29056Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, "int").WithLocation(9, 39 + checkedKeyword.Length)
30998Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, "int").WithLocation(12, 39 + checkedKeyword.Length)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (92)
IncrementalParsing\IncrementalParsingTests.cs (37)
572var prefixSpan = new TextSpan(source.IndexOf(prefix), length: prefix.Length);
573var suffixSpan = new TextSpan(source.IndexOf(suffix), length: suffix.Length);
2118int locationOfChange = oldText.ToString().IndexOf(txtToCmnt, StringComparison.Ordinal), widthOfChange = txtToCmnt.Length;
2143int locationOfChange = oldText.ToString().IndexOf(txtToCmnt, StringComparison.Ordinal), widthOfChange = txtToCmnt.Length;
2798int widthOfChange = textToRemove.Length;
2826int widthOfChange = textToRemove.Length;
2848int widthOfChange = textToRemove.Length;
2899int widthOfChange = textToRemove.Length;
2932int widthOfChange = textToRemove.Length;
2958int widthOfChange = textToRemove.Length;
2983int widthOfChange = textToRemove.Length;
3012int widthOfChange = textToRemove.Length;
3039int widthOfChange = textToRemove.Length;
3063int widthOfChange = textToRemove.Length;
3093int locationOfChange = oldText.ToString().IndexOf(txtToCmnt, StringComparison.Ordinal), widthOfChange = txtToCmnt.Length;
3121int locationOfChange = oldText.ToString().IndexOf(txtToCmnt, StringComparison.Ordinal), widthOfChange = txtToCmnt.Length;
3144int locationOfChange = oldText.ToString().IndexOf(txtToCmnt, StringComparison.Ordinal), widthOfChange = txtToCmnt.Length;
3305var changedTree = originalTree.WithInsertAt(text.Length, "\r\n hash++;");
3339Assert.Equal(fullText.Length, incText.Length);
3353Assert.Equal(fullText.Length, incText.Length);
3415currLen += item.Length + 3;
3475var newTree = oldTree.WithInsertAt(text.Length, " ");
3491var newTree = oldTree.WithInsertAt(text.Length, " ");
3734var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
3758var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
3782var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
3806var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
3830var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
3854var span = new TextSpan(source.IndexOf(substring) + substring.Length, 1);
3880var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
3931var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
3957var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
3975var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
3993var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
4011var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0);
LexicalAndXml\LexicalTests.cs (18)
111Assert.Equal(text.Length, token.FullWidth);
130Assert.Equal(text.Length, token.FullWidth);
149Assert.Equal(text.Length, token.FullWidth);
599Assert.Equal(text.Length, token.FullWidth);
727Assert.Equal(1, ((string)token.ValueText).Length);
744Assert.Equal(1, ((string)token.ValueText).Length);
761Assert.Equal(1, ((string)token.ValueText).Length);
778Assert.Equal(1, ((string)token.ValueText).Length);
795Assert.Equal(3, ((string)token.ValueText).Length);
812Assert.Equal(4, ((string)token.ValueText).Length);
829Assert.Equal(1, ((string)token.ValueText).Length);
871Assert.Equal(3, ((string)token.ValueText).Length);
3479Assert.Equal(text.Substring(0, text.Length - 1), token.Text);
3480Assert.Equal(text.Substring(0, text.Length - 1), token.Value);
3583Assert.Equal(text.Substring(0, text.Length - 1), token.Text);
3593Assert.Equal(text.Substring(0, text.Length - 1), token.Text);
3747.Max(x => x.Length);
4593var code = new string('/', SlidingTextWindow.DefaultWindowLength - windowEnd.Length) + windowEnd + "0;";
Parsing\CrefParsingTests.cs (6)
821Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "operator " + op.Substring(0, op.Length - 2)).WithArguments("operator " + op).WithLocation(1, 16)
861Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "operator " + op.Substring(0, op.Length - 4)).WithArguments("operator " + op).WithLocation(1, 16)
901Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "operator " + op.Substring(0, op.Length - 3)).WithArguments("operator " + op).WithLocation(1, 16)
1448Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "T.operator " + op.Substring(0, op.Length - 2)).WithArguments("T.operator " + op).WithLocation(1, 16)
1506Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "T.operator " + op.Substring(0, op.Length - 4)).WithArguments("T.operator " + op).WithLocation(1, 16)
1564Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "T.operator " + op.Substring(0, op.Length - 3)).WithArguments("T.operator " + op).WithLocation(1, 16)
Parsing\MemberDeclarationParsingTests.cs (8)
13423Diagnostic(ErrorCode.ERR_SyntaxError, "=").WithArguments("(").WithLocation(1, 14 + op.Length - 1),
13426Diagnostic(ErrorCode.ERR_IdentifierExpected, "=").WithLocation(1, 14 + op.Length - 1),
13429Diagnostic(ErrorCode.ERR_TupleTooFewElements, ")").WithLocation(1, 19 + op.Length - 1),
13432Diagnostic(ErrorCode.ERR_IdentifierExpected, "=>").WithLocation(1, 21 + op.Length - 1),
13435Diagnostic(ErrorCode.ERR_SyntaxError, "=>").WithArguments(",").WithLocation(1, 21 + op.Length - 1),
13438Diagnostic(ErrorCode.ERR_SyntaxError, "x").WithArguments(",").WithLocation(1, 24 + op.Length - 1),
13441Diagnostic(ErrorCode.ERR_IdentifierExpected, ";").WithLocation(1, 25 + op.Length - 1),
13444Diagnostic(ErrorCode.ERR_CloseParenExpected, ";").WithLocation(1, 25 + op.Length - 1)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (13)
Microsoft.CodeAnalysis.CSharp.Workspaces (33)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
Formatting\CSharpFormattingTestBase.cs (2)
27return AssertFormatAsync(code, code, [new TextSpan(0, code.Length)], changedOptionSet, testWithTransformation, parseOptions);
37return AssertFormatAsync(expected, code, [new TextSpan(0, code.Length)], changedOptionSet, testWithTransformation, parseOptions);
Microsoft.CodeAnalysis.Debugging.Package (9)
Microsoft.CodeAnalysis.EditorFeatures (79)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (22)
Microsoft.CodeAnalysis.EditorFeatures.Text (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (23)
Diagnostics\DiagnosticDataTests.cs (7)
36await VerifyTextSpanAsync(code, 30, 30, 40, 40, new TextSpan(code.Length, 0));
47await VerifyTextSpanAsync(code, 0, 30, 40, 40, new TextSpan(code.Length, 0));
58await VerifyTextSpanAsync(code, 0, 30, 0, 40, new TextSpan(code.Length, 0));
69await VerifyTextSpanAsync(code, 1, 30, 1, 40, new TextSpan(code.Length, 0));
80await VerifyTextSpanAsync(code, 1, 30, 1, 40, new TextSpan(code.Length, 0));
91await VerifyTextSpanAsync(code, 1, 30, 2, 40, new TextSpan(code.Length, 0));
102await VerifyTextSpanAsync(code, 1, 0, 1, 2, new TextSpan(code.Length, 0));
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (4)
86.WithDocumentText(documentId, text.Replace(textString.IndexOf("public"), "public".Length, "internal"))
87.WithDocumentText(linkedDocumentId, linkedText.Replace(textString.LastIndexOf("public"), "public".Length, "private"));
108.WithDocumentText(document.Id, (await document.GetTextAsync()).Replace(textString.IndexOf("public"), "public".Length, "internal"))
109.WithDocumentText(linkedDocument.Id, sourceText.Replace(textString.LastIndexOf("public"), "public".Length, "private"));
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (6)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (12)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (27)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (10)
Microsoft.CodeAnalysis.Extensions.Package (18)
Microsoft.CodeAnalysis.Features (215)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (33)
234context.AddIfMissing("{n}", Regex_match_exactly_n_times_short, Regex_match_exactly_n_times_long, parentOpt: null, positionOffset: "{".Length, insertionText: "{}");
235context.AddIfMissing("{n}?", Regex_match_exactly_n_times_lazy_short, Regex_match_exactly_n_times_lazy_long, parentOpt: null, positionOffset: "{".Length, insertionText: "{}?");
237context.AddIfMissing("{n,}", Regex_match_at_least_n_times_short, Regex_match_at_least_n_times_long, parentOpt: null, positionOffset: "{".Length, insertionText: "{,}");
238context.AddIfMissing("{n,}?", Regex_match_at_least_n_times_lazy_short, Regex_match_at_least_n_times_lazy_long, parentOpt: null, positionOffset: "{".Length, insertionText: "{,}?");
240context.AddIfMissing("{m,n}", Regex_match_between_m_and_n_times_short, Regex_match_between_m_and_n_times_long, parentOpt: null, positionOffset: "{".Length, insertionText: "{,}");
241context.AddIfMissing("{m,n}?", Regex_match_between_m_and_n_times_lazy_short, Regex_match_between_m_and_n_times_lazy_long, parentOpt: null, positionOffset: "{".Length, insertionText: "{,}?");
281var description = longDesc.Length > 0
306context.AddIfMissing($"( {Regex_subexpression} )", Regex_matched_subexpression_short, Regex_matched_subexpression_long, parentOpt, positionOffset: "(".Length, insertionText: "()");
307context.AddIfMissing($"(?< {Regex_name} > {Regex_subexpression} )", Regex_named_matched_subexpression_short, Regex_named_matched_subexpression_long, parentOpt, positionOffset: "(?<".Length, insertionText: "(?<>)");
308context.AddIfMissing($"(?< {Regex_name1} - {Regex_name2} > {Regex_subexpression} )", Regex_balancing_group_short, Regex_balancing_group_long, parentOpt, positionOffset: "(?<".Length, insertionText: "(?<->)");
309context.AddIfMissing($"(?: {Regex_subexpression} )", Regex_noncapturing_group_short, Regex_noncapturing_group_long, parentOpt, positionOffset: "(?:".Length, insertionText: "(?:)");
310context.AddIfMissing($"(?= {Regex_subexpression} )", Regex_zero_width_positive_lookahead_assertion_short, Regex_zero_width_positive_lookahead_assertion_long, parentOpt, positionOffset: "(?=".Length, insertionText: "(?=)");
311context.AddIfMissing($"(?! {Regex_subexpression} )", Regex_zero_width_negative_lookahead_assertion_short, Regex_zero_width_negative_lookahead_assertion_long, parentOpt, positionOffset: "(?!".Length, insertionText: "(?!)");
312context.AddIfMissing($"(?<= {Regex_subexpression} )", Regex_zero_width_positive_lookbehind_assertion_short, Regex_zero_width_positive_lookbehind_assertion_long, parentOpt, positionOffset: "(?<=".Length, insertionText: "(?<=)");
313context.AddIfMissing($"(?<! {Regex_subexpression} )", Regex_zero_width_negative_lookbehind_assertion_short, Regex_zero_width_negative_lookbehind_assertion_long, parentOpt, positionOffset: "(?<!".Length, insertionText: "(?<!)");
314context.AddIfMissing($"(?> {Regex_subexpression} )", Regex_atomic_group_short, Regex_atomic_group_long, parentOpt, positionOffset: "(?>".Length, insertionText: "(?>)");
316context.AddIfMissing($"(?( {Regex_expression} ) {Regex_yes} | {Regex_no} )", Regex_conditional_expression_match_short, Regex_conditional_expression_match_long, parentOpt, positionOffset: "(?(".Length, insertionText: "(?()|)");
317context.AddIfMissing($"(?( {Regex_name_or_number} ) {Regex_yes} | {Regex_no} )", Regex_conditional_group_match_short, Regex_conditional_group_match_long, parentOpt, positionOffset: "(?(".Length, insertionText: "(?()|)");
319context.AddIfMissing($"(?# {Regex_comment} )", Regex_inline_comment_short, Regex_inline_comment_long, parentOpt, positionOffset: "(?#".Length, insertionText: "(?#)");
320context.AddIfMissing($"(?imnsx-imnsx)", Regex_inline_options_short, Regex_inline_options_long, parentOpt, positionOffset: "(?".Length, insertionText: "(?)");
321context.AddIfMissing($"(?imnsx-imnsx: {Regex_subexpression} )", Regex_group_options_short, Regex_group_options_long, parentOpt, positionOffset: "(?".Length, insertionText: "(?:)");
333context.AddIfMissing($"[ {Regex_character_group} ]", Regex_positive_character_group_short, Regex_positive_character_group_long, parentOpt, positionOffset: "[".Length, insertionText: "[]");
334context.AddIfMissing($"[ firstCharacter-lastCharacter ]", Regex_positive_character_range_short, Regex_positive_character_range_long, parentOpt, positionOffset: "[".Length, insertionText: "[-]");
335context.AddIfMissing($"[^ {Regex_character_group} ]", Regex_negative_character_group_short, Regex_negative_character_group_long, parentOpt, positionOffset: "[^".Length, insertionText: "[^]");
336context.AddIfMissing($"[^ firstCharacter-lastCharacter ]", Regex_negative_character_group_short, Regex_negative_character_range_long, parentOpt, positionOffset: "[^".Length, insertionText: "[^-]");
337context.AddIfMissing($"[ {Regex_base_group} -[ {Regex_excluded_group} ] ]", Regex_character_class_subtraction_short, Regex_character_class_subtraction_long, parentOpt, positionOffset: "[".Length, insertionText: "[-[]]");
357context.AddIfMissing($@"\k< {Regex_name_or_number} >", Regex_named_backreference_short, Regex_named_backreference_long, parentOpt, @"\k<".Length, insertionText: @"\k<>");
365context.AddIfMissing(@"\1-9", Regex_numbered_backreference_short, Regex_numbered_backreference_long, parentOpt, @"\".Length, @"\");
377context.AddIfMissing(@"\x##", Regex_hexadecimal_escape_short, Regex_hexadecimal_escape_long, parentOpt, @"\x".Length, @"\x");
378context.AddIfMissing(@"\u####", Regex_unicode_escape_short, Regex_unicode_escape_long, parentOpt, @"\u".Length, @"\u");
379context.AddIfMissing(@"\cX", Regex_control_character_short, Regex_control_character_long, parentOpt, @"\c".Length, @"\c");
383context.AddIfMissing(@"\p{...}", Regex_unicode_category_short, Regex_unicode_category_long, parentOpt, @"\p".Length, @"\p");
384context.AddIfMissing(@"\P{...}", Regex_negative_unicode_category_short, Regex_negative_unicode_category_long, parentOpt, @"\P".Length, @"\P");
Microsoft.CodeAnalysis.Features.Test.Utilities (7)
Microsoft.CodeAnalysis.InteractiveHost (47)
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (17)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (197)
Microsoft.CodeAnalysis.PublicApiAnalyzers (192)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (1)
Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests (66)
DeclarePublicAPIAnalyzerTestsBase.cs (66)
290expectedDiagnostics = [GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C")];
305var expectedDiagnostics = new[] { GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C") };
328""", @"", @"", GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C"));
354GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C"),
356GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C.C() -> void"),
358GetCSharpResultAt(4, 10 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C.Field -> int"),
360GetCSharpResultAt(5, 21 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C.Property.get -> int"),
362GetCSharpResultAt(5, 26 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C.Property.set -> void"),
364GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C.Method() -> void"),
366GetCSharpResultAt(7, 37 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C.ArrowExpressionProperty.get -> int"));
385GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C"),
387GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C.C() -> void"),
389GetCSharpResultAt(4, 14 + EnabledModifierCSharp.Length, DeclareNewApiRule, $"C.Field -> {message}"),
391GetCSharpResultAt(5, 25 + EnabledModifierCSharp.Length, DeclareNewApiRule, $"C.Property.get -> {message}"),
393GetCSharpResultAt(5, 30 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C.Property.set -> void"),
395GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length, DeclareNewApiRule, $"C.Method({message} p) -> void"),
397GetCSharpResultAt(7, 41 + EnabledModifierCSharp.Length, DeclareNewApiRule, $"C.ArrowExpressionProperty.get -> {message}"));
545GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C.C() -> void"));
706var secondDiagnostic = new[] { GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C.Method() -> void") };
1221GetCSharpResultAt(21, 11 + EnabledModifierCSharp.Length, OverloadWithOptionalParametersShouldHaveMostParameters, "Method4", OverloadWithOptionalParametersShouldHaveMostParameters.HelpLinkUri),
1223GetCSharpResultAt(26, 11 + EnabledModifierCSharp.Length, OverloadWithOptionalParametersShouldHaveMostParameters, "Method5", OverloadWithOptionalParametersShouldHaveMostParameters.HelpLinkUri),
1225GetCSharpResultAt(31, 11 + EnabledModifierCSharp.Length, OverloadWithOptionalParametersShouldHaveMostParameters, "Method6", OverloadWithOptionalParametersShouldHaveMostParameters.HelpLinkUri),
1227GetCSharpResultAt(32, 11 + EnabledModifierCSharp.Length, OverloadWithOptionalParametersShouldHaveMostParameters, "Method6", OverloadWithOptionalParametersShouldHaveMostParameters.HelpLinkUri)
1342GetCSharpResultAt(4, 13 + EnabledModifierCSharp.Length, AnnotateApiRule, "C.Field -> string"),
1343GetCSharpResultAt(4, 13 + EnabledModifierCSharp.Length, ObliviousApiRule, "Field"),
1344GetCSharpResultAt(5, 24 + EnabledModifierCSharp.Length, AnnotateApiRule, "C.Property.get -> string"),
1345GetCSharpResultAt(5, 24 + EnabledModifierCSharp.Length, ObliviousApiRule, "Property.get"),
1346GetCSharpResultAt(5, 29 + EnabledModifierCSharp.Length, AnnotateApiRule, "C.Property.set -> void"),
1347GetCSharpResultAt(5, 29 + EnabledModifierCSharp.Length, ObliviousApiRule, "Property.set"),
1348GetCSharpResultAt(6, 13 + EnabledModifierCSharp.Length, AnnotateApiRule, "C.Method(string x) -> string"),
1349GetCSharpResultAt(6, 13 + EnabledModifierCSharp.Length, ObliviousApiRule, "Method"),
1350GetCSharpResultAt(7, 40 + EnabledModifierCSharp.Length, AnnotateApiRule, "C.ArrowExpressionProperty.get -> string"),
1351GetCSharpResultAt(7, 40 + EnabledModifierCSharp.Length, ObliviousApiRule, "ArrowExpressionProperty.get")
1377GetCSharpResultAt(4, 14 + EnabledModifierCSharp.Length, AnnotateApiRule, $"C.Field -> {annotated}"),
1378GetCSharpResultAt(5, 25 + EnabledModifierCSharp.Length, AnnotateApiRule, $"C.Property.get -> {annotated}"),
1379GetCSharpResultAt(6, 14 + EnabledModifierCSharp.Length, AnnotateApiRule, $"C.Method({annotated} x) -> {annotated}"),
1380GetCSharpResultAt(7, 41 + EnabledModifierCSharp.Length, AnnotateApiRule, $"C.ArrowExpressionProperty.get -> {annotated}"));
1427GetCSharpResultAt(4, 13 + EnabledModifierCSharp.Length, ObliviousApiRule, "Field"),
1429GetCSharpResultAt(9, 24 + EnabledModifierCSharp.Length, ObliviousApiRule, "Property.get"),
1430GetCSharpResultAt(9, 29 + EnabledModifierCSharp.Length, ObliviousApiRule, "Property.set"),
1431GetCSharpResultAt(10, 11 + EnabledModifierCSharp.Length, ObliviousApiRule, "Method"),
1432GetCSharpResultAt(11, 13 + EnabledModifierCSharp.Length, ObliviousApiRule, "Method2"),
1433GetCSharpResultAt(12, 40 + EnabledModifierCSharp.Length, ObliviousApiRule, "ArrowExpressionProperty.get"),
1435GetCSharpResultAt(20, 30 + EnabledModifierCSharp.Length, ObliviousApiRule, "this.get"),
1436GetCSharpResultAt(20, 50 + EnabledModifierCSharp.Length, ObliviousApiRule, "this.set")
1469GetCSharpResultAt(4, 11 + EnabledModifierCSharp.Length, ObliviousApiRule, "M<T>"),
1470GetCSharpResultAt(11, 8 + EnabledModifierCSharp.Length, ObliviousApiRule, "D<T>"),
1471GetCSharpResultAt(12, 25 + EnabledModifierCSharp.Length, ObliviousApiRule, "F<T>")
1525GetCSharpResultAt(5, 11 + EnabledModifierCSharp.Length, ObliviousApiRule, "M1<T>"),
1526GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length, ObliviousApiRule, "M2<T>"),
1527GetCSharpResultAt(7, 11 + EnabledModifierCSharp.Length, ObliviousApiRule, "M3<T, U>")
1554GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length, ObliviousApiRule, "M1<T>")
1649GetCSharpResultAt(7, 13 + EnabledModifierCSharp.Length, ObliviousApiRule, "field")
1697GetCSharpResultAt(10, 12 + EnabledModifierCSharp.Length, DeclareNewApiRule, "Other.Namespace.D"),
1699GetCSharpResultAt(12, 10 + EnabledModifierCSharp.Length, DeclareNewApiRule, "Other.Namespace.D.D() -> void"));
1735GetCSharpResultAt(line: 3, 12 + EnabledModifierCSharp.Length, DeclareNewApiRule, "My.Namespace.C"),
1737GetCSharpResultAt(5, 10 + EnabledModifierCSharp.Length, DeclareNewApiRule, "My.Namespace.C.C() -> void"));
2101GetCSharpResultAt(5, 13 + EnabledModifierCSharp.Length, AnnotateApiRule, "C.ObliviousField -> string"),
2103GetCSharpResultAt(5, 13 + EnabledModifierCSharp.Length, ObliviousApiRule, "ObliviousField")
2120GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C"),
2122GetCSharpResultAt(5, 18 + EnabledModifierCSharp.Length, DeclareNewApiRule, "static C.M<T>() -> void")
2136GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C<T>")
2155GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length, DeclareNewApiRule, "~C<T1, T2>"),
2157GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length, ObliviousApiRule, "C<T1, T2>")
2176GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length, DeclareNewApiRule, "~C<T>"),
2178GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length, ObliviousApiRule, "C<T>")
Microsoft.CodeAnalysis.Rebuild (1)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Microsoft.CodeAnalysis.Remote.Workspaces (6)
Microsoft.CodeAnalysis.ResxSourceGenerator (200)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (6)
Microsoft.CodeAnalysis.Scripting (16)
Microsoft.CodeAnalysis.Test.Utilities (23)
Microsoft.CodeAnalysis.Threading.Package (2)
Microsoft.CodeAnalysis.UnitTests (53)
Text\LargeTextTests.cs (11)
48Assert.Equal(HelloWorld.Length, text.Length);
66Assert.Throws<IndexOutOfRangeException>(() => text[HelloWorld.Length]);
67for (int i = HelloWorld.Length - 1; i >= 0; i--)
79char[] buffer = new char[HelloWorld.Length + destOffset];
126char[] buffer = new char[HelloWorld.Length];
127for (int start = 0; start < text.Length; start += HelloWorld.Length)
129text.CopyTo(start, buffer, 0, HelloWorld.Length);
201CheckLine(data, lineNumber: 0, start: 0, length: 3, newlineLength: newline.Length, lineText: "goo");
202CheckLine(data, lineNumber: 1, start: 3 + newline.Length, length: 4, newlineLength: 0, lineText: " bar");
214var newlineLength = Environment.NewLine.Length;
335var actualSourceText = CreateSourceText(actual, expected.Length);
Text\SourceTextTests.cs (10)
217using (var writer = new LargeTextWriter(encoding, checksumAlgorithm, source.Length))
280allSourceTexts.Add(LargeText.Decode(new StringReader(randomText), randomText.Length, encoding, algorithm));
370var actualSourceText = SourceText.From(actual, expected.Length);
374Assert.Same(s_utf8, SourceText.From(actual, expected.Length, s_utf8).Encoding);
375Assert.Same(s_unicode, SourceText.From(actual, expected.Length, s_unicode).Encoding);
376Assert.Null(SourceText.From(actual, expected.Length, null).Encoding);
386var actualSourceText = SourceText.From(actual, expected.Length);
393Assert.Same(s_utf8, SourceText.From(actual, expected.Length, s_utf8).Encoding);
394Assert.Same(s_unicode, SourceText.From(actual, expected.Length, s_unicode).Encoding);
395Assert.Null(SourceText.From(actual, expected.Length, null).Encoding);
Text\StringTextTest.cs (3)
154CheckLine(data, lineNumber: 0, start: 0, length: 3, newlineLength: newLine.Length, lineText: "goo");
155CheckLine(data, lineNumber: 1, start: 3 + newLine.Length, length: 4, newlineLength: 0, lineText: " bar");
167var newlineLength = Environment.NewLine.Length;
Microsoft.CodeAnalysis.VisualBasic (113)
Microsoft.CodeAnalysis.Workspaces (265)
PatternMatching\PatternMatcher.cs (12)
125for (var i = 0; i < pattern.Length; i++)
137for (var i = 0; i < pattern.Length; i++)
153var candidateLength = candidate.Length;
161if (patternChunk.Text.Length == candidateLength)
191PatternMatchKind.Prefix, punctuationStripped, isCaseSensitive, matchedSpan: GetMatchedSpan(0, patternChunk.Text.Length));
216matchedSpan: GetMatchedSpan(caseSensitiveIndex, patternChunk.Text.Length));
231matchedSpan: GetMatchedSpan(caseInsensitiveIndex, patternChunk.Text.Length));
246matchedSpan: GetMatchedSpan(hump.Start, patternChunk.Text.Length));
271if (patternIsLowercase && caseInsensitiveIndex > 0 && patternChunk.Text.Length >= 3)
278matchedSpan: GetMatchedSpan(caseSensitiveIndex, patternChunk.Text.Length));
296for (var i = 0; i < text.Length; i++)
424=> PartStartsWith(candidate, candidatePart, pattern, new TextSpan(0, pattern.Length), compareOptions);
Shared\Utilities\XmlFragmentParser.cs (9)
150_position = s_rootStart.Length;
173_position += EncodeAndAdvance(s_currentStart, _position - s_rootStart.Length, buffer, ref index, ref count);
176_position += EncodeAndAdvance(_text, _position - s_rootStart.Length - s_currentStart.Length, buffer, ref index, ref count);
179_position += EncodeAndAdvance(s_currentEnd, _position - s_rootStart.Length - s_currentStart.Length - _text.Length, buffer, ref index, ref count);
193if (destCount == 0 || srcIndex < 0 || srcIndex >= src.Length)
198var charCount = Math.Min(src.Length - srcIndex, destCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
391if (name.Length > 0)
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (81)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (20)
Microsoft.CSharp (7)
Microsoft.Data.Analysis (11)
Microsoft.Data.Analysis.Tests (9)
Microsoft.DotNet.Arcade.Sdk (11)
Microsoft.DotNet.Arcade.Sdk.Tests (1)
Microsoft.DotNet.ArcadeLogging (2)
Microsoft.DotNet.Build.Tasks.Feed (11)
Microsoft.DotNet.Build.Tasks.Installers (6)
Microsoft.DotNet.Build.Tasks.Packaging (14)
Microsoft.DotNet.Build.Tasks.TargetFramework (1)
Microsoft.DotNet.Build.Tasks.Templating (3)
Microsoft.DotNet.Build.Tasks.VisualStudio (4)
Microsoft.DotNet.Build.Tasks.Workloads (4)
Microsoft.DotNet.Helix.Client (2)
Microsoft.DotNet.Helix.JobSender (1)
Microsoft.DotNet.Helix.Sdk (3)
Microsoft.DotNet.MacOsPkg.Tests (1)
Microsoft.DotNet.NuGetRepack.Tests (1)
Microsoft.DotNet.RemoteExecutor (6)
Microsoft.DotNet.SignCheckLibrary (1)
Microsoft.DotNet.SignTool (10)
Microsoft.DotNet.SourceBuild.Tasks (7)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (3)
Microsoft.DotNet.XliffTasks (9)
Microsoft.DotNet.XUnitAssert.Tests (25)
AsyncCollectionAssertsTests.cs (25)
645 "Actual: " + new string(' ', expectedType.Length) + " null",
754 var padding = Math.Max(expectedType.Length, actualType.Length);
792 var padding = Math.Max(expectedType.Length, actualType.Length);
873 var padding = Math.Max(expectedType.Length, actualType.Length);
925 var padding = Math.Max(expectedType.Length, actualType.Length);
965 var padding = Math.Max(expectedType.Length, actualType.Length);
1026 var padding = Math.Max(expectedType.Length, actualType.Length);
1141 var padding = Math.Max(expectedType.Length, actualType.Length);
1191 var padding = Math.Max(expectedType.Length, actualType.Length);
1232 var padding = Math.Max(expectedType.Length, actualType.Length);
1274 var padding = Math.Max(expectedType.Length, actualType.Length);
1332 var padding = Math.Max(expectedType.Length, actualType.Length);
1359 var padding = Math.Max(expectedType.Length, actualType.Length);
Microsoft.Extensions.AI (4)
Microsoft.Extensions.AI.Abstractions (22)
Microsoft.Extensions.AI.Abstractions.Tests (1)
Microsoft.Extensions.AI.Evaluation.NLP (5)
Microsoft.Extensions.AI.Evaluation.Quality (1)
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (2)
Microsoft.Extensions.AI.Integration.Tests (4)
Microsoft.Extensions.AI.OpenAI (7)
Microsoft.Extensions.ApiDescription.Client (2)
Microsoft.Extensions.Caching.Hybrid (10)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
Microsoft.Extensions.Compliance.Abstractions (2)
Microsoft.Extensions.Compliance.Abstractions.Tests (12)
Microsoft.Extensions.Compliance.Redaction (4)
Microsoft.Extensions.Compliance.Redaction.Tests (4)
Microsoft.Extensions.Compliance.Testing (4)
Microsoft.Extensions.Configuration (5)
Microsoft.Extensions.Configuration.Abstractions (1)
Microsoft.Extensions.Configuration.Binder (1)
Microsoft.Extensions.Configuration.EnvironmentVariables (2)
Microsoft.Extensions.Configuration.Ini (5)
Microsoft.Extensions.Configuration.KeyPerFile (2)
Microsoft.Extensions.Configuration.Xml (3)
Microsoft.Extensions.DataIngestion (9)
Microsoft.Extensions.DataIngestion.Markdig (1)
Microsoft.Extensions.DataIngestion.MarkItDown (1)
Microsoft.Extensions.DependencyInjection (8)
Microsoft.Extensions.DependencyModel (5)
Microsoft.Extensions.Diagnostics (4)
Microsoft.Extensions.Diagnostics.Abstractions (2)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (1)
Microsoft.Extensions.Diagnostics.Probes (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (18)
Microsoft.Extensions.FileProviders.Embedded (12)
Microsoft.Extensions.FileProviders.Physical (6)
Microsoft.Extensions.FileSystemGlobbing (13)
Microsoft.Extensions.Hosting (2)
Microsoft.Extensions.Hosting.Systemd (1)
Microsoft.Extensions.Http (4)
Microsoft.Extensions.Http.Diagnostics (7)
Microsoft.Extensions.Http.Diagnostics.Tests (3)
Microsoft.Extensions.Http.Resilience (1)
Microsoft.Extensions.Identity.Core (3)
Microsoft.Extensions.Identity.Stores (1)
Microsoft.Extensions.Localization (1)
Microsoft.Extensions.Localization.Tests (1)
Microsoft.Extensions.Logging (2)
Microsoft.Extensions.Logging.Abstractions (8)
Microsoft.Extensions.Logging.AzureAppServices (1)
Microsoft.Extensions.Logging.Console (4)
Microsoft.Extensions.Logging.EventLog (4)
Microsoft.Extensions.Logging.EventSource (5)
Microsoft.Extensions.Logging.Generators (9)
Microsoft.Extensions.Options (1)
Microsoft.Extensions.Options.SourceGeneration (7)
Microsoft.Extensions.Primitives (11)
Microsoft.Extensions.ServiceDiscovery (1)
Microsoft.Extensions.ServiceDiscovery.Dns (2)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (5)
Microsoft.Extensions.ServiceDiscovery.Yarp (1)
Microsoft.Extensions.Telemetry (22)
Microsoft.Extensions.Telemetry.Abstractions (2)
Microsoft.Extensions.Telemetry.Tests (2)
Microsoft.Extensions.WebEncoders (3)
Microsoft.Gen.BuildMetadata (4)
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
Microsoft.Gen.ComplianceReports (5)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
Microsoft.Gen.ContextualOptions (2)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
Microsoft.Gen.Logging (9)
Microsoft.Gen.Logging.Generated.Tests (16)
LogPropertiesRedactionTests.cs (14)
36["p1.StringPropertyBase"] = new('-', classToRedact.StringPropertyBase.Length),
62["p1.StringPropertyBase"] = new('-', classToRedact.StringPropertyBase.Length),
84["classToLog.StringProperty"] = new('+', classToRedact.StringProperty.Length),
85["classToLog.StringPropertyBase"] = new('-', classToRedact.StringPropertyBase.Length),
87["classToLog.GetOnlyProperty"] = new('-', classToRedact.GetOnlyProperty.Length),
89["classToLog.TransitiveProp.TransitiveStringProp"] = new('-', classToRedact.TransitiveProp.TransitiveStringProp.Length),
91["classToLog.NonFormattableProperty"] = new('-', classToRedact.NonFormattableProperty.ToString().Length),
115["classToLog.StringProperty"] = new('+', classToRedact.StringProperty.Length),
116["classToLog.StringPropertyBase"] = new('-', classToRedact.StringPropertyBase.Length),
118["classToLog.GetOnlyProperty"] = new('-', classToRedact.GetOnlyProperty.Length),
120["classToLog.TransitiveProp.TransitiveStringProp"] = new('-', classToRedact.TransitiveProp.TransitiveStringProp.Length),
122["classToLog.NonFormattableProperty"] = new('-', classToRedact.NonFormattableProperty.ToString().Length),
146["complexParam.TransitiveStringProp"] = new('-', classToRedact.TransitiveStringProp.Length),
172["complexParam.TransitiveStringProp"] = new('-', classToRedact.TransitiveStringProp.Length),
Microsoft.Gen.Logging.Unit.Tests (2)
Microsoft.Gen.MetadataExtractor (5)
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
Microsoft.Gen.Metrics (5)
Microsoft.Gen.Metrics.Unit.Tests (1)
Microsoft.Gen.MetricsReports (2)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
Microsoft.Interop.ComInterfaceGenerator (4)
Microsoft.Interop.JavaScript.JSImportGenerator (3)
Microsoft.Interop.LibraryImportGenerator (3)
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
Microsoft.Interop.SourceGeneration (2)
Microsoft.Maui (9)
Microsoft.Maui.Controls (22)
Microsoft.Maui.Controls.Build.Tasks (10)
Microsoft.Maui.Controls.DesignTools (3)
Microsoft.Maui.Controls.SourceGen (6)
Microsoft.Maui.Controls.Xaml (27)
Microsoft.Maui.Essentials (8)
Microsoft.Maui.Graphics (17)
Microsoft.Maui.Graphics.Skia (1)
Microsoft.Maui.Graphics.Text.Markdig (1)
Microsoft.Maui.Resizetizer (1)
Microsoft.ML.AutoML (11)
Microsoft.ML.AutoML.SourceGenerator (31)
Microsoft.ML.CodeGenerator (60)
Microsoft.ML.Core (51)
Microsoft.ML.Data (38)
Microsoft.ML.EntryPoints (2)
Microsoft.ML.FastTree (5)
Microsoft.ML.GenAI.Core (5)
Microsoft.ML.GenAI.Mistral (3)
Microsoft.ML.ImageAnalytics (1)
Microsoft.ML.IntegrationTests (1)
Microsoft.ML.InternalCodeAnalyzer (5)
Microsoft.ML.LightGbm (2)
Microsoft.ML.Maml (4)
Microsoft.ML.OnnxConverter (100)
Microsoft.ML.OnnxTransformer (100)
Microsoft.ML.PerformanceTests (2)
Microsoft.ML.Predictor.Tests (19)
Microsoft.ML.ResultProcessor (2)
Microsoft.ML.Samples (7)
Microsoft.ML.Samples.GPU (7)
Microsoft.ML.StandardTrainers (3)
Microsoft.ML.Sweeper (1)
Microsoft.ML.TensorFlow (3)
Microsoft.ML.TensorFlow.Tests (1)
Microsoft.ML.TestFramework (8)
Microsoft.ML.TestFrameworkCommon (2)
Microsoft.ML.Tests (2)
Microsoft.ML.Tokenizers (119)
Microsoft.ML.Tokenizers.Tests (133)
BpeTests.cs (11)
331char[] destinationBuffer = new char[expectedDecoded.Length];
345Assert.True(charactersWritten < expectedDecoded.Length);
354Assert.Equal(expectedDecoded.Length, charactersWritten);
490Assert.Equal(text.Length, length);
493Assert.Equal(text.Length, length);
848char[] destinationBuffer = new char[beginningOfSentenceToken.Length + text.Length];
855Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan(0, text.Length - 1), considerSpecialTokens: false, out idsConsumed, out charsWritten));
857Assert.True(charsWritten < text.Length);
858Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan(0, text.Length), considerSpecialTokens: true, out idsConsumed, out charsWritten));
860Assert.True(charsWritten <= text.Length);
CodeGenTests.cs (72)
304char[] destinationBuffer = new char[expectedDecoded.Length];
318Assert.True(charactersWritten < expectedDecoded.Length);
327Assert.Equal(expectedDecoded.Length, charactersWritten);
381Assert.Equal(text.Length, length);
384Assert.Equal(text.Length, length);
388Assert.Equal(text.Length, length);
391Assert.Equal(text.Length, length);
395Assert.Equal(text.Length, length);
398Assert.Equal(text.Length, length);
468int expectedIndex = offsets.Length > 1 && offsets[offsets.Length - 1].Index == offsets[offsets.Length - 2].Index ? text.Length : offsets[offsets.Length - 1].Index;
469int expectedTokenCount = expectedIndex == text.Length ? 0 : 1;
484expectedIndex = offsets.Length > 1 && expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index == expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 2].Index ? text.Length : expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index;
485expectedTokenCount = expectedIndex == text.Length ? 0 : 1;
640Assert.Equal(text.Length, length);
643Assert.Equal(text.Length, length);
646Assert.Equal(text.Length, length);
649Assert.Equal(text.Length, length);
652Assert.Equal(text.Length, length);
655Assert.Equal(text.Length, length);
691Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
696Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
701Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
706Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
715Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
720Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
725Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
730Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
735Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
740Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
773Assert.Equal(text.Length, length);
776Assert.Equal(text.Length, length);
779Assert.Equal(text.Length, length);
782Assert.Equal(text.Length, length);
785Assert.Equal(text.Length, length);
788Assert.Equal(text.Length, length);
827Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
833Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
839Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
845Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
857Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
863Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
869Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
875Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
881Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
887Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
927Assert.Equal(text.Length, length);
930Assert.Equal(text.Length, length);
933Assert.Equal(text.Length, length);
936Assert.Equal(text.Length, length);
939Assert.Equal(text.Length, length);
942Assert.Equal(text.Length, length);
1017calculatedLengthUsingOffsets = expectedTokenCountFromEnd > 0 ? offsets[offsets.Length - expectedTokenCountFromEnd].Index : input.Length;
LlamaTests.cs (20)
300char[] destinationBuffer = new char[expectedDecoded.Length];
314Assert.True(charactersWritten < expectedDecoded.Length);
323Assert.Equal(expectedDecoded.Length, charactersWritten);
387Span<char> destinationBuffer = stackalloc char[llamaTokenizer.EndOfSentenceToken.Length];
389Assert.Equal(llamaTokenizer.EndOfSentenceToken.Length, charactersWritten);
536expectedOffsets1 = addEndOfSentence ? expectedOffsets1.Concat(new[] { (normalizedText.Length, 0) }).ToArray() : expectedOffsets1;
560Assert.Equal(normalizedText.Length, length);
563Assert.Equal(normalizedText.Length, length);
594Assert.Equal(normalizedText.Length, length);
692Assert.Equal(index, accumulatedString.Length);
701Assert.Equal(index, normalizedText!.Length - accumulatedStringFromEnd.Length);
841char[] destinationBuffer = new char[decodedWithNoSpecialTokens.Length];
855Assert.Equal(decodedWithNoSpecialTokens.Length, charactersWritten);
858destinationBuffer = new char[textWithSpecialTokens.Length];
869Assert.Equal(textWithSpecialTokens.Length, charactersWritten);
883destinationBuffer = new char[decodedWithNoSpecialTokens.Length + 1]; // one extra for suffix
894Assert.Equal(decodedWithNoSpecialTokens.Length, charactersWritten);
897destinationBuffer = new char[textWithSpecialTokens.Length + 1];
913Assert.Equal(textWithSpecialTokens.Length, charactersWritten);
UnigramTests.cs (8)
305Assert.True(writableTokens[writableTokens.Count - 1].Offset.Equals(new Range(normalized.Length, normalized.Length)));
500IReadOnlyList<int> ids2 = index < normalized.Length ? _unigramTokenizer.EncodeToIds(normalized!.Substring(index), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false) : new List<int>();
506ids2 = index < normalized.Length ? _unigramTokenizer.EncodeToIds(normalized!.Substring(index).AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false) : new List<int>();
512ids2 = index < normalized.Length ? _unigramTokenizer.EncodeToIds(normalized!.Substring(index), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false) : new List<int>();
518ids2 = index < normalized.Length ? _unigramTokenizer.EncodeToIds(normalized!.Substring(index).AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false) : new List<int>();
540char[] buffer = new char[decodedString.Length];
547for (int i = 0; i < decodedString.Length - 1; i++)
Microsoft.ML.TorchSharp (5)
Microsoft.ML.Transforms (5)
Microsoft.ML.Vision (2)
Microsoft.Net.Http.Headers (41)
Microsoft.NET.StringTools (11)
Microsoft.NET.StringTools.net35 (11)
Microsoft.VisualBasic.Core (154)
Microsoft.VisualBasic.Tests (1)
Microsoft.VisualStudio.Extensibility.Testing.Xunit (4)
Microsoft.VisualStudio.LanguageServices (41)
Microsoft.VisualStudio.LanguageServices.CSharp (6)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (11)
PersistentStorage\AbstractPersistentStorageTests.cs (10)
56private static readonly string MediumData1 = string.Join(",", Enumerable.Repeat(SmallData1, MediumSize / SmallData1.Length));
57private static readonly string MediumData2 = string.Join(",", Enumerable.Repeat(SmallData2, MediumSize / SmallData2.Length));
59private static readonly string LargeData1 = string.Join(",", Enumerable.Repeat(SmallData1, LargeSize / SmallData1.Length));
60private static readonly string LargeData2 = string.Join(",", Enumerable.Repeat(SmallData2, LargeSize / SmallData2.Length));
62private static readonly string ExtraLargeData1 = string.Join(",", Enumerable.Repeat(SmallData1, ExtraLargeSize / SmallData1.Length));
63private static readonly string ExtraLargeData2 = string.Join(",", Enumerable.Repeat(SmallData2, ExtraLargeSize / SmallData2.Length));
72Assert.True(MediumData1.Length < SQLite.v2.SQLitePersistentStorage.MaxPooledByteArrayLength);
73Assert.True(MediumData2.Length < SQLite.v2.SQLitePersistentStorage.MaxPooledByteArrayLength);
75Assert.True(LargeData1.Length > SQLite.v2.SQLitePersistentStorage.MaxPooledByteArrayLength);
76Assert.True(LargeData2.Length > SQLite.v2.SQLitePersistentStorage.MaxPooledByteArrayLength);
Microsoft.VisualStudio.LanguageServices.Implementation (7)
Microsoft.Web.Xdt.Extensions (1)
MyFrontend (24)
PrepareTests (2)
PresentationBuildTasks (129)
PresentationCore (127)
System\Windows\Media\FormattedText.cs (22)
225_latestPosition = _formatRuns.SetValue(0, _text.Length, runProps, _latestPosition);
287ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, _text.Length);
291if (count < 0 || limit < startIndex || limit > _text.Length)
309SetForegroundBrush(foregroundBrush, 0, _text.Length);
358SetFontFamily(fontFamily, 0, _text.Length);
380SetFontFamily(fontFamily, 0, _text.Length);
434SetFontSize(emSize, 0, _text.Length);
486SetCulture(culture, 0, _text.Length);
541SetNumberSubstitution(numberSubstitution, 0, _text.Length);
604SetFontWeight(weight, 0, _text.Length);
654SetFontStyle(style, 0, _text.Length);
705SetFontStretch(stretch, 0, _text.Length);
756SetFontTypeface(typeface, 0, _text.Length);
806SetTextDecorations(textDecorations, 0, _text.Length);
964if (_that._text.Length == 0)
1009if (_textStorePosition + _currentLine.Length < _that._text.Length)
1086Debug.Assert(_that._text.Length > 0 && textSourcePosition + line.Length <= _that._text.Length + 1);
1091Math.Min(textSourcePosition + line.Length - 1, _that._text.Length - 1)
1538return BuildHighlightGeometry(origin, 0, _text.Length);
1709if (_text.Length == 0)
1815if (textSourceCharacterIndex >= _that._text.Length)
PresentationFramework (414)
System\Windows\Documents\TextFindEngine.cs (18)
111SafeNativeMethods.GetStringTypeEx(0 /* ignored */, SafeNativeMethods.CT_CTYPE1, [findPattern[findPattern.Length - 1]], new Span<UInt16>(ref endCharType1));
206int textBlockLength = Math.Max(TextBlockLength, findPattern.Length * 2 * 2);
228if (!matchDiacritics || findTextLength >= findPattern.Length)
279if (findTextLength > findPattern.Length)
283navigator.MoveByOffset(matchLast ? - findTextPositionMap[findText.Length - findTextLength + findPattern.Length] : findTextPositionMap[findTextLength - findPattern.Length]);
414int searchLength = textString.Length;
424matchLength = findPattern.Length;
444searchLength = textString.Length - searchStart;
469int startIndex = matchLast ? textString.Length - 1 : 0;
470int endIndex = matchLast ? -1 : textString.Length;
521for (int j = i; j < textString.Length; j++)
551for (int j = i; j < textString.Length; j++)
553if (compareInfo.Compare(textString, i, j - i + 1, findPattern, 0, findPattern.Length, options) == 0 &&
575sourceString, sourceString.Length, findString, findString.Length, out found);
783for (int index = 0; index < textString.Length; index++)
822int textLength = textString.Length;
PresentationUI (1)
Publishers.AppHost (1)
ReachFramework (24)
Replay (4)
RepoTasks (2)
ResultsOfTGenerator (1)
Roslyn.Diagnostics.Analyzers (198)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
391if (name.Length > 0)
Roslyn.Diagnostics.Analyzers.UnitTests (4)
Roslyn.Diagnostics.CSharp.Analyzers (36)
Roslyn.Test.PdbUtilities (5)
Roslyn.Test.Performance.Utilities (1)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Roslyn.VisualStudio.Next.UnitTests (1)
RulesetToEditorconfigConverter (2)
RunTests (3)
Sample (3)
Sandbox (36)
ServerComparison.FunctionalTests (1)
ServerComparison.TestSites (3)
Shared (2)
SignalR.Client.FunctionalTestApp (1)
SocialWeather (4)
Sockets.BindTests (4)
Sockets.FunctionalTests (5)
Stress.AppHost (1)
Stress.TelemetryService (84)
Swaggatherer (9)
System.CodeDom (45)
System.Collections.Immutable (35)
System\Collections\Frozen\String\KeyAnalyzer.cs (10)
112static (string s, int index, int count) => s.AsSpan(s.Length + index, count));
258public override bool Equals(string? x, string? y) => x.AsSpan(IsLeft ? Index : (x!.Length + Index), Count).SequenceEqual(y.AsSpan(IsLeft ? Index : (y!.Length + Index), Count));
259public override int GetHashCode(string s) => Hashing.GetHashCodeOrdinal(s.AsSpan(IsLeft ? Index : (s.Length + Index), Count));
264public override bool Equals(string? x, string? y) => x.AsSpan(IsLeft ? Index : (x!.Length + Index), Count).Equals(y.AsSpan(IsLeft ? Index : (y!.Length + Index), Count), StringComparison.OrdinalIgnoreCase);
265public override int GetHashCode(string s) => Hashing.GetHashCodeOrdinalIgnoreCase(s.AsSpan(IsLeft ? Index : (s.Length + Index), Count));
270public override bool Equals(string? x, string? y) => x.AsSpan(IsLeft ? Index : (x!.Length + Index), Count).Equals(y.AsSpan(IsLeft ? Index : (y!.Length + Index), Count), StringComparison.OrdinalIgnoreCase);
271public override int GetHashCode(string s) => Hashing.GetHashCodeOrdinalIgnoreCaseAscii(s.AsSpan(IsLeft ? Index : (s.Length + Index), Count));
System.ComponentModel.Annotations (12)
System.ComponentModel.Composition (8)
System.ComponentModel.TypeConverter (30)
System.Composition.Convention (9)
System.Configuration.ConfigurationManager (65)
System.Console (14)
System.Data.Common (190)
System.Data.Odbc (86)
System\Data\Odbc\OdbcDataReader.cs (22)
1161int cachedObjectLength = isCharsBuffer ? ((string)cachedObj).Length : ((byte[])cachedObj).Length;
2747if ((localcmdtext.Length > 0) && (localcmdtext[0] == ','))
2751if ((localcmdtext.Length == 2) &&
2758if ((localcmdtext.Length > 0) && (localcmdtext[0] == ','))
2846if ((str != null) && (str.Length > 0))
2851Debug.Assert(str.Length > 1, "Illegal string, only one char that is a quote");
2852Debug.Assert(str[str.Length - 1] == quoteChar, "Missing quote at end of string that begins with quote");
2853if (str.Length > 1 && str[str.Length - 1] == quoteChar)
2855str = str.Substring(1, str.Length - 2);
2884for (parts = 0; (parts < qualifiers.Length) && (currentPos < name.Length); ++parts)
2889if (useQuotes && (name.IndexOf(quotePrefix!, currentPos, quotePrefix!.Length, StringComparison.Ordinal) == currentPos))
2893currentPos += quotePrefix.Length; // move past the quotePrefix
2896while (currentPos < name.Length)
2902currentPos = name.Length;
2907currentPos += quoteSuffix.Length; // move past the quoteSuffix
2910if ((currentPos < name.Length) && (name.IndexOf(quoteSuffix, currentPos, quoteSuffix.Length, StringComparison.Ordinal) == currentPos))
2913currentPos += quoteSuffix.Length; // move past the second quoteSuffix
2925if (currentPos < name.Length)
2931currentPos = name.Length;
2936currentPos += Separator.Length;
System.Diagnostics.DiagnosticSource (48)
System\Diagnostics\DsesFilterAndTransform.cs (13)
59int endIdx = filterAndPayloadSpecs.Length;
112Debug.Assert(filterAndPayloadSpec != null && startIdx >= 0 && startIdx <= endIdx && endIdx <= filterAndPayloadSpec.Length);
219int colonIdx = filterAndPayloadSpec.IndexOf(':', startIdx + c_ActivitySourcePrefix.Length, endIdx - startIdx - c_ActivitySourcePrefix.Length);
222startIdx + c_ActivitySourcePrefix.Length,
223(colonIdx >= 0 ? colonIdx : endIdx) - startIdx - c_ActivitySourcePrefix.Length)
256|| !double.TryParse(suffixPart.Slice(c_ParentRatioSamplerPrefix.Length, endingLocation - c_ParentRatioSamplerPrefix.Length), NumberStyles.Float, CultureInfo.InvariantCulture, out double ratio))
274suffixPart.Slice(c_ParentRateLimitingSamplerPrefix.Length, endingLocation - c_ParentRateLimitingSamplerPrefix.Length),
334if (activityName.Length > 0 && activitySourceName.Length == 1 && activitySourceName[0] == '*')
611Debug.Assert(transformSpec != null && startIdx >= 0 && startIdx < endIdx && endIdx <= transformSpec.Length);
1028newSerializableArgs = new TransformSpec(eventSource, property.Name, 0, property.Name.Length, newSerializableArgs);
System.Diagnostics.Process (29)
System.Diagnostics.TextWriterTraceListener (9)
System.Diagnostics.TraceSource (1)
System.DirectoryServices.Protocols (10)
System.Drawing.Common (23)
System.Drawing.Common.Tests (5)
System.Drawing.Primitives (11)
System.Formats.Nrbf (4)
System.Formats.Tar (24)
System.IO.Compression.ZipFile (5)
System.IO.FileSystem.DriveInfo (3)
System.IO.FileSystem.Watcher (21)
System.IO.IsolatedStorage (5)
System.IO.MemoryMappedFiles (4)
System.IO.Packaging (52)
System.IO.Pipes (1)
System.IO.Ports (9)
System.Linq.Expressions (3)
System.Net.Http (239)
System.Net.Http.Json (3)
System.Net.HttpListener (52)
System.Net.Mail (74)
System\Net\Mail\MailPriority.cs (12)
278EnvelopeHeaders.InternalSet(xSenderHeader, sender.Encode(xSenderHeader.Length, allowUnicode));
286EnvelopeHeaders.InternalAdd(headerName, address.Encode(headerName.Length, allowUnicode));
290EnvelopeHeaders.InternalAdd(headerName, address.Encode(headerName.Length, allowUnicode));
294EnvelopeHeaders.InternalAdd(headerName, address.Encode(headerName.Length, allowUnicode));
312Headers.InternalAdd(headerName, Sender.Encode(headerName.Length, allowUnicode));
320Headers.InternalAdd(headerName, From!.Encode(headerName.Length, allowUnicode));
325Headers.InternalAdd(headerName, To.Encode(headerName.Length, allowUnicode));
335Headers.InternalAdd(headerName, CC.Encode(headerName.Length, allowUnicode));
345Headers.InternalAdd(headerName, ReplyTo.Encode(headerName.Length, allowUnicode));
349Headers.InternalAdd(headerName, ReplyToList.Encode(headerName.Length, allowUnicode));
393headerName.Length));
439headerName.Length);
System.Net.NameResolution (8)
System.Net.NetworkInformation (15)
System.Net.Ping (1)
System.Net.Primitives (27)
System.Net.Quic (4)
System.Net.Requests (39)
System.Net.Security (13)
System.Net.Sockets (7)
System.Net.WebClient (6)
System.Net.WebHeaderCollection (5)
System.Net.WebProxy (2)
System.Net.WebSockets (13)
System.Net.WebSockets.Client (1)
System.Private.CoreLib (962)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (10)
84uint v1MetadataLength = 24 + ((uint)eventName.Length + 1) * 2;
152WriteToBuffer(pMetadata, totalMetadataLength, ref offset, (byte*)pEventName, ((uint)eventName.Length + 1) * 2);
303EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (byte*)pParameterName, ((uint)ParameterName.Length + 1) * 2);
348EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (byte*)pPropertyName, ((uint)property.name.Length + 1) * 2);
370EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (byte*)pPropertyName, ((uint)property.name.Length + 1) * 2);
397EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (byte*)pPropertyName, ((uint)name.Length + 1) * 2);
604size += (uint)(sizeof(uint) + ((ParameterName.Length + 1) * 2));
638ret += (uint)((property.name.Length + 1) * 2);
642ret += (uint)(sizeof(uint) + ((property.name.Length + 1) * 2));
752((name.Length + 1) * 2));
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (14)
308return Compare(string1, offset1, string1 == null ? 0 : string1.Length - offset1,
309string2, offset2, string2 == null ? 0 : string2.Length - offset2, options);
391if (offset1 > (string1 == null ? 0 : string1.Length) - length1)
396Debug.Assert(offset2 > (string2 == null ? 0 : string2.Length) - length2);
842return IndexOf(source, value, startIndex, source.Length - startIndex, options);
853return IndexOf(source, value, startIndex, source.Length - startIndex, options);
878if ((uint)startIndex > (uint)source.Length)
912if ((uint)startIndex > (uint)source.Length)
1204if ((uint)startIndex >= (uint)source.Length)
1206if (startIndex == -1 && source.Length == 0)
1210else if (startIndex == source.Length)
1264if ((uint)startIndex >= (uint)source.Length)
1266if (startIndex == -1 && source.Length == 0)
1270else if (startIndex == source.Length)
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (5)
46return _sortName.Length == 0 ||
47(_sortName.Length >= 2 && _sortName[0] == 'e' && _sortName[1] == 'n' && (_sortName.Length == 2 || _sortName[2] == '-'));
712sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, null, 0, options);
729if (Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKeyLength, options) != sortKeyLength)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (15)
533if (designator.Length >= 1)
933TryFormatS(dateTime, new Span<char>(ref str.GetRawStringData(), str.Length), out int charsWritten);
940TryFormatInvariantG(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out int charsWritten);
959TryFormatInvariantG(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out int charsWritten);
969else if (format.Length == 1)
985TryFormatR(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out charsWritten);
986Debug.Assert(charsWritten == str.Length);
992TryFormatS(dateTime, new Span<char>(ref str.GetRawStringData(), str.Length), out charsWritten);
993Debug.Assert(charsWritten == str.Length);
999TryFormatu(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out charsWritten);
1000Debug.Assert(charsWritten == str.Length);
1410Debug.Assert(dayAbbrev.Length == 3);
1413Debug.Assert(monthAbbrev.Length == 3);
1617Debug.Assert(dayAbbrev.Length == 3);
1620Debug.Assert(monthAbbrev.Length == 3);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (18)
102return new ReadOnlySpan<char>(ref text.GetRawStringData(), text.Length);
123if ((uint)start > (uint)text.Length)
126return new ReadOnlySpan<char>(ref Unsafe.Add(ref text.GetRawStringData(), (nint)(uint)start /* force zero-extension */), text.Length - start);
146int actualIndex = startIndex.GetOffset(text.Length);
147if ((uint)actualIndex > (uint)text.Length)
152return new ReadOnlySpan<char>(ref Unsafe.Add(ref text.GetRawStringData(), (nint)(uint)actualIndex /* force zero-extension */), text.Length - actualIndex);
177(int start, int length) = range.GetOffsetAndLength(text.Length);
203if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)text.Length)
221return new ReadOnlyMemory<char>(text, 0, text.Length);
240if ((uint)start > (uint)text.Length)
243return new ReadOnlyMemory<char>(text, start, text.Length - start);
259int actualIndex = startIndex.GetOffset(text.Length);
260if ((uint)actualIndex > (uint)text.Length)
263return new ReadOnlyMemory<char>(text, actualIndex, text.Length - actualIndex);
285if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)text.Length)
311(int start, int length) = range.GetOffsetAndLength(text.Length);
6119_pos += value.Length;
6367_pos += value.Length;
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (67)
28Debug.Assert(strA.Length == strB.Length);
33((uint)strA.Length) * sizeof(char));
43Debug.Assert(indexA + countA <= strA.Length && indexB + countB <= strB.Length);
52Debug.Assert(strA.Length == strB.Length);
54return Ordinal.EqualsIgnoreCase(ref strA.GetRawStringData(), ref strB.GetRawStringData(), strB.Length);
79if (Math.Min(strA.Length, strB.Length) <= 2) goto NotLongerThan2;
87ref Unsafe.Add(ref strA._firstChar, 2), strA.Length - 2,
88ref Unsafe.Add(ref strB._firstChar, 2), strB.Length - 2);
93return strA.Length - strB.Length;
158return Ordinal.CompareStringIgnoreCase(ref strA.GetRawStringData(), strA.Length, ref strB.GetRawStringData(), strB.Length);
223lengthA = Math.Min(lengthA, strA.Length - indexA);
228lengthB = Math.Min(lengthB, strB.Length - indexB);
258lengthA = Math.Min(lengthA, strA.Length - indexA);
263lengthB = Math.Min(lengthB, strB.Length - indexB);
292if (strA.Length - indexA < 0 || strB.Length - indexB < 0)
294string paramName = strA.Length - indexA < 0 ? nameof(indexA) : nameof(indexB);
303int lengthA = Math.Min(length, strA.Length - indexA);
304int lengthB = Math.Min(length, strB.Length - indexB);
377int lengthA = Math.Min(length, strA.Length - indexA);
378int lengthB = Math.Min(length, strB.Length - indexB);
441if (value.Length == 0)
458int offset = this.Length - value.Length;
459return (uint)offset <= (uint)this.Length && this.AsSpan(offset).SequenceEqual(value);
462return Length >= value.Length &&
463Ordinal.EqualsIgnoreCase(ref Unsafe.Add(ref GetRawStringData(), Length - value.Length),
465value.Length);
497nuint localLength = (uint)Length;
501int lastPos = Length - 1;
502return ((uint)lastPos < (uint)Length) && this[lastPos] == value;
552if (this.Length != str.Length)
572if (this.Length != value.Length)
604if (this.Length != value.Length)
609if (this.Length != value.Length)
628if (a is null || b is null || a.Length != b.Length)
662if (a.Length != b.Length)
667if (a.Length != b.Length)
765Debug.Assert(src[Length] == '\0', "src[Length] == '\\0'");
772int length = Length;
859int length = Length;
862Debug.Assert(src[Length] == '\0', "src[this.Length] == '\\0'");
897return GetNonRandomizedHashCodeOrdinalIgnoreCaseSlow(hash1, hash2, this.AsSpan(Length - length));
1048if (value.Length == 0)
1065if (this.Length < value.Length || _firstChar != value._firstChar)
1069return (value.Length == 1) ?
1074((nuint)value.Length) * 2);
1077if (this.Length < value.Length)
1081return Ordinal.EqualsIgnoreCase(ref this.GetRawStringData(), ref value.GetRawStringData(), value.Length);
1113return Length != 0 && _firstChar == value;
src\libraries\System.Private.CoreLib\src\System\String.cs (20)
84elementCount: (uint)result.Length, // derefing Length now allows JIT to prove 'result' not null below
110elementCount: (uint)result.Length, // derefing Length now allows JIT to prove 'result' not null below
136elementCount: (uint)result.Length, // derefing Length now allows JIT to prove 'result' not null below
170elementCount: (uint)result.Length, // derefing Length now allows JIT to prove 'result' not null below
366value != null ? new ReadOnlySpan<char>(ref value.GetRawStringData(), value.Length) : default;
373if ((ulong)(uint)startIndex + (ulong)(uint)count > (ulong)(uint)Length)
401string result = FastAllocateString(str.Length);
404elementCount: (uint)result.Length, // derefing Length now allows JIT to prove 'result' not null below
422ArgumentOutOfRangeException.ThrowIfGreaterThan(count, Length - sourceIndex, nameof(sourceIndex));
438if ((uint)Length <= (uint)destination.Length)
440Buffer.Memmove(ref destination._reference, ref _firstChar, (uint)Length);
455if ((uint)Length <= (uint)destination.Length)
457Buffer.Memmove(ref destination._reference, ref _firstChar, (uint)Length);
466if (Length == 0)
469char[] chars = new char[Length];
474elementCount: (uint)Length);
484ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)startIndex, (uint)Length, nameof(startIndex));
485ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, Length - length);
505return value == null || value.Length == 0;
512for (int i = 0; i < value.Length; i++)
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (94)
60Debug.Assert(src.Length <= dest.Length - destPos);
65elementCount: (uint)src.Length);
117totalLength += toString.Length;
139Debug.Assert(position <= totalLength - s.Length, "We didn't allocate enough space for the result string!");
142position += s.Length;
197int str0Length = str0.Length;
199int totalLength = str0Length + str1.Length;
233long totalLength = (long)str0.Length + (long)str1.Length + (long)str2.Length;
242CopyStringContent(result, str0.Length, str1);
243CopyStringContent(result, str0.Length + str1.Length, str2);
271long totalLength = (long)str0.Length + (long)str1.Length + (long)str2.Length + (long)str3.Length;
280CopyStringContent(result, str0.Length, str1);
281CopyStringContent(result, str0.Length + str1.Length, str2);
282CopyStringContent(result, str0.Length + str1.Length + str2.Length, str3);
296Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length);
313Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length);
335Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length);
360Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length);
413totalLengthLong += value.Length;
436int valueLen = value.Length;
538sb.EnsureCapacity(format.Length + args.Length * 8);
694ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)startIndex, (uint)Length, nameof(startIndex));
696int oldLength = Length;
697int insertLength = value.Length;
1052totalLength += value.Length;
1079int valueLen = value.Length;
1126int oldLength = Length;
1144int oldLength = Length;
1161int oldLength = this.Length;
1181if ((uint)startIndex > Length)
1277nuint remainingLength = (uint)(Length - firstIndex);
1278string result = FastAllocateString(Length);
1295nuint length = (uint)Length;
1333if (oldValue.Length == 1)
1339if (newValue.Length == 1)
1353int pos = PackedSpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
1366int pos = SpanHelpers.NonPackedIndexOfChar(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
1382int pos = SpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), Length - i, ref oldValue._firstChar, oldValue.Length);
1388i += pos + oldValue.Length;
1400string dst = ReplaceHelper(oldValue.Length, newValue, replacementIndices.AsSpan());
1411long dstLength = this.Length + ((long)(newValue.Length - oldValueLength)) * indices.Length;
1416Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length);
1436dstIdx += newValue.Length;
1440Debug.Assert(this.Length - thisIdx == dstSpan.Length - dstIdx);
1457if (Length == 0)
1612else if (replacementText.Length != 1 || replacementText[0] != text[idx])
1627if ((uint)idxOfFirstNewlineChar >= (uint)Length)
1633(uint)(idxOfFirstNewlineChar + 1) < (uint)Length &&
1697return (count <= 1 || Length == 0) ? CreateSplitArrayOfThisAsSoleValue(options, count) : Split(separatorSpan, count, options);
1757if (count <= 1 || Length == 0)
1764if (separators.IsEmpty && count > Length)
1827if (count <= 1 || Length == 0)
1836if (separator!.Length == 0)
1883if ((options & StringSplitOptions.RemoveEmptyEntries) == 0 || candidate.Length != 0)
1931for (int i = 0; i < numActualReplaces && currIndex < Length; i++)
1938if (currIndex < Length && numActualReplaces >= 0)
2246int currentSepLength = separator.Length;
2281int length = Length - startIndex;
2287if ((uint)startIndex > (uint)Length)
2299if ((ulong)(uint)startIndex + (ulong)(uint)length > (ulong)(uint)Length)
2312if (length == Length)
2326if (startIndex > Length)
2338Debug.Assert(startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!");
2339Debug.Assert(length >= 0 && startIndex <= this.Length - length, "length is out of range!");
2387if (Length == 0 || (!char.IsWhiteSpace(_firstChar) && !char.IsWhiteSpace(this[^1])))
2397if (Length == 0 || (_firstChar != trimChar && this[^1] != trimChar))
2414if (Length == 0)
2424while (index < Length && this.AsSpan(index).StartsWith(trimChars))
2429if (index >= Length)
2435int endIndex = Length - 1;
2500if (Length == 0)
2510while (index < Length && this.AsSpan(index).StartsWith(trimChars))
2515if (index >= Length)
2574if (Length == 0)
2583int endIndex = Length - 1;
2636int end = Length - 1;
2642for (start = 0; start < Length; start++)
2653for (end = Length - 1; end >= start; end--)
2672int end = Length - 1;
2678for (start = 0; start < Length; start++)
2699for (end = Length - 1; end >= start; end--)
2725len == Length ? this :
src\libraries\System.Private.CoreLib\src\System\String.Searching.cs (35)
18if (RuntimeHelpers.IsKnownConstant(value) && value.Length == 1)
26Length,
28value.Length) >= 0;
39=> SpanHelpers.ContainsValueType(ref Unsafe.As<char, short>(ref _firstChar), (short)value, Length);
71public int IndexOf(char value) => SpanHelpers.IndexOfChar(ref _firstChar, value, Length);
75return IndexOf(value, startIndex, Length - startIndex);
97return IndexOf(value, startIndex, Length - startIndex, comparisonType);
128ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, Length);
130ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex + count, Length);
161if ((uint)startIndex > (uint)Length)
166if ((uint)count > (uint)(Length - startIndex))
186return new ReadOnlySpan<char>(ref _firstChar, Length).IndexOfAny(anyOf);
191return IndexOfAny(anyOf, startIndex, Length - startIndex);
201if ((uint)startIndex > (uint)Length)
206if ((uint)count > (uint)(Length - startIndex))
318return IndexOf(value, 0, Length, comparisonType);
323return IndexOf(value, startIndex, Length - startIndex, comparisonType);
412return IndexOf(value, startIndex, Length - startIndex, comparisonType);
432ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex + count, Length);
446=> SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref _firstChar), (short)value, Length);
455if (Length == 0)
460if ((uint)startIndex >= (uint)Length)
488return LastIndexOf(value, Length - 1, comparisonType);
523if (Length == 0)
543ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(startIndex, Length);
589return new ReadOnlySpan<char>(ref _firstChar, Length).LastIndexOfAny(anyOf);
604if (Length == 0)
609if ((uint)startIndex >= (uint)Length)
632return LastIndexOf(value, Length - 1, Length, StringComparison.CurrentCulture);
647return LastIndexOf(value, Length - 1, Length, comparisonType);
724return LastIndexOf(value, Length - 1, comparisonType);
759if (Length == 0)
767ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(startIndex, Length);
src\libraries\System.Private.CoreLib\src\System\StringComparer.cs (10)
341return Globalization.Ordinal.CompareStringIgnoreCase(ref x.GetRawStringData(), x.Length, ref y.GetRawStringData(), y.Length);
356if (x.Length != y.Length)
360return Globalization.Ordinal.EqualsIgnoreCase(ref x.GetRawStringData(), ref y.GetRawStringData(), x.Length);
504return Globalization.Ordinal.CompareStringIgnoreCase(ref x.GetRawStringData(), x.Length, ref y.GetRawStringData(), y.Length);
519if (x.Length != y.Length)
524return Globalization.Ordinal.EqualsIgnoreCase(ref x.GetRawStringData(), ref y.GetRawStringData(), x.Length);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (23)
108: this(value, 0, value?.Length ?? 0, capacity)
127if (startIndex > value.Length - length)
201if (persistedMaxCapacity < 1 || persistedString.Length > persistedMaxCapacity)
209persistedCapacity = Math.Min(Math.Max(DefaultCapacity, persistedString.Length), persistedMaxCapacity);
212if (persistedCapacity < 0 || persistedCapacity < persistedString.Length || persistedCapacity > persistedMaxCapacity)
220persistedString.CopyTo(0, m_ChunkChars, 0, persistedString.Length);
221m_ChunkLength = persistedString.Length;
336if ((uint)(chunkLength + chunkOffset) > (uint)result.Length || (uint)chunkLength > (uint)sourceArray.Length)
374CopyTo(startIndex, new Span<char>(ref result.GetRawStringData(), result.Length), result.Length);
764Append(ref value.GetRawStringData(), value.Length);
792if (startIndex > value.Length - count)
1158return AppendJoinCore(ref separator.GetRawStringData(), separator.Length, values);
1171return AppendJoinCore(ref separator.GetRawStringData(), separator.Length, values);
1182return AppendJoinCore(ref separator.GetRawStringData(), separator.Length, values);
1193return AppendJoinCore(ref separator.GetRawStringData(), separator.Length, values);
1206return AppendJoinCore(ref separator.GetRawStringData(), separator.Length, values);
1325Insert(index, ref value.GetRawStringData(), value.Length);
1576if ((uint)pos >= (uint)format.Length)
1796if (width <= s.Length)
1803Append(' ', width - s.Length);
1807Append(' ', width - s.Length);
1818if ((uint)pos >= (uint)format.Length)
System.Private.DataContractSerialization (147)
System.Private.Uri (107)
System\Uri.cs (72)
177Debug.Assert(offset.End >= offset.Fragment && offset.End <= _string.Length);
511if (uriString!.Length != 0)
648if ((uint)i < (uint)relativeStr.Length && relativeStr[i] == ':' && i > 1)
658if (i + 1 < relativeStr.Length)
677if (relativeStr.Length == 0)
927if (path.Length == 0)
936while (current < path.Length)
941next = path.Length - 1;
1218string.Concat(host.AsSpan(1, host.Length - 2), scopeId) :
1219host.Substring(1, host.Length - 2);
1297if (IPv6AddressHelper.IsValid(name, out end) && end == name.Length)
1303if (IPv4AddressHelper.IsValid(name.AsSpan(), out end, false, false, false) && end == name.Length)
1308if (DomainNameHelper.IsValid(name, iri: false, notImplicitFile: false, out end) && end == name.Length)
1313if (DomainNameHelper.IsValid(name, iri: true, notImplicitFile: false, out end) && end == name.Length)
1320if (IPv6AddressHelper.IsValid($"[{name}]", out end) && end - 2 == name.Length)
1431ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, pattern.Length);
1434&& (pattern.Length - index >= 3))
1471(pattern.Length - index) >= 3 &&
1904return (uint)index < (uint)uriString.Length && uriString[index] == ':';
1919int length = uriString.Length;
2214info.Offset.End = str.Length;
2250idx += _syntax.SchemeName.Length + 1;
2310Debug.Assert((uint)idx <= (uint)OriginalString.Length);
2322(uint)idx < (uint)str.Length && str[idx] == ':')
2334if ((uint)idx < (uint)str.Length)
2345for (idx++; (uint)idx < (uint)str.Length; idx++)
2419if (host.Length != 0)
2466for (int i = 0; i < host.Length; ++i)
2522if (host.Length == 0)
2562if (CheckAuthorityHelper(host, 0, out ParsingError err, ref flags, _syntax.Flags, ref newHost) != host.Length ||
2570host = CreateHostStringHelper(host, 0, host.Length, ref flags, _info);
2572for (int i = 0; i < host.Length; ++i)
2597for (int idx = 0; idx < portStr.Length; ++idx)
2706var dest = str.Length <= StackallocThreshold
2708: new ValueStringBuilder(str.Length);
2723var dest = str.Length <= StackallocThreshold
2725: new ValueStringBuilder(str.Length);
2809if (host.Length != 0)
2988if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3001if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3012if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3097if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3156int length = inputStr.Length;
3158while ((uint)(length - 1) < (uint)inputStr.Length && UriHelper.IsLWS(inputStr[length - 1]))
3172Debug.Assert(str[_syntax.SchemeName.Length] == ':');
3174int schemeLength = _syntax.SchemeName.Length;
3234queryStart = inputStr.Length;
3241queryStart = inputStr.Length;
3246_info.Offset.Fragment = inputStr.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode
3247_info.Offset.End = inputStr.Length;
3355if ((uint)idx < (uint)inputStr.Length && inputStr[idx] == '?')
3382if ((uint)idx < (uint)inputStr.Length && inputStr[idx] == '#')
3515while ((uint)i < (uint)uriString.Length && UriHelper.IsLWS(uriString[i]))
3523(uint)i < (uint)uriString.Length && uriString[i] == '/' &&
3524((uint)(i + 1) >= (uint)uriString.Length || uriString[i + 1] is not ('/' or '\\')))
3536if ((uint)(i + 2) >= (uint)uriString.Length || colonOffset == 0)
3573while ((uint)i < (uint)uriString.Length && uriString[i] is '/' or '\\')
4422(relativePart.Length == 1 || (relativePart[1] != '/' && relativePart[1] != '\\')))
4441if (relativePart.Length >= 2 && (relativePart[1] == '\\' || relativePart[1] == '/'))
4482if (relativePart.Length >= 2 && relativePart[1] == '/')
4509int length = left.Length;
4510char[] path = new char[length + relativePart.Length];
4526relativePart.CopyTo(0, path, length, relativePart.Length);
4540for (; i < relativePart.Length; ++i)
4551else if (i < relativePart.Length)
4559length += relativePart.Length;
4632for (i = 0; (i < path1.Length) && (i < path2.Length); ++i)
4651if ((i == path1.Length) && (i == path2.Length))
4658for (; i < path1.Length; ++i)
4666if (relPath.Length == 0 && path2.Length - 1 == si)
System.Private.Windows.Core (14)
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (7)
328sizeInBytes += (uint)(file.Length + 1) * sizeof(char);
358fileBuffer[file.Length] = '\0';
359fileBuffer = fileBuffer[(file.Length + 1)..];
369int byteCount = PInvokeCore.WideCharToMultiByte(PInvokeCore.CP_ACP, 0, value, value.Length, null, 0, null, null);
377PInvokeCore.WideCharToMultiByte(PInvokeCore.CP_ACP, 0, value, value.Length, (PSTR)buffer.Pointer, byteCount, null, null);
387uint byteCount = (uint)value.Length * sizeof(char) + sizeof(char);
399span[value.Length] = '\0';
System.Private.Xml (1049)
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (27)
135Debug.Assert(name != null && name.Length > 0);
177Debug.Assert(localName != null && localName.Length > 0);
205Debug.Assert(localName != null && localName.Length > 0);
240Debug.Assert(localName != null && localName.Length > 0);
262Debug.Assert(localName != null && localName.Length > 0);
272if (prefix != null && prefix.Length > 0)
326if (prefix.Length == 0)
420Debug.Assert(name != null && name.Length > 0);
429if (text.Length > 0)
443Debug.Assert(name != null && name.Length > 0);
893int leftCount = text.Length;
1112int leftCount = text.Length;
1248int writeLen = RawTextNoFlush(text, 0, text.Length);
1250_RawTextAsync(text, writeLen, text.Length - writeLen) :
1263writeLen = RawTextNoFlush(text1, 0, text1.Length);
1268return _RawTextAsync(text1, writeLen, text1.Length - writeLen, text2, text3, text4);
1274writeLen = RawTextNoFlush(text2, 0, text2.Length);
1279return _RawTextAsync(text2, writeLen, text2.Length - writeLen, text3, text4);
1287writeLen = RawTextNoFlush(text3, 0, text3.Length);
1292return _RawTextAsync(text3, writeLen, text3.Length - writeLen, text4);
1299writeLen = RawTextNoFlush(text4, 0, text4.Length);
1302return _RawTextAsync(text4, writeLen, text4.Length - writeLen);
1510int leftCount = text.Length;
1686if (text.Length == 0)
1697int leftCount = text.Length;
1870if (text.Length == 0)
1881int leftCount = text.Length;
System\Xml\Core\XmlUtf8RawTextWriterAsync.cs (27)
113Debug.Assert(name != null && name.Length > 0);
153Debug.Assert(localName != null && localName.Length > 0);
179Debug.Assert(localName != null && localName.Length > 0);
212Debug.Assert(localName != null && localName.Length > 0);
232Debug.Assert(localName != null && localName.Length > 0);
240if (prefix != null && prefix.Length > 0)
290if (prefix.Length == 0)
376Debug.Assert(name != null && name.Length > 0);
383if (text.Length > 0)
397Debug.Assert(name != null && name.Length > 0);
766int leftCount = text.Length;
984int leftCount = text.Length;
1119int writeLen = RawTextNoFlush(text, 0, text.Length);
1121_RawTextAsync(text, writeLen, text.Length - writeLen) :
1134writeLen = RawTextNoFlush(text1, 0, text1.Length);
1139return _RawTextAsync(text1, writeLen, text1.Length - writeLen, text2, text3, text4);
1145writeLen = RawTextNoFlush(text2, 0, text2.Length);
1150return _RawTextAsync(text2, writeLen, text2.Length - writeLen, text3, text4);
1158writeLen = RawTextNoFlush(text3, 0, text3.Length);
1163return _RawTextAsync(text3, writeLen, text3.Length - writeLen, text4);
1170writeLen = RawTextNoFlush(text4, 0, text4.Length);
1173return _RawTextAsync(text4, writeLen, text4.Length - writeLen);
1380int leftCount = text.Length;
1555if (text.Length == 0)
1566int leftCount = text.Length;
1738if (text.Length == 0)
1749int leftCount = text.Length;
System\Xml\Schema\DtdParser.cs (22)
289if (systemId != null && systemId.Length > 0)
299if (publicId != null && publicId.Length > 0)
309if (internalSubset != null && internalSubset.Length > 0)
469if (_systemId != null && _systemId.Length > 0)
484if (_systemId != null && _systemId.Length > 0)
682if (attrDef != null && attrDef.Prefix.Length > 0 && attrDef.Prefix.Equals("xml") && attrDef.Name.Name == "space")
706if (attrDef.Prefix.Length > 0 && attrDef.Prefix.Equals("xml"))
944SendValidationEvent(_curPos - name.Name.Length, XmlSeverityType.Error, SR.Sch_DupElementDecl, GetNameString());
1228entity.DeclaredURI = (_externalDtdBaseUri.Length == 0) ? _documentBaseUri : _externalDtdBaseUri;
1323SendValidationEvent(_curPos - notationName.Name.Length, XmlSeverityType.Error, SR.Sch_DupNotation, notationName.Name);
1353UndeclaredNotation un = new UndeclaredNotation(notationName, LineNo, LinePos - notationName.Length);
1483Throw(_curPos - systemId.Length - 1, SR.Xml_FragmentId, new string[] { systemId.Substring(systemId.IndexOf('#')), systemId });
1501ThrowInvalidChar(_curPos - 1 - publicId.Length + i, publicId, i);
3257Throw(_curPos - entityName.Name.Length - 1, SR.Xml_InvalidParEntityRef);
3267Throw(_curPos - entityName.Name.Length - 1, paramEntity ? SR.Xml_RecursiveParEntity : SR.Xml_RecursiveGenEntity, entityName.Name);
3281if (entity.Text!.Length == 0)
3360SendValidationEvent(_curPos - entityName.Name.Length - 1, XmlSeverityType.Error, SR.Xml_UndeclaredParEntity, entityName.Name);
3369SendValidationEvent(_curPos - entityName.Name.Length - 1, XmlSeverityType.Error, SR.Xml_UndeclaredEntity, entityName.Name);
3374Throw(_curPos - entityName.Name.Length - 1, SR.Xml_UndeclaredEntity, entityName.Name);
3382Throw(_curPos - entityName.Name.Length - 1, SR.Xml_UnparsedEntityRef, entityName.Name);
3387Throw(_curPos - entityName.Name.Length - 1, SR.Xml_ExternalEntityInAttValue, entityName.Name);
3539int len = value.Length;
System\Xml\Schema\DtdParserAsync.cs (12)
113if (_systemId != null && _systemId.Length > 0)
128if (_systemId != null && _systemId.Length > 0)
326if (attrDef != null && attrDef.Prefix.Length > 0 && attrDef.Prefix.Equals("xml") && attrDef.Name.Name == "space")
350if (attrDef.Prefix.Length > 0 && attrDef.Prefix.Equals("xml"))
588SendValidationEvent(_curPos - name.Name.Length, XmlSeverityType.Error, SR.Sch_DupElementDecl, GetNameString());
859entity.DeclaredURI = (_externalDtdBaseUri.Length == 0) ? _documentBaseUri : _externalDtdBaseUri;
957SendValidationEvent(_curPos - notationName.Name.Length, XmlSeverityType.Error, SR.Sch_DupNotation, notationName.Name);
1108Throw(_curPos - systemId.Length - 1, SR.Xml_FragmentId, new string[] { systemId.Substring(systemId.IndexOf('#')), systemId });
1126ThrowInvalidChar(_curPos - 1 - publicId.Length + i, publicId, i);
2587Throw(_curPos - entityName.Name.Length - 1, SR.Xml_InvalidParEntityRef);
2597Throw(_curPos - entityName.Name.Length - 1, paramEntity ? SR.Xml_RecursiveParEntity : SR.Xml_RecursiveGenEntity, entityName.Name);
2614if (entity.Text!.Length == 0)
System\Xml\Schema\Inference\Infer.cs (62)
247if (ns.Length != 0)
324if (childURI.Length == 0)
340if (childURI.Length != 0)
344if (prefix.Length != 0 && !string.Equals(prefix, "xml", StringComparison.OrdinalIgnoreCase))
356if (childURI!.Length != 0) //BUGBUG It need not be an attribute reference if there is a namespace, it can be attribute with attributeFormDefault = qualified
468if (childURI.Length != 0)
483Debug.Assert(targetNS == null || targetNS.Length > 0, "targetns for schema is empty");
539if (prefix.Length != 0)
1041if (childURI.Length == 0)
1423if (attr.RefName.Name.Length == 0)
1751if (s.Length == 0) return TF_string;
1778if (i == s.Length)
1797i++; if (i == s.Length) return TF_decimal | TF_float | TF_double | TF_string; //"9999.9" was matched
1810i++; if (i == s.Length) return TF_string;
1823i++; if (i == s.Length) return TF_string; //".9999e+" was matched
1829i++; if (i == s.Length) return TF_float | TF_double | TF_string; //".9999e+99" was matched
1836i++; if (i == s.Length) return TF_string;
1852i++; if (i == s.Length) return TF_string;
1866i++; if (i == s.Length) return TF_string;
1877i++; if (i == s.Length) return TF_string; //"P999" was matched
1894if (i == s.Length)
1910i++; if (i == s.Length) return TF_string; //"P999Y9" was matched
1925if (i == s.Length)
1941i++; if (i == s.Length) return TF_string; //"P999Y999M9" was matched
1954if (i == s.Length)
1967i++; if (i == s.Length) return TF_string; //"P999Y999M9999DT" was matched
1973i++; if (i == s.Length) return TF_string; //"___T9" was matched
1992if (i == s.Length)
2002i++; if (i == s.Length) return TF_string; //"___T999H9" was matched
2019if (i == s.Length)
2029i++; if (i == s.Length) return TF_string; //"___T999H999M9" was matched
2044if (i == s.Length)
2054i++; if (i == s.Length) return TF_string; //"___T999H999M999.9" was matched
2067if (i == s.Length)
2085if (i == s.Length)
2116if (i == s.Length)
2145if (i == s.Length)
2170if (i == s.Length)
2198i++; if (i == s.Length) return TF_string; //"9999-"
2201i++; if (i == s.Length) return TF_string; //"9999-9"
2205if (i == s.Length)
2225i++; if (i == s.Length) return TF_string; //"9999-99-"
2228i++; if (i == s.Length) return TF_string; //"9999-99-9"
2231i++; if (i == s.Length) return DateTime(s, bDate, bTime); //"9999-99-99"
2251if (i == s.Length)
2266i++; if (i == s.Length) return TF_string;
2269i++; if (i == s.Length) return TF_string;
2272i++; if (i == s.Length) return TF_string;
2276i++; if (i == s.Length) return TF_string;
2279i++; if (i == s.Length) return TF_string;
2283if (i == s.Length)
2297i++; if (i == s.Length) return TF_string;
2300i++; if (i == s.Length) return TF_string;
2303i++; if (i == s.Length) return TF_string;
2307i++; if (i == s.Length) return TF_string;
2310i++; if (i == s.Length) return TF_string;
2313i++; if (i == s.Length) return TF_string;
2316i++; if (i == s.Length) return TF_string;
2319i++; if (i == s.Length) return TF_string;
2322i++; if (i == s.Length) return DateTime(s, bDate, bTime);
2337i++; if (i == s.Length) return TF_string;
2341i++; if (i == s.Length) return DateTime(s, bDate, bTime);
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (16)
222if (prefix.Length == 5 && prefix == "xmlns")
236if (ns.Length != 0 && _depth != 0)
541Debug.Assert(prefix.Length == 0 || ns.Length != 0);
553if (ns.Length == 0 && prefix.Length == 0)
725throw new XslTransformException(SR.XmlIl_NmspConflict, new string[] { prefix.Length == 0 ? "" : ":", prefix, ns, nsExisting });
1221if (navigator.NamespaceURI.Length == 0)
1223Debug.Assert(navigator.LocalName.Length != 0, "xmlns:foo='' isn't allowed");
1350Debug.Assert(prefix.Length != 0 && ns.Length != 0);
1413if (isElemPrefix || genPrefix.Length != 0)
1422if (isElemPrefix || genPrefix.Length != 0)
1504Debug.Assert(ValidateNames.ParseNCName(name.Name, 0) == name.Name.Length);
1507prefix = (name.Namespace.Length != 0) ? RemapPrefix(string.Empty, name.Namespace, nodeType == XPathNodeType.Element) : string.Empty;
1526prefix = (ns.Length != 0) ? RemapPrefix(string.Empty, ns, nodeType == XPathNodeType.Element) : string.Empty;
System\Xml\Xsl\XsltOld\RecordBuilder.cs (9)
622for (; index < comment.Length; index++)
631newComment = new StringBuilder(comment, begin, index, 2 * comment.Length);
651if (begin < comment.Length)
652newComment.Append(comment, begin, comment.Length - begin);
675for (; index < pi.Length; index++)
687newPI = new StringBuilder(pi, begin, index, 2 * pi.Length);
706if (begin < pi.Length)
708newPI.Append(pi, begin, pi.Length - begin);
781Debug.Assert(prefix != null && prefix.Length > 0);
System.Private.Xml.Linq (54)
System\Xml\Linq\XLinq.cs (13)
39if (_text.Length > 0)
61else if (_text.Length > 0)
130if (_text.Length > 0)
298if (namespaceName.Length == 0) return string.Empty;
320_resolver.AddFirst(a.Name.NamespaceName.Length == 0 ? string.Empty : a.Name.LocalName, XNamespace.Get(a.Value));
338_resolver.Add(a.Name.NamespaceName.Length == 0 ? string.Empty : a.Name.LocalName, XNamespace.Get(a.Value));
384_writer.WriteAttributeString(GetPrefixOfNamespace(ns, false), localName, namespaceName.Length == 0 && localName == "xmlns" ? XNamespace.xmlnsPrefixNamespace : namespaceName, a.Value);
404await _writer.WriteAttributeStringAsync(GetPrefixOfNamespace(ns, false), localName, namespaceName.Length == 0 && localName == "xmlns" ? XNamespace.xmlnsPrefixNamespace : namespaceName, a.Value).ConfigureAwait(false);
493if (_rover != null && _rover.ns == ns && (allowDefaultNamespace || _rover.prefix.Length > 0)) return _rover.prefix;
514else if (d.prefix.Length > 0)
553_writer.WriteAttributeString(GetPrefixOfNamespace(ns, false), localName, namespaceName.Length == 0 && localName == "xmlns" ? XNamespace.xmlnsPrefixNamespace : namespaceName, a.Value);
563if (namespaceName.Length == 0) return string.Empty;
578_resolver.Add(a.Name.NamespaceName.Length == 0 ? string.Empty : a.Name.LocalName, XNamespace.Get(a.Value));
System.Reflection.Context (2)
System.Reflection.Emit (2)
System.Reflection.Metadata (59)
System.Reflection.MetadataLoadContext (9)
System.Resources.Extensions (8)
System.Resources.Writer (1)
System.Runtime.Caching (4)
System.Runtime.Numerics (3)
System.Runtime.Serialization.Formatters (2)
System.Runtime.Serialization.Schema (13)
System.Security.Cryptography (33)
System.Security.Cryptography.Pkcs (5)
System.Security.Cryptography.Xml (26)
System.Security.Permissions (2)
System.ServiceModel.Federation (1)
System.ServiceModel.Http (1)
System.ServiceModel.NetFramingBase (1)
System.ServiceModel.NetNamedPipe (5)
System.ServiceModel.NetNamedPipe.Tests (2)
System.ServiceModel.Primitives (158)
Internals\System\Xml\XmlMtomReader.cs (25)
120if (contentType != null && contentType.Length == 0)
231|| charset == null || charset.Length == 0)
285|| rootType == null || rootType.Length == 0)
405if (uri == null || uri.Length == 0)
410contentID = string.Format(CultureInfo.InvariantCulture, "<{0}>", Uri.UnescapeDataString(uri.Substring(MimeGlobals.ContentIDScheme.Length)));
1376count = Math.Min(_stringValue.Length - _stringOffset, count);
1449if (val.Length > stringContentQuota)
1451stringContentQuota -= val.Length;
2303remaining += value.Length * sizeof(char);
2306remaining += name.Length * sizeof(char);
2325remaining += header.Value.Length * sizeof(char);
2419if (offset >= Value.Length || Value[offset++] != '/')
2425if (offset >= Value.Length || Value[offset++] != ';')
2432if (paramAttribute == null || offset >= Value.Length || Value[offset++] != '=')
2462if (paramAttribute == null || startInfoOffset >= startInfo.Length || startInfo[startInfoOffset++] != '=')
2531contentTransferEncodingValue = (Value.Length == 0) ? Value : ((Value[0] == '"') ? MailBnfHelper.ReadQuotedString(Value, ref offset, null) : MailBnfHelper.ReadToken(Value, ref offset, null));
2597if ((!MailBnfHelper.SkipCFWS(Value, ref offset) || offset >= Value.Length || Value[offset++] != '.') || !MailBnfHelper.SkipCFWS(Value, ref offset))
2815XmlMtomReader.DecrementBufferQuota(maxBuffer, ref remaining, value.Length * sizeof(char));
2824XmlMtomReader.DecrementBufferQuota(maxBuffer, ref remaining, value.Length * sizeof(char));
3089for (; offset < data.Length; offset++)
3110for (; offset < data.Length; offset++)
3145if (offset < data.Length && data[offset] == '"')
3154for (; offset < data.Length; offset++)
3172for (; offset < data.Length && data[offset] < s_digits.Length && s_digits[data[offset]]; offset++)
3180int length = (data == null) ? 0 : data.Length;
Internals\System\Xml\XmlMtomWriter.cs (7)
172if (startUri != null && startUri.Length > 0)
175if (startInfo != null && startInfo.Length > 0)
1176size += XmlMtomWriter.ValidateSizeOfMessage(maxSizeInBytes, size, name.Length);
1177size += XmlMtomWriter.ValidateSizeOfMessage(maxSizeInBytes, size, value.Length);
1183byte[] boundaryBytes = new byte[boundary.Length + MimeGlobals.BoundaryPrefix.Length];
1186Encoding.ASCII.GetBytes(boundary, 0, boundary.Length, boundaryBytes, MimeGlobals.BoundaryPrefix.Length);
1456Write(value, 0, value.Length);
System.ServiceModel.Syndication (3)
System.Text.Encoding.CodePages (6)
System.Text.Encodings.Web (11)
System.Text.Json (13)
System.Text.Json.SourceGeneration (4)
System.Text.RegularExpressions (176)
System\Text\RegularExpressions\Regex.Match.cs (7)
80return RunSingleMatch(RegexRunnerMode.ExistenceRequired, -1, input, 0, input.Length, RightToLeft ? input.Length : 0) is null;
94return RunSingleMatch(RegexRunnerMode.ExistenceRequired, -1, input, 0, input.Length, startat) is null;
145return RunSingleMatch(RegexRunnerMode.FullMatchRequired, -1, input, 0, input.Length, RightToLeft ? input.Length : 0)!;
159return RunSingleMatch(RegexRunnerMode.FullMatchRequired, -1, input, 0, input.Length, startat)!;
200return new MatchCollection(this, input, RightToLeft ? input.Length : 0);
System\Text\RegularExpressions\Regex.Replace.cs (7)
45return Replace(input, replacement, -1, RightToLeft ? input.Length : 0);
60return Replace(input, replacement, count, RightToLeft ? input.Length : 0);
114return Replace(evaluator, this, input, -1, RightToLeft ? input.Length : 0);
128return Replace(evaluator, this, input, count, RightToLeft ? input.Length : 0);
165if ((uint)startat > (uint)input.Length)
192state.segments.Add(input.AsMemory(state.prevat, input.Length - state.prevat));
196state.prevat = input.Length;
System.Text.RegularExpressions.Generator (147)
System.Transactions.Local (2)
System.Web.HttpUtility (11)
System.Windows.Controls.Ribbon (17)
System.Windows.Forms (243)
System.Windows.Forms.Analyzers.CSharp (5)
System.Windows.Forms.Analyzers.CSharp.Tests (7)
System.Windows.Forms.Design (64)
System.Windows.Forms.Design.Tests (2)
System.Windows.Forms.Primitives (11)
System.Windows.Forms.Primitives.Tests (20)
System.Windows.Forms.Primitives.TestUtilities.Tests (2)
System.Windows.Forms.Tests (71)
System.Windows.Forms.UI.IntegrationTests (13)
System.Windows.Input.Manipulations (1)
System.Xaml (61)
SystemdTestApp (1)
Templates.Blazor.Tests (11)
Templates.Blazor.WebAssembly.Auth.Tests (12)
Templates.Blazor.WebAssembly.Tests (12)
Templates.Mvc.Tests (12)
Templates.Tests (13)
Test.Utilities (189)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
TestTasks (1)
Text.Analyzers (200)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
145for (var i = 0; i < text.Length; i++)
611var tokenPosition = lastText.ConvertTabToSpace(Options.TabSize, initialColumn, lastText.Length);
741for (var i = this.OriginalString.Length - 1; i >= 0; i--)
889spaces: text.ConvertTabToSpace(Options.TabSize, lineColumn.With(whitespaceBetween).Column, text.Length),
925spaces: lineText.GetColumnFromLineOffset(lineText.Length, Options.TabSize),
931spaces: text.ConvertTabToSpace(Options.TabSize, initialColumn, text.Length),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
391if (name.Length > 0)
TlsFeaturesObserve (1)
UIAutomationClient (6)
UIAutomationClientSideProviders (27)
UIAutomationTypes (1)
vbc (3)
VBCSCompiler (4)
VBCSCompiler.UnitTests (2)
VersioningWebSite (1)
Wasm.Performance.ConsoleHost (7)
Wasm.Performance.TestApp (1)
WinFormsControlsTest (4)
XmlFileLogger (7)
xunit.assert (22)
Sdk\Exceptions\EquivalentException.cs (4)
161 Assert.GuardArgumentNotNull(nameof(memberName), memberName).Length == 0 ? string.Empty : string.Format(CultureInfo.CurrentCulture, ": Mismatched value on member '{0}'", memberName),
191 Assert.GuardArgumentNotNull(nameof(memberName), memberName).Length == 0 ? string.Empty : string.Format(CultureInfo.CurrentCulture, " in member '{0}'", memberName),
226 Assert.GuardArgumentNotNull(nameof(memberName), memberName).Length == 0 ? string.Empty : string.Format(CultureInfo.CurrentCulture, " in member '{0}'", memberName),
254 Assert.GuardArgumentNotNull(nameof(memberName), memberName).Length == 0 ? string.Empty : string.Format(CultureInfo.CurrentCulture, " in member '{0}'", memberName),
xunit.console (5)