1 write to SemanticModel
Microsoft.CodeAnalysis.Workspaces (1)
Editing\DocumentEditor.cs (1)
22SemanticModel = model;
53 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.Features (1)
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
88var symbol = documentEditor.SemanticModel.GetDeclaredSymbol(node, cancellationToken);
Microsoft.Interop.ComInterfaceGenerator (4)
Analyzers\AddGeneratedComClassFixer.cs (1)
28var attribute = gen.Attribute(gen.TypeExpression(editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.GeneratedComClassAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation));
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (3)
75var comp = editor.SemanticModel.Compilation; 76var declaringType = editor.SemanticModel.GetDeclaredSymbol(node, ct); 125IMethodSymbol method = (IMethodSymbol)editor.SemanticModel.GetDeclaredSymbol(member, ct);
Microsoft.Interop.LibraryImportGenerator (45)
Analyzers\ConvertToLibraryImportFixer.cs (14)
169if (editor.SemanticModel.GetDeclaredSymbol(methodSyntax, cancellationToken) is not IMethodSymbol methodSymbol) 205INamedTypeSymbol? dllImportAttrType = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.DllImportAttribute); 210INamedTypeSymbol libraryImportAttrType = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.LibraryImportAttribute)!; 251editor.Generator.TypeExpression(editor.SemanticModel.Compilation.GetSpecialType(SpecialType.System_Int32))); 404editor.SemanticModel.Compilation.GetBestTypeByMetadataName( 456ITypeSymbol stringMarshallingType = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.StringMarshalling)!; 465ITypeSymbol stringMarshallingType = editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.StringMarshalling)!; 473generator.TypeOfExpression(generator.TypeExpression(editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.AnsiStringMarshaller))))); 577if (editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.UnmanagedCallConvAttribute) is null) 593CallingConvention.Cdecl => editor.SemanticModel.Compilation.ObjectType.ContainingAssembly. 595CallingConvention.StdCall => editor.SemanticModel.Compilation.ObjectType.ContainingAssembly. 597CallingConvention.ThisCall => editor.SemanticModel.Compilation.ObjectType.ContainingAssembly. 599CallingConvention.FastCall => editor.SemanticModel.Compilation.ObjectType.ContainingAssembly. 620generator.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);