1 write to SemanticModel
Microsoft.CodeAnalysis.Workspaces (1)
Editing\DocumentEditor.cs (1)
22SemanticModel = model;
58 references to SemanticModel
Microsoft.Analyzers.Extra (3)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (3)
144var sm = docEditor.SemanticModel; 472var sm = docEditor.SemanticModel; 582var sm = docEditor.SemanticModel;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
509var operation = documentEditor.SemanticModel.GetRequiredOperation(objectCreationExpression, cancellationToken);
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
509var operation = documentEditor.SemanticModel.GetRequiredOperation(objectCreationExpression, cancellationToken);
Microsoft.CodeAnalysis.Features (2)
PullMemberUp\MembersPuller.cs (1)
372destinationEditor.SemanticModel,
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
83var symbol = documentEditor.SemanticModel.GetDeclaredSymbol(node, cancellationToken);
Microsoft.Interop.ComInterfaceGenerator (6)
Analyzers\AddGeneratedComClassFixer.cs (3)
29var declaringType = editor.SemanticModel.GetDeclaredSymbol(node, ct) as INamedTypeSymbol; 33var attribute = gen.Attribute(gen.TypeExpression(editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.GeneratedComClassAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)); 47var comVisibleAttributeType = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.System_Runtime_InteropServices_ComVisibleAttribute);
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (3)
79var comp = editor.SemanticModel.Compilation; 80var declaringType = editor.SemanticModel.GetDeclaredSymbol(node, ct); 129IMethodSymbol method = (IMethodSymbol)editor.SemanticModel.GetDeclaredSymbol(member, ct);
Microsoft.Interop.LibraryImportGenerator (45)
Analyzers\ConvertToLibraryImportFixer.cs (14)
181if (editor.SemanticModel.GetDeclaredSymbol(methodSyntax, cancellationToken) is not IMethodSymbol methodSymbol) 217INamedTypeSymbol? dllImportAttrType = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.DllImportAttribute); 222INamedTypeSymbol libraryImportAttrType = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.LibraryImportAttribute)!; 263editor.Generator.TypeExpression(editor.SemanticModel.Compilation.GetSpecialType(SpecialType.System_Int32))); 416editor.SemanticModel.Compilation.GetBestTypeByMetadataName( 468ITypeSymbol stringMarshallingType = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.StringMarshalling)!; 477ITypeSymbol stringMarshallingType = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.StringMarshalling)!; 485generator.TypeOfExpression(generator.TypeExpression(editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.AnsiStringMarshaller))))); 589if (editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.UnmanagedCallConvAttribute) is null) 605CallingConvention.Cdecl => editor.SemanticModel.Compilation.ObjectType.ContainingAssembly. 607CallingConvention.StdCall => editor.SemanticModel.Compilation.ObjectType.ContainingAssembly. 609CallingConvention.ThisCall => editor.SemanticModel.Compilation.ObjectType.ContainingAssembly. 611CallingConvention.FastCall => editor.SemanticModel.Compilation.ObjectType.ContainingAssembly. 632generator.TypeExpression(editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.System_Type)),
Analyzers\CustomMarshallerAttributeFixer.cs (31)
208var (_, methods) = StatelessMarshallerShapeHelper.GetShapeForType(marshallerType, managedType, isLinearCollectionMarshaller, editor.SemanticModel.Compilation); 209INamedTypeSymbol spanOfT = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.System_Span_Metadata)!; 210INamedTypeSymbol readOnlySpanOfT = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.System_ReadOnlySpan_Metadata)!; 228statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 240statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 248gen.TypeExpression(editor.SemanticModel.Compilation.GetSpecialType(SpecialType.System_Int32)), 251gen.GetAccessorDeclaration(statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) }))); 267statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 283statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 298statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 314statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 330statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 345statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 382return gen.TypeExpression(editor.SemanticModel.Compilation.GetSpecialType(SpecialType.System_IntPtr)); 396return editor.SemanticModel.Compilation.GetSpecialType(SpecialType.System_IntPtr); 404var (_, methods) = StatefulMarshallerShapeHelper.GetShapeForType(marshallerType, managedType, isLinearCollectionMarshaller, editor.SemanticModel.Compilation); 405INamedTypeSymbol spanOfT = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.System_Span_Metadata)!; 406INamedTypeSymbol readOnlySpanOfT = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.System_ReadOnlySpan_Metadata)!; 422statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 432statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 442statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 452statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 460gen.TypeExpression(editor.SemanticModel.Compilation.GetSpecialType(SpecialType.System_Int32)), 463gen.GetAccessorDeclaration(statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) }))); 473statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 483statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 497statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 511statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 520statements: new[] { DefaultMethodStatement(gen, editor.SemanticModel.Compilation) })); 549return gen.TypeExpression(editor.SemanticModel.Compilation.GetSpecialType(SpecialType.System_IntPtr)); 563return editor.SemanticModel.Compilation.GetSpecialType(SpecialType.System_IntPtr);