27 references to Optional
Microsoft.CodeAnalysis (2)
Operations\Operation.cs (1)
103return new Optional<object?>(OperationConstantValue.Value);
Optional.cs (1)
60return new Optional<T>(value);
Microsoft.CodeAnalysis.CodeStyle (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (6)
48return new Optional<bool?>(null); 52return optionalBool.HasValue ? new Optional<bool?>(optionalBool.Value) : new Optional<bool?>(); 103parseValue: str => TryParseEnum<T>(str, out var result) ? new Optional<T>(result) : new Optional<T>(), 117=> new(parseValue: str => map.TryGetValue(str, out var result) || alternative.TryGetValue(str, out result) ? new Optional<T>(result) : new Optional<T>(), 143return new Optional<T?>(null); 148return new Optional<T?>(parsedValue);
Microsoft.CodeAnalysis.CSharp (1)
Compilation\MemberSemanticModel.cs (1)
1266: new Optional<object>(constantValue.Value);
Microsoft.CodeAnalysis.Features (1)
Completion\CompletionList.cs (1)
168=> With(itemsList: new(itemsList));
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\OperationTestAnalyzer.cs (1)
280advanceIncrementOpt = new Optional<object>(1);
Microsoft.CodeAnalysis.Workspaces (10)
CodeRefactorings\FixAllOccurences\FixAllState.cs (1)
103return spansByDocument.Select(kvp => KeyValuePairUtil.Create(kvp.Key, new Optional<ImmutableArray<TextSpan>>(kvp.Value)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (6)
48return new Optional<bool?>(null); 52return optionalBool.HasValue ? new Optional<bool?>(optionalBool.Value) : new Optional<bool?>(); 103parseValue: str => TryParseEnum<T>(str, out var result) ? new Optional<T>(result) : new Optional<T>(), 117=> new(parseValue: str => map.TryGetValue(str, out var result) || alternative.TryGetValue(str, out result) ? new Optional<T>(result) : new Optional<T>(), 143return new Optional<T?>(null); 148return new Optional<T?>(parsedValue);
Storage\SQLite\v2\Interop\SqlConnection.cs (2)
298static (self, blobHandle) => new Optional<Stream>(self.ReadBlob(blobHandle))); 317return new Optional<Checksum>(result);
Workspace\Solution\DocumentInfo.cs (1)
139=> With(documentServiceProvider: new(provider));
Microsoft.Interop.SourceGeneration (5)
StubEnvironment.cs (5)
30_lcidConversionAttrType = new Optional<INamedTypeSymbol?>(Compilation.GetTypeByMetadataName(TypeNames.LCIDConversionAttribute)); 44_suppressGCTransitionAttrType = new Optional<INamedTypeSymbol?>(Compilation.GetTypeByMetadataName(TypeNames.SuppressGCTransitionAttribute)); 58_unmanagedCallConvAttrType = new Optional<INamedTypeSymbol?>(Compilation.GetTypeByMetadataName(TypeNames.UnmanagedCallConvAttribute)); 72_defaultDllImportSearchPathsAttrType = new Optional<INamedTypeSymbol?>(Compilation.GetTypeByMetadataName(TypeNames.DefaultDllImportSearchPathsAttribute)); 86_wasmImportLinkageAttrType = new Optional<INamedTypeSymbol?>(Compilation.GetTypeByMetadataName(TypeNames.WasmImportLinkageAttribute));
Microsoft.VisualStudio.LanguageServices (1)
Options\VisualStudioSettingsOptionPersister.cs (1)
150return new Optional<object?>(codeStyle.FromXElement(XElement.Parse(value)));