15939 references to Length
AnalyzerRunner (5)
aspire (1)
Aspire.Azure.Messaging.ServiceBus (3)
Aspire.Azure.Npgsql (1)
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL (1)
Aspire.Dashboard (274)
Aspire.Dashboard.Components.Tests (3)
Aspire.Dashboard.Tests (3)
Aspire.EndToEnd.Tests (1)
Aspire.Hosting (179)
Aspire.Hosting.Analyzers (4)
Aspire.Hosting.Analyzers.Tests (1)
Aspire.Hosting.Azure (8)
Aspire.Hosting.Azure.Functions (7)
Aspire.Hosting.Azure.KeyVault (1)
Aspire.Hosting.Kubernetes (1)
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 (16)
Dashboard\DashboardServiceTests.cs (7)
66l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length),
67l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length));
71l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length),
119l => Assert.Equal(DashboardServiceImpl.LogMaxBatchCharacters, l.Text.Length));
123l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length),
124l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length));
128l => Assert.Equal(LongLineCharacters, l.Text.Split(' ')[1].Length));
Aspire.Microsoft.Data.SqlClient (2)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (2)
Aspire.Playground.Tests (4)
Aspire.Templates.Tests (1)
BasicWebSite (1)
BasketService (24)
BoundTreeGenerator (1)
BuildActionTelemetryTable (4)
BuildBoss (3)
BuildValidator (2)
ClientSample (7)
CodeGenerator (35)
ConfigurationSchemaGenerator (6)
Crossgen2Tasks (3)
csc (3)
CSharpSyntaxGenerator (2)
CustomPolicyProvider (2)
DemoConsole (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 (1371)
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)
GenerateAnalyzerNuspec (12)
GenerateDocumentationAndConfigFiles (202)
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)
366if (name.Length > 0)
GenerateRulesMissingDocumentation (1)
GenericHostWebSite (1)
GetDocument.Insider (7)
http2cat (14)
HttpStress (7)
IdeBenchmarks (2)
IdeCoreBenchmarks (4)
Identity.DefaultUI.WebSite (1)
Identity.ExternalClaims (2)
IdentitySample.PasskeyConformance (1)
IIS.Common.TestLib (1)
IIS.FunctionalTests (28)
IIS.LongTests (14)
IIS.NewHandler.FunctionalTests (14)
IIS.NewShim.FunctionalTests (14)
IIS.ShadowCopy.Tests (3)
IISExpress.FunctionalTests (26)
illink (33)
ILLink.RoslynAnalyzer (10)
ILLink.Tasks (4)
InMemory.FunctionalTests (48)
InProcessWebSite (3)
installer.tasks (2)
IntegrationTestsWebsite (16)
InteractiveHost.UnitTests (3)
Interop.FunctionalTests (7)
InteropClient (14)
InteropWebsite (12)
IOperationGenerator (4)
Kestrel.SampleApp (1)
Metrics (197)
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 (197)
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 (3)
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 (44)
Microsoft.AspNetCore.Components.Endpoints (11)
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(expectedString1.Length, browserFile2.Size);
Microsoft.AspNetCore.Components.QuickGrid (3)
Microsoft.AspNetCore.Components.Server (3)
Microsoft.AspNetCore.Components.Server.Tests (1)
Microsoft.AspNetCore.Components.Web (2)
Microsoft.AspNetCore.Components.WebAssembly (5)
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 (5)
Microsoft.AspNetCore.DataProtection.Tests (2)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (2)
Microsoft.AspNetCore.Diagnostics (4)
Microsoft.AspNetCore.Grpc.JsonTranscoding (23)
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 (5)
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 (4)
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.OutputCaching (5)
Microsoft.AspNetCore.OutputCaching.Tests (2)
Microsoft.AspNetCore.Razor.Test (1)
Microsoft.AspNetCore.ResponseCaching (5)
Microsoft.AspNetCore.Rewrite (7)
Microsoft.AspNetCore.Routing (55)
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 (87)
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 (69)
Microsoft.AspNetCore.SignalR.Client (1)
Microsoft.AspNetCore.SignalR.Client.Core (1)
Microsoft.AspNetCore.SignalR.Client.Tests (1)
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Microsoft.AspNetCore.StaticAssets.Tests (3)
Microsoft.AspNetCore.WebSockets (5)
Microsoft.AspNetCore.WebUtilities (23)
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (2)
Microsoft.AspNetCore.WebUtilities.Tests (2)
Microsoft.Build.Framework (15)
Microsoft.Build.Tasks.CodeAnalysis (17)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (17)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
Microsoft.Cci.Extensions (8)
Microsoft.CodeAnalysis (275)
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 (221)
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)
366if (name.Length > 0)
Microsoft.CodeAnalysis.Analyzers.UnitTests (7)
Microsoft.CodeAnalysis.AnalyzerUtilities (199)
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 (207)
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)
366if (name.Length > 0)
Microsoft.CodeAnalysis.CodeStyle (210)
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)
366if (name.Length > 0)
Microsoft.CodeAnalysis.Collections.Package (2)
Microsoft.CodeAnalysis.CSharp (101)
Microsoft.CodeAnalysis.CSharp.CodeStyle (22)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (12)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (11)
CommandLineTests.cs (11)
1882Assert.True(Array.IndexOf(acceptableSurroundingChar, actual[foundIndex + version.Length]) >= 0);
2414Assert.True(embed_cs.Length >= EmbeddedText.CompressionThreshold);
2415Assert.True(embed2_cs.Length < EmbeddedText.CompressionThreshold);
2892if (currentUICultureName.Length == 0 || currentUICultureName.StartsWith("en", StringComparison.OrdinalIgnoreCase))
5902var modfile = source1.Substring(0, source1.Length - 2) + "netmodule";
5914modfile = source2.Substring(0, source2.Length - 2) + "netmodule";
5939var modfile = source1.Substring(0, source1.Length - 2) + "netmodule";
5959var modfile = source1.Substring(0, source1.Length - 2) + "netmodule";
9410Assert.Equal(stringStart, text.Substring(0, stringStart.Length));
9655Assert.Equal('(', text[expectedPath.Length]);
10535index = source.IndexOf(word, index + word.Length, StringComparison.Ordinal);
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)
14016Diagnostic(ErrorCode.ERR_CopyConstructorWrongAccessibility, "A").WithArguments("A.A(A)").WithLocation(4, 6 + accessibility.Length)
14103Diagnostic(ErrorCode.WRN_ProtectedInSealed, "A").WithArguments("A.A(A)").WithLocation(4, 6 + accessibility.Length)
15606Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Deconstruct").WithArguments("A.Deconstruct(out int)").WithLocation(4, 11 + accessibility.Length)
18499Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 19 + accessibility.Length),
18502Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 19 + accessibility.Length)
18525Diagnostic(ErrorCode.ERR_VirtualPrivate, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 19 + accessibility.Length),
18528Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 19 + accessibility.Length),
18531Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 19 + accessibility.Length)
19058Diagnostic(ErrorCode.ERR_NonProtectedAPIInRecord, "EqualityContract").WithArguments("A.EqualityContract").WithLocation(4, 26 + accessibility.Length)
19081Diagnostic(ErrorCode.ERR_VirtualPrivate, "EqualityContract").WithArguments("A.EqualityContract").WithLocation(4, 26 + accessibility.Length),
19084Diagnostic(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 (74)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (5)
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)
4384Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnMalformed, "{1}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted(object)").WithLocation(4, 15 + expression.Length)
4490Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnInconsistent, "{1}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted(object)", "bool").WithLocation(4, 15 + expression1.Length),
4493Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnInconsistent, "Text").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendLiteral(string)", "void").WithLocation(5, 14 + expression2.Length)
4528Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnInconsistent, "{1}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted(object)", "void").WithLocation(4, 15 + expression1.Length),
4531Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnInconsistent, "Text").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendLiteral(string)", "bool").WithLocation(5, 14 + expression2.Length)
7717Diagnostic(ErrorCode.ERR_InterpolatedStringHandlerArgumentLocatedAfterInterpolatedString, "1").WithArguments("i", "c").WithLocation(1, 7 + expression.Length),
17364Diagnostic(ErrorCode.ERR_NotInstanceInvalidInterpolatedStringHandlerArgumentName, @"InterpolatedStringHandlerArgument("""")").WithArguments("M(CustomHandler)").WithLocation(6, 10 + mod.Length)
17425Diagnostic(ErrorCode.WRN_InterpolatedStringHandlerArgumentAttributeIgnoredOnLambdaParameters, @"InterpolatedStringHandlerArgument("""")").WithLocation(4, 12 + mod.Length),
17428Diagnostic(ErrorCode.ERR_NotInstanceInvalidInterpolatedStringHandlerArgumentName, @"InterpolatedStringHandlerArgument("""")").WithArguments("lambda expression").WithLocation(4, 12 + mod.Length)
17455Diagnostic(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)
4319Diagnostic(ErrorCode.ERR_ProtectedInStruct, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length),
4322Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length),
4325Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 11 + accessibility.Length)
4349Diagnostic(ErrorCode.ERR_NonPublicAPIInRecord, "Equals").WithArguments("A.Equals(A)").WithLocation(4, 11 + accessibility.Length),
4352Diagnostic(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, "Equals").WithArguments("A").WithLocation(4, 11 + accessibility.Length)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (321)
Symbols\DefaultInterfaceImplementationTests.cs (135)
6347Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "E1").WithArguments("I1.E1").WithLocation(4, 25 + declModifiers.Length)
6663Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "E1").WithArguments("I1.E1").WithLocation(4, 25 + declModifiers.Length)
6695Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "E1").WithArguments("I1.E1").WithLocation(4, 25 + declModifiers.Length)
6727Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "E1").WithArguments("I1.E1").WithLocation(4, 25 + declModifiers.Length)
6950Diagnostic(ErrorCode.WRN_UnreferencedEvent, "E7").WithArguments("Base.E7").WithLocation(10, 25 + implModifiers.Length)
7053Diagnostic(ErrorCode.WRN_UnreferencedEvent, "E7").WithArguments("Base.E7").WithLocation(10, 25 + implModifiers.Length)
7144Diagnostic(ErrorCode.WRN_UnreferencedEvent, "E7").WithArguments("Base.E7").WithLocation(10, 25 + implModifiers.Length)
7251Diagnostic(ErrorCode.WRN_UnreferencedEvent, "E7").WithArguments("Base.E7").WithLocation(10, 29 + implModifiers.Length)
33440Diagnostic(ErrorCode.ERR_ConcreteMissingBody, "M1").WithArguments("I1.I4.M1()").WithLocation(15, 13 + implModifiers.Length),
33443Diagnostic(ErrorCode.ERR_ConcreteMissingBody, "M1").WithArguments("I1.I2.M1()").WithLocation(14, 13 + implModifiers.Length)
33488Diagnostic(ErrorCode.ERR_ClassDoesntImplementInterface, "I4").WithArguments("I1.I4.M1()", "I4").WithLocation(18, 10 + implModifiers.Length),
33491Diagnostic(ErrorCode.ERR_ClassDoesntImplementInterface, "I2").WithArguments("I1.I2.M1()", "I2").WithLocation(14, 10 + implModifiers.Length)
33657Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("sealed").WithLocation(14, 28 + implModifiers.Length),
33660Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private").WithLocation(14, 28 + implModifiers.Length),
33663Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected").WithLocation(18, 32 + implModifiers.Length),
33666Diagnostic(ErrorCode.ERR_AbstractHasBody, "M1").WithArguments("I1.I4.M1()").WithLocation(18, 32 + implModifiers.Length),
33721Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private protected").WithLocation(14, 31 + implModifiers.Length),
33724Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected internal").WithLocation(18, 41 + implModifiers.Length),
33727Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("override").WithLocation(18, 41 + implModifiers.Length)
33767Diagnostic(ErrorCode.WRN_ExternMethodNoImplementation, "M1").WithArguments("I1.I2.M1()").WithLocation(9, 20 + implModifiers.Length)
33891Diagnostic(ErrorCode.ERR_ExternHasBody, "M1").WithArguments("I1.I2.M1()").WithLocation(9, 20 + implModifiers.Length)
34204Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I4.M1()").WithLocation(8, 13 + implModifiers.Length),
34207Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1()").WithLocation(4, 13 + implModifiers.Length)
34219Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I4.M1()").WithLocation(8, 13 + implModifiers.Length),
34222Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1()").WithLocation(4, 13 + implModifiers.Length)
35905Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "I1<string?>").WithLocation(11, 10 + implModifiers.Length)
36108Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "I1<string>").WithLocation(11, 10 + implModifiers.Length)
36815Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1()").WithLocation(4, 13 + implModifiers.Length),
36818Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I4.M1()").WithLocation(8, 13 + implModifiers.Length)
36865Diagnostic(ErrorCode.WRN_NewRequired, "M1").WithArguments("I2.M1()", "I1.M1()").WithLocation(10, 25 + implModifiers.Length),
37596Diagnostic(ErrorCode.ERR_ClassDoesntImplementInterface, "I2").WithArguments("I1.I2.M1", "I2").WithLocation(14, 9 + implModifiers.Length),
37599Diagnostic(ErrorCode.ERR_ClassDoesntImplementInterface, "I4").WithArguments("I1.I4.M1", "I4").WithLocation(15, 9 + implModifiers.Length)
37788Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("sealed").WithLocation(14, 27 + implModifiers.Length),
37791Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private").WithLocation(14, 27 + implModifiers.Length),
37797Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected").WithLocation(19, 31 + implModifiers.Length),
37857Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private protected").WithLocation(14, 30 + implModifiers.Length),
37863Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected internal").WithLocation(19, 40 + implModifiers.Length),
37866Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("override").WithLocation(19, 40 + implModifiers.Length),
38362Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1").WithLocation(4, 12 + implModifiers.Length),
38365Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I4.M1.set").WithLocation(11, 12 + implModifiers.Length)
39341Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected").WithLocation(19, 22 + implModifiers.Length)
39392Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected internal").WithLocation(19, 31 + implModifiers.Length)
39443Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private protected").WithLocation(19, 30 + implModifiers.Length)
39507Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "M1").WithArguments("I3", "I1<System.String>.M1").WithLocation(21, 21 + implModifiers.Length)
39919Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1").WithLocation(4, 12 + implModifiers.Length),
39922Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I4.M1.set").WithLocation(11, 12 + implModifiers.Length)
40622Diagnostic(ErrorCode.ERR_ClassDoesntImplementInterface, "I2").WithArguments("I1.I2.M1", "I2").WithLocation(9, 25 + implModifiers.Length)
40794Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("sealed").WithLocation(14, 43 + implModifiers.Length),
40797Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private").WithLocation(14, 43 + implModifiers.Length),
40800Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected").WithLocation(19, 47 + implModifiers.Length),
40860Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("private protected").WithLocation(14, 53 + implModifiers.Length),
40863Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("extern").WithLocation(14, 53 + implModifiers.Length),
40866Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("protected internal").WithLocation(19, 56 + implModifiers.Length),
40869Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("override").WithLocation(19, 56 + implModifiers.Length)
40934Diagnostic(ErrorCode.ERR_ExplicitEventFieldImpl, "M1").WithLocation(30, 28 + implModifiers.Length),
40937Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "M1").WithArguments("I2.I1.M1").WithLocation(10, 28 + implModifiers.Length),
40940Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "M2").WithArguments("I2.I1.M2").WithLocation(14, 28 + implModifiers.Length),
40952Diagnostic(ErrorCode.ERR_ExplicitEventFieldImpl, ".").WithLocation(38, 27 + implModifiers.Length),
41138Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1").WithLocation(4, 28 + implModifiers.Length)
41150Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1").WithLocation(4, 28 + implModifiers.Length)
42484Diagnostic(ErrorCode.ERR_BadAccess, "M1").WithArguments("I2.M1").WithLocation(4, 28 + implModifiers.Length)
51973Diagnostic(ErrorCode.ERR_AbstractHasBody, "M1").WithArguments("I2.I1.M1()").WithLocation(9, 22 + implModifiers.Length),
52028Diagnostic(ErrorCode.ERR_AbstractAndExtern, "M1").WithArguments("I2.I1.M1()").WithLocation(9, 29 + implModifiers.Length),
52093Diagnostic(ErrorCode.ERR_PartialMemberNotExplicit, "M1").WithLocation(9, 30 + implModifiers.Length),
52096Diagnostic(ErrorCode.ERR_PartialMemberCannotBeAbstract, "M1").WithLocation(9, 30 + implModifiers.Length),
52151Diagnostic(ErrorCode.ERR_BadAsyncLacksBody, "M1").WithLocation(9, 28 + implModifiers.Length),
52216Diagnostic(ErrorCode.ERR_BadMemberFlag, "M1").WithArguments("public").WithLocation(9, 29 + implModifiers.Length),
52338Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "M1").WithArguments("I2.M1()").WithLocation(8, 22 + implModifiers.Length)
52387Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "I1").WithArguments("I1").WithLocation(4, 19 + implModifiers.Length),
52390Diagnostic(ErrorCode.ERR_ExplicitInterfaceImplementationNotInterface, "I1").WithArguments("I1").WithLocation(4, 19 + implModifiers.Length)
53717Diagnostic(ErrorCode.ERR_AbstractAndExtern, "P1").WithArguments("I2.I1.P1").WithLocation(9, 28 + implModifiers.Length),
53842Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("public").WithLocation(9, 28 + implModifiers.Length),
53871Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length)
53955Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length)
53985Diagnostic(ErrorCode.ERR_ExplicitPropertyMissingAccessor, "P1").WithArguments("I2.I1.P1", "I1.P1.set").WithLocation(9, 21 + implModifiers.Length),
54018Diagnostic(ErrorCode.ERR_ExplicitPropertyMissingAccessor, "P1").WithArguments("I2.I1.P1", "I1.P1.get").WithLocation(9, 21 + implModifiers.Length),
54051Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "set").WithArguments("I2.I1.P1.set", "I1.P1").WithLocation(9, 31 + implModifiers.Length),
54084Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "get").WithArguments("I2.I1.P1.get", "I1.P1").WithLocation(9, 26 + implModifiers.Length),
54117Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "set").WithArguments("I2.I1.P1.set", "I1.P1").WithLocation(9, 31 + implModifiers.Length),
54150Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "get").WithArguments("I2.I1.P1.get", "I1.P1").WithLocation(9, 26 + implModifiers.Length),
54185Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1").WithLocation(4, 21 + implModifiers.Length),
54279Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1.get").WithLocation(4, 21 + implModifiers.Length),
54314Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1.set").WithLocation(4, 21 + implModifiers.Length),
55726Diagnostic(ErrorCode.ERR_AbstractHasBody, "throw null").WithArguments("I2.I1.P1.get").WithLocation(9, 27 + implModifiers.Length),
55759Diagnostic(ErrorCode.ERR_AbstractAndExtern, "P1").WithArguments("I2.I1.P1").WithLocation(9, 28 + implModifiers.Length),
55792Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("public").WithLocation(9, 28 + implModifiers.Length),
55821Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length)
55847Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length)
55877Diagnostic(ErrorCode.ERR_ExplicitPropertyMissingAccessor, "P1").WithArguments("I2.I1.P1", "I1.P1.set").WithLocation(9, 21 + implModifiers.Length),
55880Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "get").WithArguments("I2.I1.P1.get", "I1.P1").WithLocation(9, 26 + implModifiers.Length),
55915Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1").WithLocation(4, 21 + implModifiers.Length),
56657Diagnostic(ErrorCode.ERR_AbstractAndExtern, "P1").WithArguments("I2.I1.P1").WithLocation(9, 28 + implModifiers.Length),
56690Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("public").WithLocation(9, 28 + implModifiers.Length),
56719Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length),
56722Diagnostic(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, "set").WithLocation(9, 26 + implModifiers.Length)
56748Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 21 + implModifiers.Length),
56751Diagnostic(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, "set").WithLocation(9, 26 + implModifiers.Length)
56781Diagnostic(ErrorCode.ERR_ExplicitPropertyMissingAccessor, "P1").WithArguments("I2.I1.P1", "I1.P1.get").WithLocation(9, 21 + implModifiers.Length),
56784Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "set").WithArguments("I2.I1.P1.set", "I1.P1").WithLocation(9, 26 + implModifiers.Length),
56819Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1").WithLocation(4, 21 + implModifiers.Length),
57024Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "P1").WithArguments("I2.P1").WithLocation(8, 21 + implModifiers.Length)
57086Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length),
57089Diagnostic(ErrorCode.ERR_ExplicitInterfaceImplementationNotInterface, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length)
57117Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "P1").WithArguments("I2.P1").WithLocation(8, 21 + implModifiers.Length)
57144Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length),
57147Diagnostic(ErrorCode.ERR_ExplicitInterfaceImplementationNotInterface, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length)
57175Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "P1").WithArguments("I2.P1").WithLocation(8, 21 + implModifiers.Length)
57202Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length),
57205Diagnostic(ErrorCode.ERR_ExplicitInterfaceImplementationNotInterface, "I1").WithArguments("I1").WithLocation(4, 18 + implModifiers.Length)
58602Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("extern").WithLocation(9, 44 + implModifiers.Length),
58635Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("public").WithLocation(9, 44 + implModifiers.Length),
58670Diagnostic(ErrorCode.ERR_ExplicitEventFieldImpl, "P1").WithLocation(9, 37 + implModifiers.Length),
58673Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 37 + implModifiers.Length)
58756Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 37 + implModifiers.Length)
58788Diagnostic(ErrorCode.ERR_ExplicitEventFieldImpl, "P1").WithLocation(9, 37 + implModifiers.Length),
58791Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 37 + implModifiers.Length)
58821Diagnostic(ErrorCode.ERR_BadMemberFlag, "P1").WithArguments("abstract").WithLocation(9, 37 + implModifiers.Length)
58851Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
58884Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
58917Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
58950Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
58983Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
59016Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
59049Diagnostic(ErrorCode.ERR_AbstractEventHasAccessors, "{").WithArguments("I2.I1.P1").WithLocation(9, 40 + implModifiers.Length),
59082Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "P1").WithArguments("I1.P1").WithLocation(4, 25 + modifiers.Length),
59085Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "P1").WithArguments("I2.I1.P1.remove", "I1.P1").WithLocation(9, 37 + implModifiers.Length),
59122Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "P1").WithArguments("I1.P1").WithLocation(4, 25 + modifiers.Length),
59161Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "P1").WithArguments("I1.P1").WithLocation(4, 25 + modifiers.Length),
59164Diagnostic(ErrorCode.ERR_ExplicitPropertyAddingAccessor, "P1").WithArguments("I2.I1.P1.add", "I1.P1").WithLocation(9, 37 + implModifiers.Length),
59201Diagnostic(ErrorCode.ERR_EventNeedsBothAccessors, "P1").WithArguments("I1.P1").WithLocation(4, 25 + modifiers.Length),
59242Diagnostic(ErrorCode.ERR_BadAccess, "P1").WithArguments("I1.P1").WithLocation(4, 37 + implModifiers.Length),
59313Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "P1").WithArguments("I2.P1").WithLocation(8, 37 + implModifiers.Length)
59363Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "I1").WithArguments("I1").WithLocation(4, 34 + implModifiers.Length),
59366Diagnostic(ErrorCode.ERR_ExplicitInterfaceImplementationNotInterface, "I1").WithArguments("I1").WithLocation(4, 34 + implModifiers.Length)
59396Diagnostic(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)
12185Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(12, 33 + checkedKeyword.Length)
12335Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(12, 32 + checkedKeyword.Length)
17601Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17607Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
17613Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17616Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17625Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6)").WithLocation(38, 32 + checkedKeyword.Length),
17643Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10)").WithLocation(67, 33 + checkedKeyword.Length)
17744Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17750Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
17756Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17759Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17768Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6)").WithLocation(38, 32 + checkedKeyword.Length),
17786Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10)").WithLocation(67, 33 + checkedKeyword.Length)
17881Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17884Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
17887Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17890Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
17893Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6)").WithLocation(38, 32 + checkedKeyword.Length),
17899Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10)").WithLocation(67, 33 + checkedKeyword.Length)
17994Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17997Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
18000Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
18003Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4)").WithLocation(26, 24 + checkedKeyword.Length),
18006Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6)").WithLocation(38, 32 + checkedKeyword.Length),
18012Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10)").WithLocation(67, 33 + checkedKeyword.Length)
18136Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2, int)").WithLocation(14, 24 + checkedKeyword.Length),
18142Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3, int)").WithLocation(20, 24 + checkedKeyword.Length),
18148Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4, int)").WithLocation(26, 24 + checkedKeyword.Length),
18151Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4, int)").WithLocation(26, 24 + checkedKeyword.Length),
18160Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6, int)").WithLocation(38, 32 + checkedKeyword.Length),
18178Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10, int)").WithLocation(67, 33 + checkedKeyword.Length)
18273Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2, int)").WithLocation(14, 24 + checkedKeyword.Length),
18276Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3, int)").WithLocation(20, 24 + checkedKeyword.Length),
18279Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4, int)").WithLocation(26, 24 + checkedKeyword.Length),
18282Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C4.operator " + checkedKeyword + op + "(C4, int)").WithLocation(26, 24 + checkedKeyword.Length),
18285Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C6.operator " + checkedKeyword + op + "(C6, int)").WithLocation(38, 32 + checkedKeyword.Length),
18291Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("C10.operator " + checkedKeyword + op + "(C10, int)").WithLocation(67, 33 + checkedKeyword.Length)
18379ErrorCode badSignatureError = op.Length != 2 ? ErrorCode.ERR_BadUnaryOperatorSignature : ErrorCode.ERR_BadIncDecSignature;
18380ErrorCode badAbstractSignatureError = op.Length != 2 ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadAbstractIncDecSignature;
18385Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18388Diagnostic(badSignatureError, op).WithLocation(12, 17 + checkedKeyword.Length),
18391Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
18394Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18397Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18400Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
18403Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18406Diagnostic(badSignatureError, op).WithLocation(42, 16 + checkedKeyword.Length),
18409Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length)
18526ErrorCode badSignatureError = op.Length != 2 ? ErrorCode.ERR_BadUnaryOperatorSignature : ErrorCode.ERR_BadIncDecSignature;
18527ErrorCode badAbstractSignatureError = op.Length != 2 ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadAbstractIncDecSignature;
18532Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18535Diagnostic(ErrorCode.ERR_BadIncDecSignature, op).WithLocation(12, 17 + checkedKeyword.Length),
18538Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
18541Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18544Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18547Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
18550Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18553Diagnostic(ErrorCode.ERR_BadIncDecSignature, op).WithLocation(42, 16 + checkedKeyword.Length),
18556Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length)
18673ErrorCode badSignatureError = op.Length != 2 ? ErrorCode.ERR_BadUnaryOperatorSignature : ErrorCode.ERR_BadIncDecSignature;
18674ErrorCode badAbstractSignatureError = op.Length != 2 ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadAbstractIncDecSignature;
18679Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18682Diagnostic(badSignatureError, op).WithLocation(12, 17 + checkedKeyword.Length),
18685Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
18688Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18691Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18694Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
18697Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18700Diagnostic(badSignatureError, op).WithLocation(42, 16 + checkedKeyword.Length),
18703Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length),
18706Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(62, 39 + checkedKeyword.Length),
18709Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(67, 36 + checkedKeyword.Length)
18826ErrorCode badSignatureError = op.Length != 2 ? ErrorCode.ERR_BadUnaryOperatorSignature : ErrorCode.ERR_BadIncDecSignature;
18827ErrorCode badAbstractSignatureError = op.Length != 2 ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadAbstractIncDecSignature;
18832Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18835Diagnostic(ErrorCode.ERR_BadIncDecSignature, op).WithLocation(12, 17 + checkedKeyword.Length),
18838Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
18841Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18844Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1)").WithLocation(22, 20 + checkedKeyword.Length),
18847Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
18850Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18853Diagnostic(ErrorCode.ERR_BadIncDecSignature, op).WithLocation(42, 16 + checkedKeyword.Length),
18856Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length),
18859Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(62, 39 + checkedKeyword.Length),
18862Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(67, 36 + checkedKeyword.Length)
18986Diagnostic(badSignatureError, op).WithLocation(12, 17 + checkedKeyword.Length),
18989Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
18992Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1, int)").WithLocation(22, 20 + checkedKeyword.Length),
18995Diagnostic(badSignatureError, op).WithLocation(42, 16 + checkedKeyword.Length),
18998Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length)
19010Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(12, 17 + checkedKeyword.Length),
19013Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(17, 24 + checkedKeyword.Length),
19022Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(42, 16 + checkedKeyword.Length),
19025Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(47, 23 + checkedKeyword.Length)
19035Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1, int)").WithLocation(12, 17 + checkedKeyword.Length),
19038Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1, int)").WithLocation(22, 20 + checkedKeyword.Length),
19041Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
19044Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T, int)").WithLocation(42, 16 + checkedKeyword.Length)
19172Diagnostic(badSignatureError, op).WithLocation(12, 17 + checkedKeyword.Length),
19175Diagnostic(badSignatureError, op).WithLocation(17, 24 + checkedKeyword.Length),
19178Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1, int)").WithLocation(22, 20 + checkedKeyword.Length),
19181Diagnostic(badSignatureError, op).WithLocation(42, 16 + checkedKeyword.Length),
19184Diagnostic(badSignatureError, op).WithLocation(47, 23 + checkedKeyword.Length),
19187Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(62, 39 + checkedKeyword.Length),
19190Diagnostic(ErrorCode.ERR_BadMemberFlag, op).WithArguments("virtual").WithLocation(67, 36 + checkedKeyword.Length)
19202Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(12, 17 + checkedKeyword.Length),
19205Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(17, 24 + checkedKeyword.Length),
19214Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(42, 16 + checkedKeyword.Length),
19217Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, op).WithLocation(47, 23 + checkedKeyword.Length)
19227Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1, int)").WithLocation(12, 17 + checkedKeyword.Length),
19230Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, op).WithArguments("I5.operator " + checkedKeyword + op + "(I1, int)").WithLocation(22, 20 + checkedKeyword.Length),
19233Diagnostic(badAbstractSignatureError, op).WithLocation(32, 33 + checkedKeyword.Length),
19236Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T, int)").WithLocation(42, 16 + checkedKeyword.Length)
19554Diagnostic(ErrorCode.ERR_InvalidModifierForLanguageVersion, op).WithArguments(modifier.Trim(), "10.0", "11.0").WithLocation(14, 33 + checkedKeyword.Length),
19563Diagnostic(ErrorCode.ERR_InvalidModifierForLanguageVersion, op).WithArguments(modifier.Trim(), "10.0", "11.0").WithLocation(19, 32 + checkedKeyword.Length),
19609Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfacesForMember, op).WithArguments("Test1.operator " + checkedKeyword + op + "(Test1)", "I1<Test1>.operator " + checkedKeyword + op + "(Test1)", "Test1").WithLocation(4, 34 + checkedKeyword.Length)
19619Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(9, 32 + checkedKeyword.Length)
19661Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfacesForMember, op).WithArguments("Test1.operator " + checkedKeyword + op + "(Test1, int)", "I1<Test1>.operator " + checkedKeyword + op + "(Test1, int)", "Test1").WithLocation(4, 34 + checkedKeyword.Length)
19671Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(9, 32 + checkedKeyword.Length)
19713Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(4, 27 + checkedKeyword.Length)
19723Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(4, 27 + checkedKeyword.Length),
19726Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(9, 33 + checkedKeyword.Length)
19768Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(4, 27 + checkedKeyword.Length)
19778Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(4, 27 + checkedKeyword.Length),
19781Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, op).WithLocation(9, 33 + checkedKeyword.Length)
22819Diagnostic(ErrorCode.ERR_ValConstraintNotSatisfied, "x").WithArguments("I1<T>", "T", "C2").WithLocation(14, 44 + op.Length - 1)
22864Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "x").WithArguments("I1<T>", "T", "C2").WithLocation(14, 44 + op.Length - 1)
28442Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, "int").WithArguments("C2." + op + " operator " + checkedKeyword + "int(C2)").WithLocation(14, 30 + checkedKeyword.Length),
28448Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, "int").WithArguments("C3." + op + " operator " + checkedKeyword + "int(C3)").WithLocation(20, 30 + checkedKeyword.Length),
28454Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, "int").WithArguments("C4." + op + " operator " + checkedKeyword + "int(C4)").WithLocation(26, 30 + checkedKeyword.Length),
28457Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("C4." + op + " operator " + checkedKeyword + "int(C4)").WithLocation(26, 30 + checkedKeyword.Length),
28466Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "long").WithArguments("C6." + op + " operator " + checkedKeyword + "long(C6)").WithLocation(38, 37 + checkedKeyword.Length),
28484Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("C10." + op + " operator " + checkedKeyword + "int(C10)").WithLocation(67, 38 + checkedKeyword.Length)
28579Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, "int").WithArguments("C2." + op + " operator " + checkedKeyword + "int(C2)").WithLocation(14, 30 + checkedKeyword.Length),
28582Diagnostic(ErrorCode.ERR_OperatorsMustBeStaticAndPublic, "int").WithArguments("C3." + op + " operator " + checkedKeyword + "int(C3)").WithLocation(20, 30 + checkedKeyword.Length),
28585Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, "int").WithArguments("C4." + op + " operator " + checkedKeyword + "int(C4)").WithLocation(26, 30 + checkedKeyword.Length),
28588Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("C4." + op + " operator " + checkedKeyword + "int(C4)").WithLocation(26, 30 + checkedKeyword.Length),
28591Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "long").WithArguments("C6." + op + " operator " + checkedKeyword + "long(C6)").WithLocation(38, 37 + checkedKeyword.Length),
28597Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("C10." + op + " operator " + checkedKeyword + "int(C10)").WithLocation(67, 38 + checkedKeyword.Length)
28688Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(12, 23 + checkedKeyword.Length),
28691Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(12, 23 + checkedKeyword.Length),
28694Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(17, 30 + checkedKeyword.Length),
28697Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(17, 30 + checkedKeyword.Length),
28700Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, "int").WithArguments("I5<T>." + op + " operator " + checkedKeyword + "int(T)").WithLocation(22, 29 + checkedKeyword.Length),
28703Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("I5<T>." + op + " operator " + checkedKeyword + "int(T)").WithLocation(22, 29 + checkedKeyword.Length),
28706Diagnostic(ErrorCode.ERR_AbstractConversionNotInvolvingContainedType, "int").WithLocation(32, 39 + checkedKeyword.Length),
28709Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(42, 23 + checkedKeyword.Length),
28712Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(42, 23 + checkedKeyword.Length),
28715Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(47, 30 + checkedKeyword.Length),
28718Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(47, 30 + checkedKeyword.Length)
28845Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(12, 23 + checkedKeyword.Length),
28848Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(12, 23 + checkedKeyword.Length),
28851Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(17, 30 + checkedKeyword.Length),
28854Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(17, 30 + checkedKeyword.Length),
28857Diagnostic(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, "int").WithArguments("I5<T>." + op + " operator " + checkedKeyword + "int(T)").WithLocation(22, 29 + checkedKeyword.Length),
28860Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "int").WithArguments("I5<T>." + op + " operator " + checkedKeyword + "int(T)").WithLocation(22, 29 + checkedKeyword.Length),
28863Diagnostic(ErrorCode.ERR_AbstractConversionNotInvolvingContainedType, "int").WithLocation(32, 39 + checkedKeyword.Length),
28866Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(42, 23 + checkedKeyword.Length),
28869Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(42, 23 + checkedKeyword.Length),
28872Diagnostic(ErrorCode.ERR_ConversionNotInvolvingContainedType, "int").WithLocation(47, 30 + checkedKeyword.Length),
28875Diagnostic(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, "int").WithLocation(47, 30 + checkedKeyword.Length),
28878Diagnostic(ErrorCode.ERR_BadMemberFlag, "int").WithArguments("virtual").WithLocation(62, 46 + checkedKeyword.Length),
28881Diagnostic(ErrorCode.ERR_BadMemberFlag, "int").WithArguments("virtual").WithLocation(67, 45 + checkedKeyword.Length)
29069Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfacesForMember, "int").WithArguments("Test1." + op + " operator " + checkedKeyword + "int(Test1)", "I1<Test1>." + op + " operator " + checkedKeyword + "int(Test1)", "Test1").WithLocation(4, 37 + checkedKeyword.Length)
29079Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, "int").WithLocation(9, 39 + checkedKeyword.Length)
29121Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, "int").WithLocation(4, 40 + checkedKeyword.Length)
29131Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, "int").WithLocation(4, 40 + checkedKeyword.Length),
29134Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, "int").WithLocation(9, 39 + checkedKeyword.Length)
31076Diagnostic(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, "int").WithLocation(12, 39 + checkedKeyword.Length)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (90)
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 (17)
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);
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)
13392Diagnostic(ErrorCode.ERR_SyntaxError, "=").WithArguments("(").WithLocation(1, 14 + op.Length - 1),
13395Diagnostic(ErrorCode.ERR_IdentifierExpected, "=").WithLocation(1, 14 + op.Length - 1),
13398Diagnostic(ErrorCode.ERR_TupleTooFewElements, ")").WithLocation(1, 19 + op.Length - 1),
13401Diagnostic(ErrorCode.ERR_IdentifierExpected, "=>").WithLocation(1, 21 + op.Length - 1),
13404Diagnostic(ErrorCode.ERR_SyntaxError, "=>").WithArguments(",").WithLocation(1, 21 + op.Length - 1),
13407Diagnostic(ErrorCode.ERR_SyntaxError, "x").WithArguments(",").WithLocation(1, 24 + op.Length - 1),
13410Diagnostic(ErrorCode.ERR_IdentifierExpected, ";").WithLocation(1, 25 + op.Length - 1),
13413Diagnostic(ErrorCode.ERR_CloseParenExpected, ";").WithLocation(1, 25 + op.Length - 1)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (13)
Microsoft.CodeAnalysis.CSharp.Workspaces (26)
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 (78)
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.EditorFeatures2.UnitTests (22)
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 (9)
Microsoft.CodeAnalysis.Extensions.Package (19)
Microsoft.CodeAnalysis.Features (211)
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 (19)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (201)
Microsoft.CodeAnalysis.PublicApiAnalyzers (196)
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 (52)
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)
203using (var writer = new LargeTextWriter(encoding, checksumAlgorithm, source.Length))
266allSourceTexts.Add(LargeText.Decode(new StringReader(randomText), randomText.Length, encoding, algorithm));
356var actualSourceText = SourceText.From(actual, expected.Length);
360Assert.Same(s_utf8, SourceText.From(actual, expected.Length, s_utf8).Encoding);
361Assert.Same(s_unicode, SourceText.From(actual, expected.Length, s_unicode).Encoding);
362Assert.Null(SourceText.From(actual, expected.Length, null).Encoding);
372var actualSourceText = SourceText.From(actual, expected.Length);
379Assert.Same(s_utf8, SourceText.From(actual, expected.Length, s_utf8).Encoding);
380Assert.Same(s_unicode, SourceText.From(actual, expected.Length, s_unicode).Encoding);
381Assert.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.VisualBasic.CodeStyle (6)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (9)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (4)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (10)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (37)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Microsoft.CodeAnalysis.VisualBasic.Features (31)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (10)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (7)
58Replace(s_startTag, New String(" "c, s_startTag.Length)).
59Replace(s_endTag, New String(" "c, s_endTag.Length)).
60Replace(s_startSpanMark, New String(" "c, s_startSpanMark.Length)).
61Replace(s_endSpanMark, New String(" "c, s_startSpanMark.Length)).
74start += s_startTag.Length
86span = TextSpan.FromBounds(source.IndexOf(s_startSpanMark, start, length, StringComparison.Ordinal) + s_startSpanMark.Length,
476Dim oldStatementTextSpan = New TextSpan(oldStatementPosition, oldStatementSource.Length)
Microsoft.CodeAnalysis.VisualBasic.ResultProvider (8)
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (15)
Semantics\NameLengthTests.vb (10)
85Dim _longSquiggle_ As New String("~"c, s_longSymbolName.Length)
231Dim _squiggle2 As New String("~"c, substring2.Length)
286Dim _longSquiggle_ As New String("~"c, s_longSymbolName.Length)
342Dim _longSquiggle_ As New String("~"c, s_longSymbolName.Length)
384Dim _longSquiggle_ As New String("~"c, s_longSymbolName.Length)
419Dim __longSpace___ As New String(" "c, s_longSymbolName.Length)
420Dim _longSquiggle_ As New String("~"c, s_longSymbolName.Length)
449Dim _longSquiggle_ As New String("~"c, s_longLocalName.Length)
472Dim _longSquiggle_ As New String("~"c, s_longLocalName.Length)
509Dim longSquiggle As New String("~"c, longName.Length)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (72)
IncrementalParser\IncrementalParser.vb (52)
107For i As Integer = 0 To _s.Length - 1
168.changeSpan = New TextSpan(code.Length, 0),
190.changeSpan = New TextSpan(code.Length, 0),
213.changeSpan = New TextSpan(code.Length, 0),
229.changeSpan = New TextSpan(code.Length, 0),
248.changeSpan = New TextSpan(code.Length, 0),
263.changeSpan = New TextSpan(code.Length, 0),
673.changeSpan = New TextSpan(code.IndexOf(change, StringComparison.Ordinal), change.Length),
792Dim newText = oldText.WithChanges(New TextChange(New TextSpan(insertionPoint, replace.Length), "{"))
885Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:=str)
987Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) + str.Length
1052Dim position = oldText.ToString().Length
1079Dim newText = oldText.Replace(start:=position + str.Length, length:=0, newText:=vbCrLf)
1105Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:=String.Empty)
1163span = New TextSpan(0, code1.Length)
1266Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="")
1290Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="")
1314Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Async Function ")
1338Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Async Function ")
1361Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="")
1384Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Async Function ")
1404Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="")
1424Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Iterator Function ")
1444Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="")
1464Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Iterator Function ")
1553Dim endOfOld = oldSource.Length - newSource.Length + endOfNew
1583Dim newText = oldText.Replace(start:=position + "&HFFFFFFFFFF:".Length, length:=0, newText:=vbCrLf)
1699Dim newTree1 = oldTree1.WithInsertAt(text.Length, " ")
1715Dim newTree2 = oldTree2.WithInsertAt(text.Length, " ")
1768Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1795Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1824Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1888Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1921Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1955Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1985Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2016Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2048Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2078Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2110Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2212Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2244Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2278Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2304Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2335Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2368Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2405Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2433Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2467Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2487Dim position = source.Length
2546Dim newText = oldText.Replace(start:=position, length:=toReplace.Length, newText:="Property")
IncrementalParser\IPEndBlockStatements.vb (7)
27.changeSpan = New TextSpan(code.Length, 0),
91.changeSpan = New TextSpan(code.IndexOf("End Function", StringComparison.Ordinal), change.Length),
156.changeSpan = New TextSpan(code.Length, 0),
221.changeSpan = New TextSpan(code.IndexOf("End Sub", StringComparison.Ordinal), change.Length),
294.changeSpan = New TextSpan(code.Length, 0),
440.changeSpan = New TextSpan(code.Length, 0),
542.changeSpan = New TextSpan(code.Length, 0),
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (16)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (28)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (4)
Microsoft.CodeAnalysis.Workspaces (268)
PatternMatching\PatternMatcher.cs (12)
115for (var i = 0; i < pattern.Length; i++)
127for (var i = 0; i < pattern.Length; i++)
169var candidateLength = candidate.Length;
177if (patternChunk.Text.Length == candidateLength)
207PatternMatchKind.Prefix, punctuationStripped, isCaseSensitive, matchedSpan: GetMatchedSpan(0, patternChunk.Text.Length));
232matchedSpan: GetMatchedSpan(caseSensitiveIndex, patternChunk.Text.Length));
247matchedSpan: GetMatchedSpan(caseInsensitiveIndex, patternChunk.Text.Length));
262matchedSpan: GetMatchedSpan(hump.Start, patternChunk.Text.Length));
287if (patternIsLowercase && caseInsensitiveIndex > 0 && patternChunk.Text.Length >= 3)
294matchedSpan: GetMatchedSpan(caseSensitiveIndex, patternChunk.Text.Length));
312for (var i = 0; i < text.Length; i++)
451=> 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)
366if (name.Length > 0)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (83)
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 (3)
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 (2)
Microsoft.DotNet.MacOsPkg.Tests (1)
Microsoft.DotNet.NuGetRepack.Tests (1)
Microsoft.DotNet.RemoteExecutor (6)
Microsoft.DotNet.SignTool (8)
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 (2)
Microsoft.Extensions.AI.Abstractions (12)
Microsoft.Extensions.AI.AzureAIInference (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 (3)
Microsoft.Extensions.AI.Ollama (1)
Microsoft.Extensions.AI.Templates.Tests (1)
Microsoft.Extensions.ApiDescription.Client (2)
Microsoft.Extensions.Caching.Hybrid (10)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
Microsoft.Extensions.Caching.SqlServer (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.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.Http.Resilience.Tests (8)
Microsoft.Extensions.Identity.Core (3)
Microsoft.Extensions.Identity.Stores (3)
Microsoft.Extensions.Localization (1)
Microsoft.Extensions.Localization.Tests (1)
Microsoft.Extensions.Logging (2)
Microsoft.Extensions.Logging.Abstractions (8)
Microsoft.Extensions.Logging.AzureAppServices (2)
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 (1)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (5)
Microsoft.Extensions.ServiceDiscovery.Yarp (1)
Microsoft.Extensions.Telemetry (24)
Microsoft.Extensions.Telemetry.Abstractions (2)
Microsoft.Extensions.Telemetry.Tests (2)
Microsoft.Extensions.WebEncoders (3)
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 (117)
Microsoft.ML.Tokenizers.Tests (133)
BpeTests.cs (11)
318char[] destinationBuffer = new char[expectedDecoded.Length];
332Assert.True(charactersWritten < expectedDecoded.Length);
341Assert.Equal(expectedDecoded.Length, charactersWritten);
477Assert.Equal(text.Length, length);
480Assert.Equal(text.Length, length);
835char[] destinationBuffer = new char[beginningOfSentenceToken.Length + text.Length];
842Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan(0, text.Length - 1), considerSpecialTokens: false, out idsConsumed, out charsWritten));
844Assert.True(charsWritten < text.Length);
845Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan(0, text.Length), considerSpecialTokens: true, out idsConsumed, out charsWritten));
847Assert.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 (12)
Microsoft.NET.StringTools.net35 (12)
Microsoft.VisualBasic.Core (154)
Microsoft.VisualBasic.Forms (1)
Microsoft.VisualBasic.Tests (1)
Microsoft.VisualStudio.LanguageServices (42)
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.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.VisualBasic (11)
Microsoft.Web.Xdt.Extensions (1)
Mvc.RoutingWebSite (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);
972if (_that._text.Length == 0)
1017if (_textStorePosition + _currentLine.Length < _that._text.Length)
1097Debug.Assert(_that._text.Length > 0 && textSourcePosition + line.Length <= _that._text.Length + 1);
1102Math.Min(textSourcePosition + line.Length - 1, _that._text.Length - 1)
1549return BuildHighlightGeometry(origin, 0, _text.Length);
1720if (_text.Length == 0)
1826if (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)
ResultsOfTGenerator (1)
Roslyn.Diagnostics.Analyzers (202)
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)
366if (name.Length > 0)
Roslyn.Diagnostics.Analyzers.UnitTests (4)
Roslyn.Diagnostics.CSharp.Analyzers (32)
Roslyn.Diagnostics.VisualBasic.Analyzers (9)
Roslyn.Test.PdbUtilities (5)
Roslyn.Test.Performance.Utilities (1)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Roslyn.VisualStudio.Next.UnitTests (1)
RulesetToEditorconfigConverter (2)
RunTests (3)
Sample (1)
Sandbox (36)
ServerComparison.FunctionalTests (1)
ServerComparison.TestSites (3)
Shared (2)
Shared.Tests (1)
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)
114static (string s, int index, int count) => s.AsSpan(s.Length + index, count));
312public override bool Equals(string? x, string? y) => x.AsSpan(IsLeft ? Index : (x!.Length + Index), Count).SequenceEqual(y.AsSpan(IsLeft ? Index : (y!.Length + Index), Count));
313public override int GetHashCode(string s) => Hashing.GetHashCodeOrdinal(s.AsSpan(IsLeft ? Index : (s.Length + Index), Count));
318public 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);
319public override int GetHashCode(string s) => Hashing.GetHashCodeOrdinalIgnoreCase(s.AsSpan(IsLeft ? Index : (s.Length + Index), Count));
324public 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);
325public 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 (32)
System.Composition.Convention (9)
System.Configuration.ConfigurationManager (69)
System\Configuration\StringUtil.cs (2)
21return 0 == string.Compare(s1, 0, s2, 0, s2.Length, StringComparison.Ordinal);
27return 0 == string.Compare(s1, 0, s2, 0, s2.Length, StringComparison.OrdinalIgnoreCase);
System.Data.Common (190)
System.Data.Odbc (87)
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 (46)
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.TextWriterTraceListener (9)
System.Diagnostics.TraceSource (1)
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 (1)
System.IO.FileSystem.Watcher (20)
System.IO.IsolatedStorage (5)
System.IO.Packaging (52)
System.IO.Ports (9)
System.Linq.Expressions (3)
System.Net.Http.Json (3)
System.Net.HttpListener (53)
System.Net.Mail (72)
System\Net\Mail\MailPriority.cs (12)
281EnvelopeHeaders.InternalSet(xSenderHeader, sender.Encode(xSenderHeader.Length, allowUnicode));
289EnvelopeHeaders.InternalAdd(headerName, address.Encode(headerName.Length, allowUnicode));
293EnvelopeHeaders.InternalAdd(headerName, address.Encode(headerName.Length, allowUnicode));
297EnvelopeHeaders.InternalAdd(headerName, address.Encode(headerName.Length, allowUnicode));
315Headers.InternalAdd(headerName, Sender.Encode(headerName.Length, allowUnicode));
323Headers.InternalAdd(headerName, From!.Encode(headerName.Length, allowUnicode));
328Headers.InternalAdd(headerName, To.Encode(headerName.Length, allowUnicode));
338Headers.InternalAdd(headerName, CC.Encode(headerName.Length, allowUnicode));
348Headers.InternalAdd(headerName, ReplyTo.Encode(headerName.Length, allowUnicode));
352Headers.InternalAdd(headerName, ReplyToList.Encode(headerName.Length, allowUnicode));
396headerName.Length));
442headerName.Length);
System.Net.Ping (1)
System.Net.Security (2)
System.Net.WebClient (6)
System.Net.WebHeaderCollection (5)
System.Net.WebProxy (5)
System.Net.WebSockets.Client (1)
System.Private.CoreLib (959)
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] == '-'));
713sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, null, 0, options);
730if (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\Globalization\IdnMapping.cs (33)
63return GetAscii(unicode, index, unicode.Length - index);
72if (index > unicode.Length)
74if (index > unicode.Length - count)
110return GetUnicode(ascii, index, ascii.Length - index);
119if (index > ascii.Length)
121if (index > ascii.Length - count)
159if (originalString.Length == inputLength &&
188if (index > 0 || count < unicode.Length)
204throw new ArgumentException(SR.Format(SR.Argument_InvalidCharSequence, unicode.Length - 1), nameof(unicode));
221if (unicode.Length == 0)
227for (int i = 0; i < unicode.Length; i++)
267if (iLastDot == -1 && unicode.Length > c_labelLimit)
271if (unicode.Length > c_defaultNameLimit - (IsDot(unicode[^1]) ? 0 : 1))
310if (unicode.Length == 0)
313StringBuilder output = new StringBuilder(unicode.Length);
319while (iNextDot < unicode.Length)
326iNextDot = iNextDot < 0 ? unicode.Length : iNextDot + iAfterLastDot;
332if (iNextDot != unicode.Length)
408output.Remove(iOutputAfterLastDot, c_strAcePrefix.Length);
502if (iNextDot != unicode.Length)
543if (index > 0 || count < ascii.Length)
582if (ascii.Length == 0)
586if (ascii.Length > c_defaultNameLimit - (IsDot(ascii[^1]) ? 0 : 1))
591StringBuilder output = new StringBuilder(ascii.Length);
598while (iNextDot < ascii.Length)
602if (iNextDot < 0 || iNextDot > ascii.Length)
603iNextDot = ascii.Length;
609if (iNextDot != ascii.Length)
621if (ascii.Length < c_strAcePrefix.Length + iAfterLastDot ||
622string.Compare(ascii, iAfterLastDot, c_strAcePrefix, 0, c_strAcePrefix.Length, StringComparison.OrdinalIgnoreCase) != 0)
630iAfterLastDot += c_strAcePrefix.Length;
795if (iNextDot != ascii.Length)
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);
6068_pos += value.Length;
6316_pos += value.Length;
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (67)
27Debug.Assert(strA.Length == strB.Length);
32((uint)strA.Length) * sizeof(char));
42Debug.Assert(indexA + countA <= strA.Length && indexB + countB <= strB.Length);
61if (strA.Length != strB.Length)
71Debug.Assert(strA.Length == strB.Length);
73return Ordinal.EqualsIgnoreCase(ref strA.GetRawStringData(), ref strB.GetRawStringData(), strB.Length);
87int length = Math.Min(strA.Length, strB.Length);
162return strA.Length - strB.Length;
258return Ordinal.CompareStringIgnoreCase(ref strA.GetRawStringData(), strA.Length, ref strB.GetRawStringData(), strB.Length);
323lengthA = Math.Min(lengthA, strA.Length - indexA);
328lengthB = Math.Min(lengthB, strB.Length - indexB);
358lengthA = Math.Min(lengthA, strA.Length - indexA);
363lengthB = Math.Min(lengthB, strB.Length - indexB);
392if (strA.Length - indexA < 0 || strB.Length - indexB < 0)
394string paramName = strA.Length - indexA < 0 ? nameof(indexA) : nameof(indexB);
403int lengthA = Math.Min(length, strA.Length - indexA);
404int lengthB = Math.Min(length, strB.Length - indexB);
484int lengthA = Math.Min(length, strA.Length - indexA);
485int lengthB = Math.Min(length, strB.Length - indexB);
548if (value.Length == 0)
565int offset = this.Length - value.Length;
566return (uint)offset <= (uint)this.Length && this.AsSpan(offset).SequenceEqual(value);
569return Length >= value.Length &&
570Ordinal.EqualsIgnoreCase(ref Unsafe.Add(ref GetRawStringData(), Length - value.Length),
572value.Length);
604nuint localLength = (uint)Length;
608int lastPos = Length - 1;
609return ((uint)lastPos < (uint)Length) && this[lastPos] == value;
621if (this.Length != str.Length)
641if (this.Length != value.Length)
673if (this.Length != value.Length)
678if (this.Length != value.Length)
697if (a is null || b is null || a.Length != b.Length)
731if (a.Length != b.Length)
736if (a.Length != b.Length)
834Debug.Assert(src[Length] == '\0', "src[Length] == '\\0'");
841int length = Length;
928int length = Length;
931Debug.Assert(src[Length] == '\0', "src[this.Length] == '\\0'");
966return GetNonRandomizedHashCodeOrdinalIgnoreCaseSlow(hash1, hash2, this.AsSpan(Length - length));
1117if (value.Length == 0)
1134if (this.Length < value.Length || _firstChar != value._firstChar)
1138return (value.Length == 1) ?
1143((nuint)value.Length) * 2);
1146if (this.Length < value.Length)
1150return Ordinal.EqualsIgnoreCase(ref this.GetRawStringData(), ref value.GetRawStringData(), value.Length);
1182return 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 (85)
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;
542sb.EnsureCapacity(format.Length + args.Length * 8);
698ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)startIndex, (uint)Length, nameof(startIndex));
700int oldLength = Length;
701int insertLength = value.Length;
1056totalLength += value.Length;
1083int valueLen = value.Length;
1130int oldLength = Length;
1148int oldLength = Length;
1165int oldLength = this.Length;
1185if ((uint)startIndex > Length)
1281nuint remainingLength = (uint)(Length - firstIndex);
1282string result = FastAllocateString(Length);
1299nuint length = (uint)Length;
1337if (oldValue.Length == 1)
1343if (newValue.Length == 1)
1357int pos = PackedSpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
1370int pos = SpanHelpers.NonPackedIndexOfChar(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
1386int pos = SpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), Length - i, ref oldValue._firstChar, oldValue.Length);
1392i += pos + oldValue.Length;
1404string dst = ReplaceHelper(oldValue.Length, newValue, replacementIndices.AsSpan());
1415long dstLength = this.Length + ((long)(newValue.Length - oldValueLength)) * indices.Length;
1420Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length);
1440dstIdx += newValue.Length;
1444Debug.Assert(this.Length - thisIdx == dstSpan.Length - dstIdx);
1593else if (replacementText.Length != 1 || replacementText[0] != text[idx])
1608if ((uint)idxOfFirstNewlineChar >= (uint)Length)
1614(uint)(idxOfFirstNewlineChar + 1) < (uint)Length &&
1703if (count <= 1 || Length == 0)
1710if (separators.IsEmpty && count > Length)
1773if (count <= 1 || Length == 0)
1782if (separator!.Length == 0)
1829if ((options & StringSplitOptions.RemoveEmptyEntries) == 0 || candidate.Length != 0)
1851? SplitWithPostProcessing(sepList, default, separator.Length, count, options)
1852: SplitWithoutPostProcessing(sepList, default, separator.Length, count);
1874for (int i = 0; i < numActualReplaces && currIndex < Length; i++)
1881if (currIndex < Length && numActualReplaces >= 0)
2189int currentSepLength = separator.Length;
2224int length = Length - startIndex;
2230if ((uint)startIndex > (uint)Length)
2242if ((ulong)(uint)startIndex + (ulong)(uint)length > (ulong)(uint)Length)
2255if (length == Length)
2269if (startIndex > Length)
2281Debug.Assert(startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!");
2282Debug.Assert(length >= 0 && startIndex <= this.Length - length, "length is out of range!");
2330if (Length == 0 || (!char.IsWhiteSpace(_firstChar) && !char.IsWhiteSpace(this[^1])))
2340if (Length == 0 || (_firstChar != trimChar && this[^1] != trimChar))
2468int end = Length - 1;
2474for (start = 0; start < Length; start++)
2485for (end = Length - 1; end >= start; end--)
2504int end = Length - 1;
2510for (start = 0; start < Length; start++)
2531for (end = Length - 1; end >= start; end--)
2557len == Length ? this :
src\libraries\System.Private.CoreLib\src\System\String.Searching.cs (27)
16if (RuntimeHelpers.IsKnownConstant(value) && value.Length == 1)
24Length,
26value.Length) >= 0;
37=> SpanHelpers.ContainsValueType(ref Unsafe.As<char, short>(ref _firstChar), (short)value, Length);
48public int IndexOf(char value) => SpanHelpers.IndexOfChar(ref _firstChar, value, Length);
52return IndexOf(value, startIndex, Length - startIndex);
79? PackedSpanHelpers.IndexOfAnyIgnoreCase(ref _firstChar, valueLc, Length)
80: SpanHelpers.IndexOfAnyChar(ref _firstChar, valueLc, valueUc, Length);
83return SpanHelpers.IndexOfChar(ref _firstChar, value, Length);
88if ((uint)startIndex > (uint)Length)
93if ((uint)count > (uint)(Length - startIndex))
113return new ReadOnlySpan<char>(ref _firstChar, Length).IndexOfAny(anyOf);
118return IndexOfAny(anyOf, startIndex, Length - startIndex);
128if ((uint)startIndex > (uint)Length)
133if ((uint)count > (uint)(Length - startIndex))
245return IndexOf(value, 0, Length, comparisonType);
250return IndexOf(value, startIndex, Length - startIndex, comparisonType);
270=> SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref _firstChar), (short)value, Length);
279if (Length == 0)
284if ((uint)startIndex >= (uint)Length)
312return new ReadOnlySpan<char>(ref _firstChar, Length).LastIndexOfAny(anyOf);
327if (Length == 0)
332if ((uint)startIndex >= (uint)Length)
355return LastIndexOf(value, Length - 1, Length, StringComparison.CurrentCulture);
370return LastIndexOf(value, Length - 1, Length, comparisonType);
src\libraries\System.Private.CoreLib\src\System\StringComparer.cs (10)
343return Globalization.Ordinal.CompareStringIgnoreCase(ref x.GetRawStringData(), x.Length, ref y.GetRawStringData(), y.Length);
358if (x.Length != y.Length)
362return Globalization.Ordinal.EqualsIgnoreCase(ref x.GetRawStringData(), ref y.GetRawStringData(), x.Length);
506return Globalization.Ordinal.CompareStringIgnoreCase(ref x.GetRawStringData(), x.Length, ref y.GetRawStringData(), y.Length);
521if (x.Length != y.Length)
526return Globalization.Ordinal.EqualsIgnoreCase(ref x.GetRawStringData(), ref y.GetRawStringData(), x.Length);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (23)
106: this(value, 0, value?.Length ?? 0, capacity)
125if (startIndex > value.Length - length)
199if (persistedMaxCapacity < 1 || persistedString.Length > persistedMaxCapacity)
207persistedCapacity = Math.Min(Math.Max(DefaultCapacity, persistedString.Length), persistedMaxCapacity);
210if (persistedCapacity < 0 || persistedCapacity < persistedString.Length || persistedCapacity > persistedMaxCapacity)
218persistedString.CopyTo(0, m_ChunkChars, 0, persistedString.Length);
219m_ChunkLength = persistedString.Length;
334if ((uint)(chunkLength + chunkOffset) > (uint)result.Length || (uint)chunkLength > (uint)sourceArray.Length)
372CopyTo(startIndex, new Span<char>(ref result.GetRawStringData(), result.Length), result.Length);
754Append(ref value.GetRawStringData(), value.Length);
782if (startIndex > value.Length - count)
1134return AppendJoinCore(ref separator.GetRawStringData(), separator.Length, values);
1147return AppendJoinCore(ref separator.GetRawStringData(), separator.Length, values);
1158return AppendJoinCore(ref separator.GetRawStringData(), separator.Length, values);
1169return AppendJoinCore(ref separator.GetRawStringData(), separator.Length, values);
1182return AppendJoinCore(ref separator.GetRawStringData(), separator.Length, values);
1301Insert(index, ref value.GetRawStringData(), value.Length);
1541if ((uint)pos >= (uint)format.Length)
1761if (width <= s.Length)
1768Append(' ', width - s.Length);
1772Append(' ', width - s.Length);
1783if ((uint)pos >= (uint)format.Length)
System.Private.CoreLib.Generators (1)
System.Private.DataContractSerialization (148)
System.Private.Uri (137)
System\Uri.cs (96)
459if (uriString!.Length != 0)
595for (int i = 0; i < relativeStr.Length; ++i)
618if (i + 1 < relativeStr.Length)
639if (relativeStr.Length == 0)
900if (path.Length == 0)
908while (current < path.Length)
913next = path.Length - 1;
1000result = new char[host.Length + 3 + _info.Offset.Fragment - _info.Offset.Path];
1008UriHelper.UnescapeString(host, 0, host.Length, result, ref count, c_DummyChar, c_DummyChar,
1188string.Concat(host.AsSpan(1, host.Length - 2), scopeId) :
1189host.Substring(1, host.Length - 2);
1199UriHelper.UnescapeString(host, 0, host.Length, ref dest,
1266if (string.IsNullOrEmpty(name) || name.Length > short.MaxValue)
1271int end = name.Length;
1279if (IPv6AddressHelper.IsValid(fixedName, 1, ref end) && end == name.Length)
1285end = name.Length;
1286if (IPv4AddressHelper.IsValid(fixedName, 0, ref end, false, false, false) && end == name.Length)
1292if (DomainNameHelper.IsValid(name, iri: false, notImplicitFile: false, out int length) && length == name.Length)
1297if (DomainNameHelper.IsValid(name, iri: true, notImplicitFile: false, out length) && length == name.Length)
1303end = name.Length + 2;
1308if (IPv6AddressHelper.IsValid(newFixedName, 1, ref end) && end == name.Length)
1420ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, pattern.Length);
1423&& (pattern.Length - index >= 3))
1460(pattern.Length - index) >= 3 &&
1895return (uint)index < (uint)uriString.Length && uriString[index] == ':';
1910int length = uriString.Length;
1982int length = _string.Length;
2216info.Offset.End = (ushort)_string.Length;
2250idx = _syntax.SchemeName.Length;
2349info.Offset.End = (ushort)_originalUnicodeString.Length;
2441if (host.Length != 0)
2450result = CheckCanonical(pHost, ref idx, host.Length, c_DummyChar);
2493for (int i = 0; i < host.Length; ++i)
2549if (host.Length == 0)
2586if (host.Length >= c_MaxUriBufferSize)
2595if (CheckAuthorityHelper(pHost, 0, host.Length, ref err, ref flags, _syntax, ref newHost) !=
2596host.Length)
2611host = CreateHostStringHelper(host, 0, host.Length, ref flags, _info);
2613for (int i = 0; i < host.Length; ++i)
2638for (int idx = 0; idx < portStr.Length; ++idx)
2747var dest = str.Length <= StackallocThreshold
2749: new ValueStringBuilder(str.Length);
2764var dest = str.Length <= StackallocThreshold
2766: new ValueStringBuilder(str.Length);
2851if (host.Length != 0)
3046if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3059if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3070if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3155if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3217int length = _string.Length;
3235for (i = 0; i < schemeName.Length; ++i)
3308_info.Offset.User = (ushort)_string.Length;
3309_info.Offset.Host = (ushort)_string.Length;
3312_info.Offset.Path = (ushort)_string.Length;
3329idx = str.Length;
3336idx = str.Length;
3341_info.Offset.Fragment = (ushort)str.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode
3342_info.Offset.End = (ushort)str.Length;
3357origIdx = _originalUnicodeString.Length;
3379origIdx = index == -1 ? _originalUnicodeString.Length : (index + origIdx);
3384if (_string.Length > ushort.MaxValue)
3390length = _string.Length;
3505if (origIdx < _originalUnicodeString.Length && _originalUnicodeString[origIdx] == '?')
3511origIdx = index == -1 ? _originalUnicodeString.Length : (index + origIdx);
3515origIdx = _originalUnicodeString.Length;
3520if (_string.Length > ushort.MaxValue)
3526length = _string.Length;
3571if (origIdx < _originalUnicodeString.Length && _originalUnicodeString[origIdx] == '#')
3573origIdx = _originalUnicodeString.Length;
3577if (_string.Length > ushort.MaxValue)
3583length = _string.Length;
3634while ((uint)i < (uint)uriString.Length && UriHelper.IsLWS(uriString[i]))
3642(uint)i < (uint)uriString.Length && uriString[i] == '/' &&
3643((uint)(i + 1) >= (uint)uriString.Length || uriString[i + 1] is not ('/' or '\\')))
3655if ((uint)(i + 2) >= (uint)uriString.Length ||
3658(uint)i >= (uint)uriString.Length ||
3659(uint)(i + 1) >= (uint)uriString.Length)
3696while ((uint)i < (uint)uriString.Length && uriString[i] is '/' or '\\')
3854if (newHost.Length > ushort.MaxValue)
4717(relativePart.Length == 1 || (relativePart[1] != '/' && relativePart[1] != '\\')))
4736if (relativePart.Length >= 2 && (relativePart[1] == '\\' || relativePart[1] == '/'))
4777if (relativePart.Length >= 2 && relativePart[1] == '/')
4804int length = left.Length;
4805char[] path = new char[length + relativePart.Length];
4821relativePart.CopyTo(0, path, length, relativePart.Length);
4835for (; i < relativePart.Length; ++i)
4846else if (i < relativePart.Length)
4854length += relativePart.Length;
4927for (i = 0; (i < path1.Length) && (i < path2.Length); ++i)
4946if ((i == path1.Length) && (i == path2.Length))
4953for (; i < path1.Length; ++i)
4961if (relPath.Length == 0 && path2.Length - 1 == si)
5042char[] dest = new char[path.Length];
5044dest = UriHelper.UnescapeString(path, 0, path.Length, dest, ref count, c_DummyChar, c_DummyChar,
System\UriExt.cs (17)
60((uriKind == UriKind.Relative || (_string.Length >= 2 && (_string[0] != '\\' || _string[1] != '\\')))
205_string = EscapeUnescapeIri(_originalUnicodeString, 0, _originalUnicodeString.Length,
207if (_string.Length > ushort.MaxValue)
239for ( ; i < data.Length; i++)
244if ((uint)(i + 2) < (uint)data.Length)
460return (CheckCanonical(str, ref idx, _string.Length, c_EOL)
509idx = _info.Offset.Scheme + _syntax.SchemeName.Length + 2;
562idx = _syntax.SchemeName.Length;
564if (idx + 1 >= _string.Length || str[idx] != '/' || str[idx + 1] != '/')
595Debug.Assert(backingString is null || backingString.Length == charsToUnescape.Length);
833if (relativeStr.Length > 0 && (UriHelper.IsLWS(relativeStr[0]) || UriHelper.IsLWS(relativeStr[relativeStr.Length - 1])))
836if (relativeStr.Length == 0)
860if (relativeStr.Length >= 3
906if (_string.Length == 0)
1041return UriHelper.TestForSubPath(selfPtr, self.Length, otherPtr, other.Length,
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 (1058)
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);
896int leftCount = text.Length;
1115int leftCount = text.Length;
1251int writeLen = RawTextNoFlush(text, 0, text.Length);
1253_RawTextAsync(text, writeLen, text.Length - writeLen) :
1266writeLen = RawTextNoFlush(text1, 0, text1.Length);
1271return _RawTextAsync(text1, writeLen, text1.Length - writeLen, text2, text3, text4);
1277writeLen = RawTextNoFlush(text2, 0, text2.Length);
1282return _RawTextAsync(text2, writeLen, text2.Length - writeLen, text3, text4);
1290writeLen = RawTextNoFlush(text3, 0, text3.Length);
1295return _RawTextAsync(text3, writeLen, text3.Length - writeLen, text4);
1302writeLen = RawTextNoFlush(text4, 0, text4.Length);
1305return _RawTextAsync(text4, writeLen, text4.Length - writeLen);
1513int leftCount = text.Length;
1689if (text.Length == 0)
1700int leftCount = text.Length;
1873if (text.Length == 0)
1884int 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)
223if (prefix.Length == 5 && prefix == "xmlns")
237if (ns.Length != 0 && _depth != 0)
542Debug.Assert(prefix.Length == 0 || ns.Length != 0);
554if (ns.Length == 0 && prefix.Length == 0)
726throw new XslTransformException(SR.XmlIl_NmspConflict, new string[] { prefix.Length == 0 ? "" : ":", prefix, ns, nsExisting });
1222if (navigator.NamespaceURI.Length == 0)
1224Debug.Assert(navigator.LocalName.Length != 0, "xmlns:foo='' isn't allowed");
1351Debug.Assert(prefix.Length != 0 && ns.Length != 0);
1414if (isElemPrefix || genPrefix.Length != 0)
1423if (isElemPrefix || genPrefix.Length != 0)
1505Debug.Assert(ValidateNames.ParseNCName(name.Name, 0) == name.Name.Length);
1508prefix = (name.Namespace.Length != 0) ? RemapPrefix(string.Empty, name.Namespace, nodeType == XPathNodeType.Element) : string.Empty;
1527prefix = (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 (57)
System\Xml\Linq\XHashtable.cs (3)
280hashCode = ComputeHashCode(key, 0, key.Length);
299while (!FindEntry(hashCode, key, 0, key.Length, ref entryIndex))
374if (count == keyCompare.Length && string.CompareOrdinal(key, index, keyCompare, 0, count) == 0)
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\Xml\Linq\XNamespace.cs (8)
60return GetName(localName, 0, localName.Length);
120return Get(namespaceName, 0, namespaceName.Length);
217Debug.Assert(index >= 0 && index <= localName.Length, "Caller should have checked that index was in bounds");
218Debug.Assert(count >= 0 && index + count <= localName.Length, "Caller should have checked that count was in bounds");
235Debug.Assert(index >= 0 && index <= namespaceName.Length, "Caller should have checked that index was in bounds");
236Debug.Assert(count >= 0 && index + count <= namespaceName.Length, "Caller should have checked that count was in bounds");
254if (count == xmlPrefixNamespace.Length && string.CompareOrdinal(namespaceName, index, xmlPrefixNamespace, 0, count) == 0) return Xml;
255if (count == xmlnsPrefixNamespace.Length && string.CompareOrdinal(namespaceName, index, xmlnsPrefixNamespace, 0, count) == 0) return Xmlns;
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 (7)
System.Runtime.Numerics (9)
System.Runtime.Serialization.Formatters (2)
System.Runtime.Serialization.Schema (13)
System.Security.Cryptography.Pkcs (5)
System.Security.Cryptography.Xml (26)
System.Security.Permissions (2)
System.ServiceModel.Federation (1)
System.ServiceModel.NetFramingBase (1)
System.ServiceModel.NetNamedPipe (5)
System.ServiceModel.NetNamedPipe.Tests (2)
System.ServiceModel.Syndication (3)
System.Text.Encoding.CodePages (6)
System.Text.Encodings.Web (11)
System.Text.Json (12)
System.Text.Json.SourceGeneration (3)
System.Text.RegularExpressions (173)
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 (141)
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.Analyzers.VisualBasic.Tests (6)
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 (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),
TestTasks (1)
Text.Analyzers (204)
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)
366if (name.Length > 0)
TlsFeaturesObserve (1)
UIAutomationClient (6)
UIAutomationClientSideProviders (27)
UIAutomationTypes (1)
vbc (3)
VBCSCompiler (4)
VBCSCompiler.UnitTests (2)
VersioningWebSite (1)
VisualBasicSyntaxGenerator (13)
Wasm.Performance.ConsoleHost (7)
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)