1 write to SemanticModel
Microsoft.CodeAnalysis.Workspaces (1)
Editing\DocumentEditor.cs (1)
22
SemanticModel
= model;
53 references to SemanticModel
Microsoft.Analyzers.Extra (3)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (3)
144
var sm = docEditor.
SemanticModel
;
472
var sm = docEditor.
SemanticModel
;
582
var sm = docEditor.
SemanticModel
;
Microsoft.CodeAnalysis.Features (1)
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
88
var symbol = documentEditor.
SemanticModel
.GetDeclaredSymbol(node, cancellationToken);
Microsoft.Interop.ComInterfaceGenerator (4)
Analyzers\AddGeneratedComClassFixer.cs (1)
28
var attribute = gen.Attribute(gen.TypeExpression(editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.GeneratedComClassAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation));
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (3)
75
var comp = editor.
SemanticModel
.Compilation;
76
var declaringType = editor.
SemanticModel
.GetDeclaredSymbol(node, ct);
125
IMethodSymbol method = (IMethodSymbol)editor.
SemanticModel
.GetDeclaredSymbol(member, ct);
Microsoft.Interop.LibraryImportGenerator (45)
Analyzers\ConvertToLibraryImportFixer.cs (14)
169
if (editor.
SemanticModel
.GetDeclaredSymbol(methodSyntax, cancellationToken) is not IMethodSymbol methodSymbol)
205
INamedTypeSymbol? dllImportAttrType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.DllImportAttribute);
210
INamedTypeSymbol libraryImportAttrType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.LibraryImportAttribute)!;
251
editor.Generator.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_Int32)));
404
editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(
456
ITypeSymbol stringMarshallingType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.StringMarshalling)!;
465
ITypeSymbol stringMarshallingType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.StringMarshalling)!;
473
generator.TypeOfExpression(generator.TypeExpression(editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.AnsiStringMarshaller)))));
577
if (editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.UnmanagedCallConvAttribute) is null)
593
CallingConvention.Cdecl => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
595
CallingConvention.StdCall => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
597
CallingConvention.ThisCall => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
599
CallingConvention.FastCall => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
620
generator.TypeExpression(editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_Type)),
Analyzers\CustomMarshallerAttributeFixer.cs (31)
208
var (_, methods) = StatelessMarshallerShapeHelper.GetShapeForType(marshallerType, managedType, isLinearCollectionMarshaller, editor.
SemanticModel
.Compilation);
209
INamedTypeSymbol spanOfT = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_Span_Metadata)!;
210
INamedTypeSymbol readOnlySpanOfT = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_ReadOnlySpan_Metadata)!;
228
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
240
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
248
gen.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_Int32)),
251
gen.GetAccessorDeclaration(statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) })));
267
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
283
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
298
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
314
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
330
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
345
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
382
return gen.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_IntPtr));
396
return editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_IntPtr);
404
var (_, methods) = StatefulMarshallerShapeHelper.GetShapeForType(marshallerType, managedType, isLinearCollectionMarshaller, editor.
SemanticModel
.Compilation);
405
INamedTypeSymbol spanOfT = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_Span_Metadata)!;
406
INamedTypeSymbol readOnlySpanOfT = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_ReadOnlySpan_Metadata)!;
422
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
432
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
442
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
452
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
460
gen.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_Int32)),
463
gen.GetAccessorDeclaration(statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) })));
473
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
483
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
497
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
511
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
520
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
549
return gen.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_IntPtr));
563
return editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_IntPtr);