示例#1
0
        public virtual TResult VisitDiscard(IDiscardSymbol symbol)
        {
#pragma warning disable CS8717 // A member returning a [MaybeNull] value introduces a null value when 'TResult' is a non-nullable reference type.
            return(DefaultVisit(symbol));

#pragma warning restore CS8717 // A member returning a [MaybeNull] value introduces a null value when 'TResult' is a non-nullable reference type.
        }
示例#2
0
        public override void VisitDiscard(IDiscardSymbol symbol)
        {
            if (format.LocalOptions.IncludesOption(SymbolDisplayLocalOptions.IncludeType))
            {
                symbol.Type.Accept(this);
                AddSpace();
            }

            builder.Add(CreatePart(SymbolDisplayPartKind.Punctuation, symbol, "_"));
        }
示例#3
0
        public override void VisitDiscard(IDiscardSymbol symbol)
        {
            if (format.LocalOptions.IncludesOption(SymbolDisplayLocalOptions.IncludeType))
            {
                VisitTypeWithAnnotations(TypeWithAnnotations.Create((TypeSymbol)symbol.Type, symbol.NullableAnnotation.ToInternalAnnotation()));
                AddSpace();
            }

            builder.Add(CreatePart(SymbolDisplayPartKind.Punctuation, symbol, "_"));
        }
示例#4
0
 public virtual TResult?VisitDiscard(IDiscardSymbol symbol)
 {
     return(DefaultVisit(symbol));
 }
示例#5
0
 public virtual void VisitDiscard(IDiscardSymbol symbol)
 {
     DefaultVisit(symbol);
 }
示例#6
0
 private void AddDescriptionForDiscard(IDiscardSymbol symbol)
 {
     AddToGroup(SymbolDescriptionGroups.MainDescription,
                Description(FeaturesResources.discard),
                ToMinimalDisplayParts(symbol, MinimallyQualifiedFormatWithConstants));
 }
示例#7
0
 /// <inheritdoc />
 public override void VisitDiscard(IDiscardSymbol symbol) => Visit(symbol);
示例#8
0
 public virtual TResult VisitDiscard(IDiscardSymbol symbol, TArgument argument)
 {
     return(DefaultVisit(symbol, argument));
 }
示例#9
0
 public override void VisitDiscard(IDiscardSymbol symbol)
 {
     base.VisitDiscard(symbol);
 }
示例#10
0
        public override void VisitDiscard(IDiscardSymbol symbol)
        {
            if (format.LocalOptions.IncludesOption(SymbolDisplayLocalOptions.IncludeType))
            {
                symbol.Type.Accept(this);
                AddSpace();
            }

            builder.Add(CreatePart(SymbolDisplayPartKind.Punctuation, symbol, "_"));
        }
示例#11
0
 public virtual void VisitDiscard(IDiscardSymbol symbol)
 {
     DefaultVisit(symbol);
 }
示例#12
0
 /// <summary>
 /// Try getting the <see cref="ILocalSymbol"/> for the node.
 /// Gets the semantic model for the tree if the node is not in the tree corresponding to <paramref name="semanticModel"/>.
 /// </summary>
 /// <param name="semanticModel">The <see cref="SemanticModel"/>.</param>
 /// <param name="node">The <see cref="VariableDesignationSyntax"/>.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
 /// <param name="symbol">The symbol if found.</param>
 /// <returns>True if a symbol was found.</returns>
 public static bool TryGetSymbol(this SemanticModel semanticModel, DiscardDesignationSyntax node, CancellationToken cancellationToken, out IDiscardSymbol symbol)
 {
     symbol = GetDeclaredSymbolSafe(semanticModel, node, cancellationToken);
     return(symbol != null);
 }